Correction

Los endpoints de Correction te permiten modificar documentos que ya fueron enviados para firma, siguiendo reglas de edición estilo DocuSign. Puedes anular documentos, agregar nuevos firmantes, o eliminar firmantes que aún no hayan firmado.


GET/v2/documents/{document_id}/correction-context

Correction context

Consulta qué operaciones de edición se pueden realizar sobre un documento activo. Las reglas dependen de cuántos firmantes ya han firmado.

Path parameters

  • Name
    document_id
    Type
    string
    Description

    ID del documento (UUID).

Request

GET
/v2/documents/{id}/correction-context
curl "https://api.allsign.io/v2/documents/DOC_UUID/correction-context" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK"

Response (200)

{
  "signingStatus": "some_signed",
  "canAddSigner": true,
  "isLocked": false,
  "signers": [
    {
      "id": "sig-uuid-1",
      "email": "firmante1@empresa.com",
      "status": "SIGNED",
      "canRemove": false
    },
    {
      "id": "sig-uuid-2",
      "email": "firmante2@empresa.com",
      "status": "WAITING_FOR_SIGNATURE",
      "canRemove": true
    }
  ]
}

POST/v2/documents/{document_id}/enter-correction

Enter correction mode

Bloquea el documento para edición. Debe llamarse antes de agregar o eliminar firmantes en un documento activo. Mientras el documento está en modo corrección, los firmantes no pueden avanzar en el flujo de firma.

curl -X POST "https://api.allsign.io/v2/documents/DOC_UUID/enter-correction" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK"

Response (200)

{
  "success": true,
  "message": "Document entered correction mode"
}

POST/v2/documents/{document_id}/exit-correction

Exit correction mode

Libera el bloqueo de corrección y reactiva el flujo de firma. Debe llamarse después de terminar todas las modificaciones (add/remove signer).

curl -X POST "https://api.allsign.io/v2/documents/DOC_UUID/exit-correction" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK"

Response (200)

{
  "success": true,
  "message": "Document exited correction mode"
}

POST/v2/documents/{document_id}/void

Void document

Anula un documento, cancelando todas las firmas pendientes. Las firmas ya completadas se conservan en el historial de auditoría.

Path parameters

  • Name
    document_id
    Type
    string
    Description

    ID del documento (UUID).

Request body

  • Name
    reason
    Type
    string
    Description

    Razón de la anulación (para auditoría).

Request

POST
/v2/documents/{id}/void
curl -X POST "https://api.allsign.io/v2/documents/DOC_UUID/void" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Se detectó un error en el contrato"}'

Response (200)

{
  "success": true,
  "message": "Documento anulado. 2 firma(s) pendiente(s) cancelada(s)."
}

Error — already completed (400)

{
  "error": {
    "code": "E1600",
    "type": "conflict",
    "message": "Cannot void a fully signed document."
  }
}

Error — already voided (400)

{
  "error": {
    "code": "E1600",
    "type": "conflict",
    "message": "Document is already voided or expired."
  }
}

POST/v2/documents/{document_id}/add-signer

Add signer

Agrega un nuevo firmante a un documento activo. El endpoint encuentra o crea al usuario dentro del tenant, otorga acceso al documento y crea el registro de firma.

Path parameters

  • Name
    document_id
    Type
    string
    Description

    ID del documento (UUID).

Request body

  • Name
    signerEmail
    Type
    string
    Description

    Email del nuevo firmante. Se valida automáticamente (formato + entregabilidad). Requerido si no se proporciona signerPhone.

  • Name
    signerPhone
    Type
    string
    Description

    Teléfono del firmante en formato E.164 (para firmantes solo WhatsApp). Requerido si no se proporciona signerEmail.

  • Name
    roleName
    Type
    string
    Description

    Nombre del rol a asignar al firmante (ej. "Arrendador"). Si existe un rol orphan con ese nombre, lo reclama. Si no existe, lo crea. Máximo 255 caracteres.

  • Name
    variableNames
    Type
    string[]
    Description

    Lista de nombres de variables del documento (placeholders del DOCX). Cuando se proporciona, el endpoint inicializa registros DocumentVariable faltantes y ejecuta el auto-link heurístico antes de responder. Retorna las variables auto-asignadas en autoAssignedVariables.

Request

POST
/v2/documents/{id}/add-signer
curl -X POST "https://api.allsign.io/v2/documents/DOC_UUID/add-signer" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK" \
  -H "Content-Type: application/json" \
  -d '{"signerEmail": "nuevo-firmante@empresa.com"}'

Response (200) — Éxito

{
  "success": true,
  "message": "Firmante nuevo-firmante@empresa.com agregado correctamente."
}

Response (200) — Duplicado

{
  "success": false,
  "message": "El firmante ya está en la lista de firmantes."
}

Error — invalid email (422)

{
  "error": {
    "code": "E1200",
    "type": "validation_error",
    "message": "Invalid email format: 'bad-email'. Expected format: user@example.com",
    "field": "signerEmail"
  }
}

DELETE/v2/documents/{document_id}/signers/{signature_id}

Remove signer

Elimina un firmante de un documento activo. Solo se puede eliminar firmantes que aún no han firmado.

Path parameters

  • Name
    document_id
    Type
    string
    Description

    ID del documento (UUID).

  • Name
    signature_id
    Type
    string
    Description

    ID de la firma a eliminar (UUID). Obtenerlo del correction context o del campo signersData.

curl -X DELETE "https://api.allsign.io/v2/documents/DOC_UUID/signers/SIG_UUID" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK"

Response (200)

{
  "success": true,
  "detail": "Firmante eliminado correctamente"
}

Error — already signed (400)

{
  "detail": "Cannot remove signer — signature already completed."
}

PATCH/v2/documents/{document_id}/signers/{signature_id}

Patch signer

Asigna o cambia el rol de un firmante existente en un documento. Si existe un orphan role con el nombre indicado, lo reclama en lugar de crear uno duplicado. Devuelve la lista de variables auto-asignadas al rol.

Soporta firmantes por email y firmantes solo WhatsApp (sin email).

Path parameters

  • Name
    document_id
    Type
    string
    Description

    ID del documento (UUID).

  • Name
    signature_id
    Type
    string
    Description

    ID de la firma del firmante a actualizar (UUID). Obtenerlo del correction context.

Request body

  • Name
    roleName
    Type
    string
    Description

    Nombre del rol a asignar (ej. "Arrendador"). Máximo 255 caracteres. Si existe un orphan role con ese nombre, se reclama; si no, se crea uno nuevo.

  • Name
    variableNames
    Type
    string[]
    Description

    Lista de todos los placeholders del documento. Cuando se proporciona, el endpoint inicializa registros DocumentVariable faltantes y ejecuta el auto-link antes de responder.

Request

PATCH
/v2/documents/{id}/signers/{sig_id}
curl -X PATCH "https://api.allsign.io/v2/documents/DOC_UUID/signers/SIG_UUID" \
  -H "Authorization: Bearer ALLSIGN_LIVE_SK" \
  -H "Content-Type: application/json" \
  -d '{
    "roleName": "Arrendador",
    "variableNames": [
      "arrendador__nombre",
      "arrendador__rfc",
      "sender__fecha_inicio"
    ]
  }'

Response (200) — Rol asignado y variables auto-enlazadas

{
  "success": true,
  "roleId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "roleName": "Arrendador",
  "roleContactEmail": "arrendador@empresa.com",
  "autoAssignedVariables": [
    "arrendador__nombre",
    "arrendador__rfc"
  ]
}

Response (200) — Firmante WhatsApp-only (sin email)

{
  "success": true,
  "roleId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "roleName": "Proveedor",
  "roleContactEmail": null,
  "autoAssignedVariables": [
    "proveedor__nombre",
    "proveedor__rfc"
  ]
}

Error — sin identificador (400)

{
  "error": {
    "code": "E1700",
    "type": "bad_request",
    "message": "Cannot update role: signer has no email or phone identifier."
  }
}

Was this page helpful?