Documenso

Fields API

Add signature and form fields to documents via API.

This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference, see the OpenAPI Reference.

Field Object

PropertyTypeDescription
idnumberUnique field identifier
secondaryIdstringSecondary identifier for audit logs
typestringField type (see Field Types)
recipientIdnumberID of the recipient assigned to this field
envelopeIdnumberID of the parent envelope
envelopeItemIdstringID of the PDF item the field is placed on
pagenumberPage number (1-indexed)
positionXnumberX coordinate as percentage (0-100)
positionYnumberY coordinate as percentage (0-100)
widthnumberWidth as percentage of page (0-100)
heightnumberHeight as percentage of page (0-100)
customTextstringValue entered by the recipient
insertedbooleanWhether the field has been completed
fieldMetaobject | nullType-specific configuration options

Example Field Object

{
  "id": 456,
  "secondaryId": "field_abc123",
  "type": "SIGNATURE",
  "recipientId": 123,
  "envelopeId": 789,
  "envelopeItemId": "envelope_item_xyz",
  "page": 1,
  "positionX": 10,
  "positionY": 80,
  "width": 30,
  "height": 5,
  "customText": "",
  "inserted": false,
  "fieldMeta": {
    "type": "signature",
    "required": true
  }
}

Field Types

TypeDescriptionAuto-filled
SIGNATUREDrawn, typed, or uploaded signatureNo
FREE_SIGNATUREUnrestricted signature without validationNo
INITIALSRecipient's initialsNo
NAMERecipient's full nameYes
EMAILRecipient's email addressYes
DATEDate the field was completedYes
TEXTFree-form text inputNo
NUMBERNumeric input with optional validationNo
RADIOSingle selection from optionsNo
CHECKBOXMultiple selections from optionsNo
DROPDOWNSingle selection from a dropdown menuNo

Get Field

Retrieve a single field by ID.

GET /envelope/field/{fieldId}

Path Parameters

ParameterTypeDescription
fieldIdnumberThe field ID

Code Examples

curl -X GET "https://app.documenso.com/api/v2/envelope/field/456" \
  -H "Authorization: api_xxxxxxxxxxxxxxxx"
const response = await fetch(
  'https://app.documenso.com/api/v2/envelope/field/456',
  {
    method: 'GET',
    headers: {
      Authorization: 'api_xxxxxxxxxxxxxxxx',
    },
  }
);

const field = await response.json();
console.log(field.type, field.page);

Response

Returns the field object.


Create Fields

Add one or more fields to a document.


POST /envelope/field/create-many

Request Body

FieldTypeRequiredDescription
documentIdnumberYesThe document ID
fieldsarrayYesArray of field configurations

Code Examples

curl -X POST "https://app.documenso.com/api/v2/envelope/field/create-many" \
  -H "Authorization: api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "documentId": 123,
    "fields": [
      {
        "type": "SIGNATURE",
        "recipientId": 456,
        "pageNumber": 1,
        "pageX": 10,
        "pageY": 80,
        "width": 30,
        "height": 5
      },
      {
        "type": "DATE",
        "recipientId": 456,
        "pageNumber": 1,
        "pageX": 50,
        "pageY": 80,
        "width": 20,
        "height": 3
      },
      {
        "type": "TEXT",
        "recipientId": 456,
        "pageNumber": 1,
        "pageX": 10,
        "pageY": 70,
        "width": 40,
        "height": 4,
        "fieldMeta": {
          "type": "text",
          "label": "Job Title",
          "placeholder": "Enter your job title",
          "required": true
        }
      }
    ]
  }'
const response = await fetch(
  'https://app.documenso.com/api/v2/envelope/field/create-many',
  {
    method: 'POST',
    headers: {
      Authorization: 'api_xxxxxxxxxxxxxxxx',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      documentId: 123,
      fields: [
        {
          type: 'SIGNATURE',
          recipientId: 456,
          pageNumber: 1,
          pageX: 10,
          pageY: 80,
          width: 30,
          height: 5,
        },
        {
          type: 'DATE',
          recipientId: 456,
          pageNumber: 1,
          pageX: 50,
          pageY: 80,
          width: 20,
          height: 3,
        },
        {
          type: 'TEXT',
          recipientId: 456,
          pageNumber: 1,
          pageX: 10,
          pageY: 70,
          width: 40,
          height: 4,
          fieldMeta: {
            type: 'text',
            label: 'Job Title',
            placeholder: 'Enter your job title',
            required: true,
          },
        },
      ],
    }),
  }
);

const { fields } = await response.json();
console.log(`Created ${fields.length} fields`);

Response

{
  "fields": [
    {
      "id": 101,
      "type": "SIGNATURE",
      "recipientId": 456,
      "page": 1,
      "positionX": 10,
      "positionY": 80,
      "width": 30,
      "height": 5
    },
    {
      "id": 102,
      "type": "DATE",
      "recipientId": 456,
      "page": 1,
      "positionX": 50,
      "positionY": 80,
      "width": 20,
      "height": 3
    },
    {
      "id": 103,
      "type": "TEXT",
      "recipientId": 456,
      "page": 1,
      "positionX": 10,
      "positionY": 70,
      "width": 40,
      "height": 4
    }
  ]
}

Update Fields

Update one or more fields in a single request.

POST /envelope/field/update-many

Request Body

FieldTypeRequiredDescription
documentIdnumberYesThe document ID
fieldsarrayYesArray of field update objects

Code Examples

curl -X POST "https://app.documenso.com/api/v2/envelope/field/update-many" \
  -H "Authorization: api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "documentId": 123,
    "fields": [
      {
        "id": 101,
        "type": "SIGNATURE",
        "pageY": 85
      },
      {
        "id": 102,
        "type": "DATE",
        "pageY": 85
      }
    ]
  }'
const response = await fetch(
  'https://app.documenso.com/api/v2/envelope/field/update-many',
  {
    method: 'POST',
    headers: {
      Authorization: 'api_xxxxxxxxxxxxxxxx',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      documentId: 123,
      fields: [
        { id: 101, type: 'SIGNATURE', pageY: 85 },
        { id: 102, type: 'DATE', pageY: 85 },
      ],
    }),
  }
);

const { fields } = await response.json();

Response

{
  "fields": [
    { "id": 101, "type": "SIGNATURE", "positionY": 85 },
    { "id": 102, "type": "DATE", "positionY": 85 }
  ]
}

Delete Field

Remove a field from a document.

POST /envelope/field/delete

Request Body

FieldTypeRequiredDescription
fieldIdnumberYesThe field ID

Code Examples

curl -X POST "https://app.documenso.com/api/v2/envelope/field/delete" \
  -H "Authorization: api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "fieldId": 456
  }'
const response = await fetch(
  'https://app.documenso.com/api/v2/envelope/field/delete',
  {
    method: 'POST',
    headers: {
      Authorization: 'api_xxxxxxxxxxxxxxxx',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      fieldId: 456,
    }),
  }
);

const { success } = await response.json();

Response

{
  "success": true
}

Field Positioning

Fields use percentage-based coordinates relative to the PDF page dimensions.

PropertyRangeDescription
positionX0-100Horizontal position from left edge (0 = left edge)
positionY0-100Vertical position from top edge (0 = top edge)
width0-100Field width as percentage of page width
height0-100Field height as percentage of page height
page1+Page number (1-indexed)

Coordinate System

(0,0) ─────────────────────────── (100,0)
  │                                   │
  │    ┌─────────┐                    │
  │    │  Field  │ (pageX: 10,        │
  │    │         │  pageY: 20,        │
  │    └─────────┘  width: 30,        │
  │                 height: 5)        │
  │                                   │
(0,100) ─────────────────────────(100,100)

Example: Position a Signature at Bottom Right

const field = {
  type: 'SIGNATURE',
  recipientId: 123,
  pageNumber: 1,
  pageX: 60, // 60% from left
  pageY: 85, // 85% from top (near bottom)
  width: 30, // 30% of page width
  height: 8, // 8% of page height
};

Placeholder-Based Field Positioning

Instead of specifying exact coordinates, you can position fields using placeholder text embedded in your PDF. Include placeholder markers such as {{signature, r1}} in your document, and Documenso will create fields at those locations when the document is uploaded.

This approach is useful when generating PDFs programmatically or using templates with consistent layouts.

See the PDF Placeholders guide for the full placeholder format reference, including supported field types, recipient identifiers, and field options.


Field Meta Options

Each field type supports specific configuration through fieldMeta.

Common Options

All field types support these base options:

OptionTypeDescription
labelstringDisplay text shown near the field
placeholderstringHint text when field is empty
requiredbooleanWhether field must be completed
readOnlybooleanLock field with a pre-filled value
fontSizenumberText size in pixels (8-96, default: 12)

Signature Field

{
  "type": "SIGNATURE",
  "fieldMeta": {
    "type": "signature",
    "required": true
  }
}

Text Field

{
  "type": "TEXT",
  "fieldMeta": {
    "type": "text",
    "label": "Company Name",
    "placeholder": "Enter company name",
    "text": "Default value",
    "characterLimit": 100,
    "textAlign": "left",
    "required": true
  }
}
OptionTypeDescription
textstringDefault value
characterLimitnumberMaximum characters allowed
textAlignstringleft, center, or right
lineHeightnumberSpacing between lines (1-10)
letterSpacingnumberSpacing between characters (0-100)

Number Field

{
  "type": "NUMBER",
  "fieldMeta": {
    "type": "number",
    "label": "Quantity",
    "minValue": 1,
    "maxValue": 100,
    "value": "10",
    "required": true
  }
}
OptionTypeDescription
valuestringDefault value
minValuenumberMinimum allowed value
maxValuenumberMaximum allowed value
numberFormatstringDisplay format

Date Field

{
  "type": "DATE",
  "fieldMeta": {
    "type": "date",
    "textAlign": "left",
    "required": true
  }
}

Checkbox Field

{
  "type": "CHECKBOX",
  "fieldMeta": {
    "type": "checkbox",
    "label": "Agreements",
    "values": [
      { "id": 1, "value": "Terms of Service", "checked": false },
      { "id": 2, "value": "Privacy Policy", "checked": false }
    ],
    "validationRule": "min",
    "validationLength": 1,
    "direction": "vertical",
    "required": true
  }
}
OptionTypeDescription
valuesarrayList of checkbox options
validationRulestringValidation type for selections
validationLengthnumberNumber for validation rule
directionstringvertical or horizontal layout

Radio Field

{
  "type": "RADIO",
  "fieldMeta": {
    "type": "radio",
    "label": "Payment Method",
    "values": [
      { "id": 1, "value": "Credit Card", "checked": false },
      { "id": 2, "value": "Bank Transfer", "checked": true },
      { "id": 3, "value": "Check", "checked": false }
    ],
    "direction": "vertical",
    "required": true
  }
}
{
  "type": "DROPDOWN",
  "fieldMeta": {
    "type": "dropdown",
    "label": "Country",
    "values": [{ "value": "United States" }, { "value": "Canada" }, { "value": "United Kingdom" }],
    "defaultValue": "United States",
    "required": true
  }
}
OptionTypeDescription
valuesarrayList of dropdown options
defaultValuestringPre-selected option

Complete Example

Create a document with a signature block containing multiple field types:

async function addSignatureBlock(documentId: number, recipientId: number) {
  const fields = [
    // Signature
    {
      type: 'SIGNATURE',
      recipientId,
      pageNumber: 1,
      pageX: 10,
      pageY: 80,
      width: 30,
      height: 8,
      fieldMeta: {
        type: 'signature',
        required: true,
      },
    },
    // Printed name
    {
      type: 'NAME',
      recipientId,
      pageNumber: 1,
      pageX: 10,
      pageY: 90,
      width: 30,
      height: 4,
      fieldMeta: {
        type: 'name',
        label: 'Printed Name',
      },
    },
    // Date
    {
      type: 'DATE',
      recipientId,
      pageNumber: 1,
      pageX: 50,
      pageY: 80,
      width: 20,
      height: 4,
      fieldMeta: {
        type: 'date',
        label: 'Date',
      },
    },
    // Job title
    {
      type: 'TEXT',
      recipientId,
      pageNumber: 1,
      pageX: 50,
      pageY: 90,
      width: 30,
      height: 4,
      fieldMeta: {
        type: 'text',
        label: 'Title',
        placeholder: 'Enter your job title',
      },
    },
  ];

  const response = await fetch('https://app.documenso.com/api/v2/envelope/field/create-many', {
    method: 'POST',
    headers: {
      Authorization: 'api_xxxxxxxxxxxxxxxx',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ documentId, fields }),
  });

  return response.json();
}

Error Responses

StatusDescription
400Invalid field configuration or document already sent
401Invalid or missing API key
404Document, recipient, or field not found
500Server error

Fields cannot be modified after a document is sent for signing. Make all field changes while the document is in DRAFT status.


See Also

On this page