---
title: "Prefill text fields"
url: "https://docs.signnow.com/docs/document/operations/put-v2-documents-document_id-prefill-texts"
type: "endpoint"
section: "document"
slug: "document/operations/put-v2-documents-document_id-prefill-texts"
method: "PUT"
path: "/v2/documents/{document_id}/prefill-texts"
operation_id: "put-v2-documents-document_id-prefill-texts"
authorization: "bearer"
---

# Prefill text fields

`PUT /v2/documents/{document_id}/prefill-texts`

This endpoint allows users to prefill text fields that signers can edit. Only fields of type `text` can be prefilled.

**Example**

<img src="/reference-assets/images/Screenshots with attribute explanations/Prefill_text_example.png" alt="Prefilled text">


## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_id` | string | Yes |  ID of the requested document. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "fields"
  ],
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "field_name",
          "prefilled_text"
        ],
        "properties": {
          "field_name": {
            "type": "string",
            "minLength": 1,
            "description": "The unique field name that identifies the field. Can be found in the `name` parameter of the field in response from `GET /document/{document_id}`."
          },
          "prefilled_text": {
            "type": "string",
            "minLength": 1,
            "description": "The value that should appear on the document."
          }
        }
      },
      "minItems": 1,
      "description": "The array that contains field objects to add values to. Each field object is identified by the `field_name`.",
      "uniqueItems": true
    }
  },
  "x-examples": {
    "example-1": {
      "fields": [
        {
          "field_name": "first_name",
          "prefilled_text": "Jane"
        },
        {
          "field_name": "last_name",
          "prefilled_text": "Mitchell"
        }
      ]
    }
  },
  "description": ""
}
```

**Example** (`example-1`)

```json
{
  "fields": [
    {
      "field_name": "first_name",
      "prefilled_text": "Jane"
    },
    {
      "field_name": "last_name",
      "prefilled_text": "Doe"
    }
  ]
}
```

## Responses

### 204

Returns 204: Success, no content, when the text fields have been successfully prefilled. Returns an error when the request is sent with an invalid ID, or the added value doesn't pass the field validation setting.

**Example** (`example-1`)

```json
{
  "Status": "204 Success, no content"
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X PUT \
  "https://api.signnow.com/v2/documents/{document_id}/prefill-texts" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fields": [{"field_name": "first_name", "prefilled_text": "Jane"}, {"field_name": "last_name", "prefilled_text": "Doe"}]}'
```

---
*Full reference: https://docs.signnow.com/docs/document/operations/put-v2-documents-document_id-prefill-texts*
