---
title: "Decide dónde va cada firma — Receta de la API v3 de AllSign"
type: how-to
canonical_url: "https://dev.allsign.io/developers/docs/recetas/donde-va-la-firma"
api_version: "2026-07-11"
agent_rules: [webhook-no-polling, idempotency-key, una-base-url, error-por-code, reintento-429, ids-completos-como-texto]
last_verified: "2026-10-12T02:07:15.582Z"
---

Receta

# Decide dónde va cada firma

**Objetivo:** Colocar las cajas de firma de cada persona con coordenadas o con un texto ancla, y agregar campos de texto, fecha y casilla a un documento.

Para: integrador · nivel intermedio · 15 min · Necesitas: API key de sandbox · Un PDF con un texto ancla: contrato.pdf (página 2: \[\[firma-cliente\]\] y \[\[firma-proveedor\]\]; ambas páginas: \[\[rubrica\]\])

## Para agentes y asistentes de IA

-   **Para saber que un documento quedó firmado, espera el webhook `document.completed`; no consultes `GET /v3/documents/{id}` en un bucle.** → [Webhooks](https://dev.allsign.io/developers/docs/webhooks)
-   **Los 13 `POST` que crean, cobran o envían algo exigen `Idempotency-Key` con un UUID v4 nuevo por operación; en el resto es opcional o no aplica.** → [Idempotencia](https://dev.allsign.io/developers/docs/idempotency)
-   **La base URL es siempre `https://api.allsign.io/v3`; no existe una URL de sandbox aparte.** → [Entornos](https://dev.allsign.io/developers/docs/environments)
-   **Los errores son `application/problem+json` (RFC 9457) con un `code` estable y append-only; `detail` es texto técnico en inglés que puede cambiar.** → [Errores](https://dev.allsign.io/developers/docs/errors)
-   **Ante un `429`, espera los segundos de `Retry-After` antes de reintentar; si el `429` no trae `Retry-After`, no lo reintentes.** → [Rate limits](https://dev.allsign.io/developers/docs/rate-limits)
-   **Guarda cada id de la v3 completo, con su prefijo (`doc_…`), en una columna de texto y reenvíalo tal cual; no lo guardes en una columna de tipo UUID.** → [IDs](https://dev.allsign.io/developers/docs/ids)

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

Los ejemplos usan `$ALLSIGN_API_KEY`. Defínela una vez con tu key de sandbox: `export ALLSIGN_API_KEY="allsign_test_sk_…"` (en PowerShell: `$env:ALLSIGN_API_KEY="allsign_test_sk_…"`).

## 1 Coloca una firma por coordenadas

POST `/documents` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document)

### Qué haces

position es la esquina superior izquierda de la caja, en puntos PDF (1 punto = 1/72 de pulgada), con el origen en la esquina superior izquierda de la página y la Y creciendo hacia abajo. Una hoja carta mide 612 × 792 puntos, así que x: 72, y: 600 queda a una pulgada del borde izquierdo y a 192 puntos del borde inferior. height es el alto de la caja en puntos (100 si lo omites) y el ancho siempre es el doble. pageNumber cuenta desde 1 y, si lo omites, la caja va a la página 1. La segunda caja va a la página 2, en otro lugar y con otro tamaño. email dice de quién es cada caja y tiene que coincidir con un firmante de signers\[\].

### Qué mirar en sandbox

-   `id` = `"doc_022432aa0fe54f9d95eaef54a2c80d04"`
-   `signerCount` = `1`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "content": "'"$(base64 < contrato.pdf | tr -d '\n')"'",
    "fileType": "pdf"
  },
  "name": "Contrato con firma por coordenadas",
  "signers": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "name": "Ana Torres",
      "roleName": "Cliente"
    }
  ],
  "fields": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "pageNumber": 1,
      "position": {
        "x": 72,
        "y": 600
      },
      "height": 60
    },
    {
      "email": "signer-success@sandbox.allsign.io",
      "pageNumber": 2,
      "position": {
        "x": 330,
        "y": 200
      },
      "height": 40
    }
  ]
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';
import { readFileSync } from 'node:fs';

const respuesta = await fetch('https://api.allsign.io/v3/documents', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        file: {
            content: readFileSync('contrato.pdf').toString('base64'),
            fileType: 'pdf',
        },
        name: 'Contrato con firma por coordenadas',
        signers: [
            {
                email: 'signer-success@sandbox.allsign.io',
                name: 'Ana Torres',
                roleName: 'Cliente',
            },
        ],
        fields: [
            {
                email: 'signer-success@sandbox.allsign.io',
                pageNumber: 1,
                position: {
                    x: 72,
                    y: 600,
                },
                height: 60,
            },
            {
                email: 'signer-success@sandbox.allsign.io',
                pageNumber: 2,
                position: {
                    x: 330,
                    y: 200,
                },
                height: 40,
            },
        ],
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import base64
import os
import uuid
from pathlib import Path

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "file": {
            "content": base64.b64encode(Path("contrato.pdf").read_bytes()).decode(),
            "fileType": "pdf",
        },
        "name": "Contrato con firma por coordenadas",
        "signers": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "name": "Ana Torres",
                "roleName": "Cliente",
            },
        ],
        "fields": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "pageNumber": 1,
                "position": {
                    "x": 72,
                    "y": 600,
                },
                "height": 60,
            },
            {
                "email": "signer-success@sandbox.allsign.io",
                "pageNumber": 2,
                "position": {
                    "x": 330,
                    "y": 200,
                },
                "height": 40,
            },
        ],
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "livemode": false,
  "id": "doc_022432aa0fe54f9d95eaef54a2c80d04",
  "object": "document",
  "name": "Contrato con firma por coordenadas",
  "status": "draft",
  "documentType": "EDITABLE",
  "signerCount": 1,
  "signedCount": 0,
  "ownerId": "usr_b353090c05ea47a3a5c79422bf9f8d25",
  "orgId": "org_17ead9c87ce1417881af1fb3faa768d9",
  "folderId": null,
  "expiresAt": null,
  "signingOrder": "parallel",
  "currentStage": null,
  "expirationReminders": null,
  "templateId": null,
  "templateVersionId": null,
  "parentDocumentId": null,
  "createdAt": "2026-07-11T18:00:00.000000Z",
  "updatedAt": "2026-07-11T18:00:00.000000Z"
}
```

## 2 Guárdalo como plantilla para ver dónde cayeron las cajas

POST `/documents/{document_id}/save-to-template` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#save-the-document-as-a-template-version)

### Qué haces

La lista de campos de un documento (listDocumentFields) solo trae los campos con nombre; las cajas de firma que pones al crear con position o anchorString no salen ahí. Para ver exactamente dónde cayeron, guarda el documento como plantilla y lee sus campos: cuesta una llamada, y la plantilla se borra al final con DELETE /templates/{templateId}.

### Qué mirar

-   `template.id` = `"tmpl_ae6b83eeb4c1485993281c49e2e97ca8"`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/save-to-template' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Contrato con firma por coordenadas"
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/save-to-template', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        name: 'Contrato con firma por coordenadas',
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/save-to-template",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "name": "Contrato con firma por coordenadas",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "livemode": false,
  "object": "template_snapshot",
  "template": {
    "id": "tmpl_ae6b83eeb4c1485993281c49e2e97ca8",
    "name": "Contrato con firma por coordenadas"
  },
  "version": {
    "id": "tv_5d359cbe7ee3493f911bdd608766fb6a",
    "versionNumber": 1
  },
  "created": true
}
```

## 3 Lee las cajas que quedaron

GET `/templates/{template_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/templates#list-template-fields)

### Qué haces

Aquí rect ya viene en porcentaje del papel (x e y de la esquina superior izquierda, ancho y alto), no en puntos: 72 de 612 puntos son 11.76 % del ancho, y 600 de 792 son 75.76 % del alto. La caja de 60 puntos de alto ocupa 120 de ancho (19.61 %). La segunda caja quedó en la página 2.

### Qué mirar

-   `data.0.areas.0.page` = `1`
-   `data.0.areas.0.rect`

**cURL**

```
curl 'https://api.allsign.io/v3/templates/tmpl_ae6b83eeb4c1485993281c49e2e97ca8/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11"
```

**Node**

```
const respuesta = await fetch('https://api.allsign.io/v3/templates/tmpl_ae6b83eeb4c1485993281c49e2e97ca8/fields', {
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
    },
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os

import requests

respuesta = requests.get(
    "https://api.allsign.io/v3/templates/tmpl_ae6b83eeb4c1485993281c49e2e97ca8/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 200**

```
{
  "livemode": false,
  "object": "list",
  "templateId": "tmpl_ae6b83eeb4c1485993281c49e2e97ca8",
  "pageCount": 2,
  "data": [
    {
      "object": "template_field",
      "name": "signature_44a67318",
      "type": "signature",
      "role": "Cliente",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 1,
          "rect": {
            "x": 11.7647,
            "y": 75.7576,
            "width": 19.6078,
            "height": 7.5758
          }
        }
      ]
    },
    {
      "object": "template_field",
      "name": "signature_37033cf3",
      "type": "signature",
      "role": "Cliente",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 2,
          "rect": {
            "x": 53.9216,
            "y": 25.2525,
            "width": 13.0719,
            "height": 5.0505
          }
        }
      ]
    }
  ],
  "unassignedCount": 0,
  "hasMore": false
}
```

## 4 Coloca las firmas con un texto ancla

POST `/documents` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document)

### Qué haces

anchorString busca ese texto en el PDF y coloca la caja respecto al texto: no necesitas saber en qué coordenadas quedó, y el contrato puede cambiar de largo sin que muevas nada. La búsqueda no distingue mayúsculas en las letras sin acento; en á/Á o ñ/Ñ sí, así que cópialas tal cual. Varios espacios seguidos cuentan como uno, y un espacio donde el texto no lo tiene impide la coincidencia. anchorHorizontalAlignment (left, center o right) y anchorVerticalAlignment (top, center o bottom) dicen qué borde de la caja se alinea con el texto; sin ellos, la caja empieza en el borde izquierdo del texto y se centra a lo alto. Con pageNumber busca solo en esa página y usa la primera coincidencia; sin pageNumber busca en todo el documento y pone una caja por cada coincidencia, como con \[\[rubrica\]\], que está en las dos páginas: si quieres una firma o rúbrica en cada hoja, pon el mismo ancla en cada hoja. No mezcles anchorString con position en la misma caja: son excluyentes.

### Qué mirar en sandbox

-   `id` = `"doc_029ecf7490234300aaf2c2609fb50657"`
-   `signerCount` = `2`

### En producción

El texto ancla tiene que sobrevivir a la conversión: si tu PDF sale de un Word, revisa que \[\[firma-cliente\]\] no quedó partido en dos estilos, porque entonces no se encuentra.

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "content": "'"$(base64 < contrato.pdf | tr -d '\n')"'",
    "fileType": "pdf"
  },
  "name": "Contrato con firmas por ancla",
  "signers": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "name": "Ana Torres",
      "roleName": "Cliente"
    },
    {
      "email": "luis@ejemplo.com",
      "name": "Luis Ramírez",
      "roleName": "Proveedor"
    }
  ],
  "fields": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "anchorString": "[[firma-cliente]]",
      "pageNumber": 2,
      "height": 60,
      "anchorHorizontalAlignment": "right",
      "anchorVerticalAlignment": "bottom"
    },
    {
      "email": "luis@ejemplo.com",
      "anchorString": "[[firma-proveedor]]",
      "pageNumber": 2,
      "height": 60,
      "anchorHorizontalAlignment": "center",
      "anchorVerticalAlignment": "top"
    },
    {
      "email": "signer-success@sandbox.allsign.io",
      "anchorString": "[[rubrica]]",
      "height": 30
    }
  ]
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';
import { readFileSync } from 'node:fs';

const respuesta = await fetch('https://api.allsign.io/v3/documents', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        file: {
            content: readFileSync('contrato.pdf').toString('base64'),
            fileType: 'pdf',
        },
        name: 'Contrato con firmas por ancla',
        signers: [
            {
                email: 'signer-success@sandbox.allsign.io',
                name: 'Ana Torres',
                roleName: 'Cliente',
            },
            {
                email: 'luis@ejemplo.com',
                name: 'Luis Ramírez',
                roleName: 'Proveedor',
            },
        ],
        fields: [
            {
                email: 'signer-success@sandbox.allsign.io',
                anchorString: '[[firma-cliente]]',
                pageNumber: 2,
                height: 60,
                anchorHorizontalAlignment: 'right',
                anchorVerticalAlignment: 'bottom',
            },
            {
                email: 'luis@ejemplo.com',
                anchorString: '[[firma-proveedor]]',
                pageNumber: 2,
                height: 60,
                anchorHorizontalAlignment: 'center',
                anchorVerticalAlignment: 'top',
            },
            {
                email: 'signer-success@sandbox.allsign.io',
                anchorString: '[[rubrica]]',
                height: 30,
            },
        ],
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import base64
import os
import uuid
from pathlib import Path

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "file": {
            "content": base64.b64encode(Path("contrato.pdf").read_bytes()).decode(),
            "fileType": "pdf",
        },
        "name": "Contrato con firmas por ancla",
        "signers": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "name": "Ana Torres",
                "roleName": "Cliente",
            },
            {
                "email": "luis@ejemplo.com",
                "name": "Luis Ramírez",
                "roleName": "Proveedor",
            },
        ],
        "fields": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "anchorString": "[[firma-cliente]]",
                "pageNumber": 2,
                "height": 60,
                "anchorHorizontalAlignment": "right",
                "anchorVerticalAlignment": "bottom",
            },
            {
                "email": "luis@ejemplo.com",
                "anchorString": "[[firma-proveedor]]",
                "pageNumber": 2,
                "height": 60,
                "anchorHorizontalAlignment": "center",
                "anchorVerticalAlignment": "top",
            },
            {
                "email": "signer-success@sandbox.allsign.io",
                "anchorString": "[[rubrica]]",
                "height": 30,
            },
        ],
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "livemode": false,
  "id": "doc_029ecf7490234300aaf2c2609fb50657",
  "object": "document",
  "name": "Contrato con firmas por ancla",
  "status": "draft",
  "documentType": "EDITABLE",
  "signerCount": 2,
  "signedCount": 0,
  "ownerId": "usr_b353090c05ea47a3a5c79422bf9f8d25",
  "orgId": "org_17ead9c87ce1417881af1fb3faa768d9",
  "folderId": null,
  "expiresAt": null,
  "signingOrder": "parallel",
  "currentStage": null,
  "expirationReminders": null,
  "templateId": null,
  "templateVersionId": null,
  "parentDocumentId": null,
  "createdAt": "2026-07-11T18:00:03.078000Z",
  "updatedAt": "2026-07-11T18:00:03.078000Z"
}
```

## 5 Guarda también este documento como plantilla

POST `/documents/{document_id}/save-to-template` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#save-the-document-as-a-template-version)

### Qué mirar

-   `template.id` = `"tmpl_151dcc5ecf5c4d19860f5380e8ff8853"`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_029ecf7490234300aaf2c2609fb50657/save-to-template' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Contrato con firmas por ancla"
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_029ecf7490234300aaf2c2609fb50657/save-to-template', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        name: 'Contrato con firmas por ancla',
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_029ecf7490234300aaf2c2609fb50657/save-to-template",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "name": "Contrato con firmas por ancla",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "livemode": false,
  "object": "template_snapshot",
  "template": {
    "id": "tmpl_151dcc5ecf5c4d19860f5380e8ff8853",
    "name": "Contrato con firmas por ancla"
  },
  "version": {
    "id": "tv_887039d012bc48e1b29470f26f9ca57d",
    "versionNumber": 1
  },
  "created": true
}
```

## 6 Comprueba dónde quedó cada caja

GET `/templates/{template_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/templates#list-template-fields)

### Qué haces

En la página 2, el texto \[\[firma-cliente\]\] ocupa de 158.8 a 230.9 puntos en horizontal y de 388.2 a 403.3 en vertical. Con right y bottom, la caja del cliente termina donde termina el texto (230.9 − 120 = 110.9 puntos desde la izquierda, 18.13 %) y su borde inferior toca el del texto (403.3 − 60 = 343.3 puntos, 43.34 %). El proveedor, con center y top, queda centrado sobre su texto y con el borde superior al ras. Las rúbricas, sin alineación, arrancan en el borde izquierdo del texto, a media altura.

### Qué mirar

-   `data.0.areas.0.page` = `1`
-   `data.0.areas.0.rect`

**cURL**

```
curl 'https://api.allsign.io/v3/templates/tmpl_151dcc5ecf5c4d19860f5380e8ff8853/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11"
```

**Node**

```
const respuesta = await fetch('https://api.allsign.io/v3/templates/tmpl_151dcc5ecf5c4d19860f5380e8ff8853/fields', {
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
    },
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os

import requests

respuesta = requests.get(
    "https://api.allsign.io/v3/templates/tmpl_151dcc5ecf5c4d19860f5380e8ff8853/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 200**

```
{
  "livemode": false,
  "object": "list",
  "templateId": "tmpl_151dcc5ecf5c4d19860f5380e8ff8853",
  "pageCount": 2,
  "data": [
    {
      "object": "template_field",
      "name": "signature_c27a8713",
      "type": "signature",
      "role": "Cliente",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 1,
          "rect": {
            "x": 18.956,
            "y": 85.951,
            "width": 9.8039,
            "height": 3.7879
          }
        }
      ]
    },
    {
      "object": "template_field",
      "name": "signature_e1c01b3f",
      "type": "signature",
      "role": "Cliente",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 2,
          "rect": {
            "x": 18.1255,
            "y": 43.3446,
            "width": 19.6078,
            "height": 7.5758
          }
        }
      ]
    },
    {
      "object": "template_field",
      "name": "signature_748de2ac",
      "type": "signature",
      "role": "Proveedor",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 2,
          "rect": {
            "x": 51.4591,
            "y": 49.012,
            "width": 19.6078,
            "height": 7.5758
          }
        }
      ]
    },
    {
      "object": "template_field",
      "name": "signature_a1be58c2",
      "type": "signature",
      "role": "Cliente",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "value": null,
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "areas": [
        {
          "page": 2,
          "rect": {
            "x": 18.956,
            "y": 85.951,
            "width": 9.8039,
            "height": 3.7879
          }
        }
      ]
    }
  ],
  "unassignedCount": 0,
  "hasMore": false
}
```

## 7 Escribe el ancla con otras mayúsculas

POST `/documents` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document)

### Qué haces

La búsqueda del ancla no distingue mayúsculas en las letras sin acento: \[\[FIRMA-CLIENTE\]\] encuentra el texto \[\[firma-cliente\]\] del PDF. En letras con acento o ñ sí distingue, así que cópialas tal cual están en el PDF.

### Qué mirar en sandbox

-   `id` = `"doc_f01a1add78b545979186b4e061b201dd"`
-   `signerCount` = `1`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "content": "'"$(base64 < contrato.pdf | tr -d '\n')"'",
    "fileType": "pdf"
  },
  "name": "Contrato con ancla en mayúsculas",
  "signers": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "name": "Ana Torres",
      "roleName": "Cliente"
    }
  ],
  "fields": [
    {
      "email": "signer-success@sandbox.allsign.io",
      "anchorString": "[[FIRMA-CLIENTE]]",
      "pageNumber": 2,
      "height": 60
    }
  ]
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';
import { readFileSync } from 'node:fs';

const respuesta = await fetch('https://api.allsign.io/v3/documents', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        file: {
            content: readFileSync('contrato.pdf').toString('base64'),
            fileType: 'pdf',
        },
        name: 'Contrato con ancla en mayúsculas',
        signers: [
            {
                email: 'signer-success@sandbox.allsign.io',
                name: 'Ana Torres',
                roleName: 'Cliente',
            },
        ],
        fields: [
            {
                email: 'signer-success@sandbox.allsign.io',
                anchorString: '[[FIRMA-CLIENTE]]',
                pageNumber: 2,
                height: 60,
            },
        ],
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import base64
import os
import uuid
from pathlib import Path

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "file": {
            "content": base64.b64encode(Path("contrato.pdf").read_bytes()).decode(),
            "fileType": "pdf",
        },
        "name": "Contrato con ancla en mayúsculas",
        "signers": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "name": "Ana Torres",
                "roleName": "Cliente",
            },
        ],
        "fields": [
            {
                "email": "signer-success@sandbox.allsign.io",
                "anchorString": "[[FIRMA-CLIENTE]]",
                "pageNumber": 2,
                "height": 60,
            },
        ],
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "livemode": false,
  "id": "doc_f01a1add78b545979186b4e061b201dd",
  "object": "document",
  "name": "Contrato con ancla en mayúsculas",
  "status": "draft",
  "documentType": "EDITABLE",
  "signerCount": 1,
  "signedCount": 0,
  "ownerId": "usr_b353090c05ea47a3a5c79422bf9f8d25",
  "orgId": "org_17ead9c87ce1417881af1fb3faa768d9",
  "folderId": null,
  "expiresAt": null,
  "signingOrder": "parallel",
  "currentStage": null,
  "expirationReminders": null,
  "templateId": null,
  "templateVersionId": null,
  "parentDocumentId": null,
  "createdAt": "2026-07-11T18:00:06.050000Z",
  "updatedAt": "2026-07-11T18:00:06.050000Z"
}
```

## 8 Agrega un campo de texto

POST `/documents/{document_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document-field)

### Qué haces

createDocumentField añade un campo con nombre a un documento que sigue en draft. Cambia la unidad: aquí rect va en porcentaje del papel (x e y de la esquina superior izquierda, ancho y alto), no en puntos, y page es obligatoria. role dice quién lo llena; si el rol no existe, se crea. placeholder y maxLength solo aplican a campos de texto.

### Qué mirar

-   `id` = `"fie_f06722fbc6b44f5ab115e4f30e352161"`
-   `type` = `"text"`
-   `rect`
-   `role` = `"Cliente"`
-   `placeholder` = `"Nombre y apellidos"`
-   `maxLength` = `80`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "text",
  "name": "nombre_completo",
  "page": 2,
  "rect": {
    "x": 12,
    "y": 20,
    "width": 40,
    "height": 4
  },
  "role": "Cliente",
  "placeholder": "Nombre y apellidos",
  "maxLength": 80
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        type: 'text',
        name: 'nombre_completo',
        page: 2,
        rect: {
            x: 12,
            y: 20,
            width: 40,
            height: 4,
        },
        role: 'Cliente',
        placeholder: 'Nombre y apellidos',
        maxLength: 80,
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "type": "text",
        "name": "nombre_completo",
        "page": 2,
        "rect": {
            "x": 12,
            "y": 20,
            "width": 40,
            "height": 4,
        },
        "role": "Cliente",
        "placeholder": "Nombre y apellidos",
        "maxLength": 80,
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "id": "fie_f06722fbc6b44f5ab115e4f30e352161",
  "object": "document_field",
  "name": "nombre_completo",
  "type": "text",
  "role": "Cliente",
  "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
  "required": true,
  "label": null,
  "options": null,
  "group": null,
  "source": "drawn",
  "readOnly": false,
  "fixedWidth": false,
  "placeholder": "Nombre y apellidos",
  "maxLength": 80,
  "page": 2,
  "rect": {
    "x": 12,
    "y": 20,
    "width": 40,
    "height": 4
  },
  "position": 1,
  "status": "pending",
  "value": {
    "text": null,
    "checked": null
  },
  "filledBy": null,
  "filledAt": null
}
```

## 9 Agrega un campo de fecha

POST `/documents/{document_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document-field)

### Qué haces

El tipo cambia lo que ve tu firmante: un selector de fecha en lugar de un texto libre.

### Qué mirar

-   `type` = `"date"`
-   `name` = `"fecha_de_firma"`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "date",
  "name": "fecha_de_firma",
  "page": 2,
  "rect": {
    "x": 12,
    "y": 27,
    "width": 20,
    "height": 4
  },
  "role": "Cliente"
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        type: 'date',
        name: 'fecha_de_firma',
        page: 2,
        rect: {
            x: 12,
            y: 27,
            width: 20,
            height: 4,
        },
        role: 'Cliente',
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "type": "date",
        "name": "fecha_de_firma",
        "page": 2,
        "rect": {
            "x": 12,
            "y": 27,
            "width": 20,
            "height": 4,
        },
        "role": "Cliente",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "id": "fie_22ed67abd16c4e38b2902d9cdf0c3680",
  "object": "document_field",
  "name": "fecha_de_firma",
  "type": "date",
  "role": "Cliente",
  "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
  "required": true,
  "label": null,
  "options": null,
  "group": null,
  "source": "drawn",
  "readOnly": false,
  "fixedWidth": false,
  "placeholder": null,
  "maxLength": null,
  "page": 2,
  "rect": {
    "x": 12,
    "y": 27,
    "width": 20,
    "height": 4
  },
  "position": 1,
  "status": "pending",
  "value": {
    "text": null,
    "checked": null
  },
  "filledBy": null,
  "filledAt": null
}
```

## 10 Agrega una casilla

POST `/documents/{document_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document-field)

### Qué haces

required en true obliga a marcarla antes de firmar; en false queda opcional.

### Qué mirar

-   `type` = `"checkbox"`
-   `label` = `"Acepto los términos del contrato"`
-   `required` = `true`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "checkbox",
  "name": "acepta_terminos",
  "label": "Acepto los términos del contrato",
  "page": 2,
  "rect": {
    "x": 12,
    "y": 34,
    "width": 3,
    "height": 3
  },
  "role": "Cliente",
  "required": true
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        type: 'checkbox',
        name: 'acepta_terminos',
        label: 'Acepto los términos del contrato',
        page: 2,
        rect: {
            x: 12,
            y: 34,
            width: 3,
            height: 3,
        },
        role: 'Cliente',
        required: true,
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "type": "checkbox",
        "name": "acepta_terminos",
        "label": "Acepto los términos del contrato",
        "page": 2,
        "rect": {
            "x": 12,
            "y": 34,
            "width": 3,
            "height": 3,
        },
        "role": "Cliente",
        "required": True,
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "id": "fie_e1031e7cdcd24707bec66cbf9d40ad42",
  "object": "document_field",
  "name": "acepta_terminos",
  "type": "checkbox",
  "role": "Cliente",
  "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
  "required": true,
  "label": "Acepto los términos del contrato",
  "options": null,
  "group": null,
  "source": "drawn",
  "readOnly": false,
  "fixedWidth": false,
  "placeholder": null,
  "maxLength": null,
  "page": 2,
  "rect": {
    "x": 12,
    "y": 34,
    "width": 3,
    "height": 3
  },
  "position": 1,
  "status": "pending",
  "value": {
    "text": null,
    "checked": null
  },
  "filledBy": null,
  "filledAt": null
}
```

## 11 Agrega una lista desplegable

POST `/documents/{document_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#create-document-field)

### Qué haces

options lista lo que el firmante puede elegir. type define el tipo de campo, por ejemplo text, date, checkbox, select, signature o initials; el catálogo completo de valores está en el schema de la operación.

### Qué mirar

-   `type` = `"select"`
-   `options`

**cURL**

```
curl -X POST 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "select",
  "name": "ciudad",
  "page": 2,
  "rect": {
    "x": 12,
    "y": 41,
    "width": 30,
    "height": 4
  },
  "role": "Cliente",
  "options": [
    "Ciudad de México",
    "Monterrey",
    "Guadalajara"
  ],
  "required": false
}'
```

**Node**

```
import { randomUUID } from 'node:crypto';

const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields', {
    method: 'POST',
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
        'Idempotency-Key': randomUUID(),
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        type: 'select',
        name: 'ciudad',
        page: 2,
        rect: {
            x: 12,
            y: 41,
            width: 30,
            height: 4,
        },
        role: 'Cliente',
        options: [
            'Ciudad de México',
            'Monterrey',
            'Guadalajara',
        ],
        required: false,
    }),
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os
import uuid

import requests

respuesta = requests.post(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "type": "select",
        "name": "ciudad",
        "page": 2,
        "rect": {
            "x": 12,
            "y": 41,
            "width": 30,
            "height": 4,
        },
        "role": "Cliente",
        "options": [
            "Ciudad de México",
            "Monterrey",
            "Guadalajara",
        ],
        "required": False,
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 201**

```
{
  "id": "fie_ed442115ea1344c8aad0fb7046b6819e",
  "object": "document_field",
  "name": "ciudad",
  "type": "select",
  "role": "Cliente",
  "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
  "required": false,
  "label": null,
  "options": [
    "Ciudad de México",
    "Monterrey",
    "Guadalajara"
  ],
  "group": null,
  "source": "drawn",
  "readOnly": false,
  "fixedWidth": false,
  "placeholder": null,
  "maxLength": null,
  "page": 2,
  "rect": {
    "x": 12,
    "y": 41,
    "width": 30,
    "height": 4
  },
  "position": 1,
  "status": "pending",
  "value": {
    "text": null,
    "checked": null
  },
  "filledBy": null,
  "filledAt": null
}
```

## 12 Revisa los campos del documento

GET `/documents/{document_id}/fields` [ver en la referencia](https://dev.allsign.io/developers/docs/endpoints/documents#list-document-fields)

### Qué haces

Aquí están los cuatro campos con nombre, con su tipo, su rect en porcentaje y su rol. unassignedCount cuenta los que todavía no tienen rol. Las cajas de firma que pusiste al crear, por coordenadas o por ancla, no aparecen en esta lista: la tuya es de campos que se llenan.

### Qué mirar

-   `data.0.name` = `"nombre_completo"`
-   `data.0.rect`
-   `unassignedCount` = `0`

**cURL**

```
curl 'https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields' \
  -H "Authorization: Bearer $ALLSIGN_API_KEY" \
  -H "AllSign-Version: 2026-07-11"
```

**Node**

```
const respuesta = await fetch('https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields', {
    headers: {
        Authorization: `Bearer ${process.env.ALLSIGN_API_KEY}`,
        'AllSign-Version': '2026-07-11',
    },
});
console.log(respuesta.status, await respuesta.json());
```

**Python**

```
import os

import requests

respuesta = requests.get(
    "https://api.allsign.io/v3/documents/doc_022432aa0fe54f9d95eaef54a2c80d04/fields",
    headers={
        "Authorization": f"Bearer {os.environ['ALLSIGN_API_KEY']}",
        "AllSign-Version": "2026-07-11",
    },
)
print(respuesta.status_code, respuesta.json())
```

**Respuesta · 200**

```
{
  "livemode": false,
  "object": "list",
  "documentId": "doc_022432aa0fe54f9d95eaef54a2c80d04",
  "data": [
    {
      "id": "fie_f06722fbc6b44f5ab115e4f30e352161",
      "object": "document_field",
      "name": "nombre_completo",
      "type": "text",
      "role": "Cliente",
      "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": "Nombre y apellidos",
      "maxLength": 80,
      "page": 2,
      "rect": {
        "x": 12,
        "y": 20,
        "width": 40,
        "height": 4
      },
      "position": 1,
      "status": "pending",
      "value": {
        "text": null,
        "checked": null
      },
      "filledBy": null,
      "filledAt": null
    },
    {
      "id": "fie_22ed67abd16c4e38b2902d9cdf0c3680",
      "object": "document_field",
      "name": "fecha_de_firma",
      "type": "date",
      "role": "Cliente",
      "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
      "required": true,
      "label": null,
      "options": null,
      "group": null,
      "source": "drawn",
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "page": 2,
      "rect": {
        "x": 12,
        "y": 27,
        "width": 20,
        "height": 4
      },
      "position": 1,
      "status": "pending",
      "value": {
        "text": null,
        "checked": null
      },
      "filledBy": null,
      "filledAt": null
    },
    {
      "id": "fie_e1031e7cdcd24707bec66cbf9d40ad42",
      "object": "document_field",
      "name": "acepta_terminos",
      "type": "checkbox",
      "role": "Cliente",
      "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
      "required": true,
      "label": "Acepto los términos del contrato",
      "options": null,
      "group": null,
      "source": "drawn",
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "page": 2,
      "rect": {
        "x": 12,
        "y": 34,
        "width": 3,
        "height": 3
      },
      "position": 1,
      "status": "pending",
      "value": {
        "text": null,
        "checked": null
      },
      "filledBy": null,
      "filledAt": null
    },
    {
      "id": "fie_ed442115ea1344c8aad0fb7046b6819e",
      "object": "document_field",
      "name": "ciudad",
      "type": "select",
      "role": "Cliente",
      "signerId": "sgr_f0989537347543a294a854fa880a8aaa",
      "required": false,
      "label": null,
      "options": [
        "Ciudad de México",
        "Monterrey",
        "Guadalajara"
      ],
      "group": null,
      "source": "drawn",
      "readOnly": false,
      "fixedWidth": false,
      "placeholder": null,
      "maxLength": null,
      "page": 2,
      "rect": {
        "x": 12,
        "y": 41,
        "width": 30,
        "height": 4
      },
      "position": 1,
      "status": "pending",
      "value": {
        "text": null,
        "checked": null
      },
      "filledBy": null,
      "filledAt": null
    }
  ],
  "unassignedCount": 0,
  "hasMore": false
}
```

## Errores comunes de esta receta

Errores reales que el test de esta receta provocó a propósito en sandbox, sobre sus mismos pasos. Cada uno enlaza a su explicación en [Errores](https://dev.allsign.io/developers/docs/errors).

`VALIDATION_ERROR` · 422 · en el paso 1 (Coloca una firma por coordenadas)

Usa un texto ancla que no está en el PDF. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

La búsqueda no distingue mayúsculas en letras sin acento (en á/Á o ñ/Ñ sí, cópialas tal cual); un espacio donde el texto no lo tiene impide la coincidencia, y varios espacios seguidos cuentan como uno. Si el ancla es correcta y no aparece, revisa que el texto no quedó partido al convertir tu archivo.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "anchorString '[[firma-notario]]' was not found in any of the searched compound PDF position(s): [1].",
  "instance": "/v3/documents",
  "code": "VALIDATION_ERROR",
  "requestId": "req_34f64c2116164a3f809026fc7d8e836c"
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 1 (Coloca una firma por coordenadas)

Busca el ancla en una página donde no está. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

Con pageNumber la búsqueda se limita a esa página. Si no sabes en cuál está el texto, quita pageNumber y se busca en todo el documento.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "anchorString '[[firma-cliente]]' was not found in any of the searched compound PDF position(s): [1].",
  "instance": "/v3/documents",
  "code": "VALIDATION_ERROR",
  "requestId": "req_eca2be68763a41d389151477a26e77d1"
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 1 (Coloca una firma por coordenadas)

Coloca una firma para alguien que no es firmante. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

El email (o phone) de cada caja tiene que coincidir con uno de signers\[\]. Agrega primero al firmante.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "The document could not be created from the given input.",
  "instance": "/v3/documents",
  "code": "VALIDATION_ERROR",
  "requestId": "req_42606f9cc18844fcae8388c9d2225eea",
  "errors": [
    {
      "code": "INVALID_VALUE",
      "detail": "Value error, Signature fields reference unknown participants: ana@ejemplo.com. Add these participants before defining fields."
    }
  ]
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 1 (Coloca una firma por coordenadas)

Pide una caja de alto cero. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "One or more fields are invalid.",
  "instance": "/v3/documents",
  "code": "VALIDATION_ERROR",
  "requestId": "req_ec5dbb86ce2947e6b2f3a91e0a4ca6c0",
  "errors": [
    {
      "field": "fields[0].height",
      "pointer": "/fields/0/height",
      "code": "OUT_OF_RANGE",
      "detail": "Input should be greater than 0"
    }
  ]
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 8 (Agrega un campo de texto)

Agrega un campo en una página que no existe. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

La página se valida contra el PDF al crear el documento con fields\[\] por coordenadas (position) y al agregar el campo con createDocumentField: una página que el PDF no tiene responde 422 y te dice cuántas páginas tiene.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "Page 5 is out of range (the PDF has 2 page(s)).",
  "instance": "/v3/documents/doc_2b1e691d38c740cd86d5fe70b2c753b0/fields",
  "code": "VALIDATION_ERROR",
  "requestId": "req_22e80c6ca89a4a0bb60c58d079f5eb28"
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 8 (Agrega un campo de texto)

Agrega un campo que se sale de la página. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

rect va en porcentaje del papel: x más width no puede pasar de 100, ni y más height.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "The field falls outside the page",
  "instance": "/v3/documents/doc_2b1e691d38c740cd86d5fe70b2c753b0/fields",
  "code": "VALIDATION_ERROR",
  "requestId": "req_a2d3f7989c2f44e29b5b600046a5109a"
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

`VALIDATION_ERROR` · 422 · en el paso 8 (Agrega un campo de texto)

Manda role y signer en el mismo campo. [Qué significa y qué hacer](https://dev.allsign.io/developers/docs/errors#VALIDATION_ERROR)

Un campo que es de un firmante hereda su rol. Manda solo uno de los dos.

**Respuesta · 422 · VALIDATION_ERROR**

```
{
  "type": "https://allsign.io/developers/docs/errors#VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 422,
  "detail": "Send either `role` or `signer`, not both: a field owned by a signer inherits that signer's role.",
  "instance": "/v3/documents/doc_2b1e691d38c740cd86d5fe70b2c753b0/fields",
  "code": "VALIDATION_ERROR",
  "requestId": "req_889791ef97af4a74b8f1722a20efe663"
}
```

Grabado en el entorno interno de AllSign con una key de sandbox · backend `70a6c42` · 11 oct 2026, 20:07 (hora CDMX) · test `docs-checks-v3/tests/recetas/donde-va-la-firma.receta.spec.ts`

## Siguiente

-   [Varios firmantes, uno después de otro](https://dev.allsign.io/developers/docs/recetas/varios-firmantes-en-orden) — Un contrato que firma primero la vendedora y después el comprador, con el comprador sin poder firmar antes de su turno.
-   [De plantilla a documento en una llamada](https://dev.allsign.io/developers/docs/recetas/de-plantilla-a-documento) — Un acuerdo creado desde tu plantilla, con sus valores y sus firmantes por rol, y enviado a firma sin salir de una sola petición.
