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": [
    {
      "signature_id": "sig-uuid-1",
      "signer_id": "user-uuid-1",
      "status": "SIGNED",
      "can_remove": false,
      "can_edit_fields": false,
      "is_signed": true
    },
    {
      "signature_id": "sig-uuid-2",
      "signer_id": "user-uuid-2",
      "status": "WAITING FOR SIGNATURE",
      "can_remove": true,
      "can_edit_fields": true,
      "is_signed": false
    }
  ]
}

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": "Correction mode enabled."
}

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": "Correction mode disabled. Signers can continue."
}

Si el documento tiene variables, primero se regenera el PDF con los datos actualizados y el mensaje es "Correction mode disabled. The document is being regenerated with the updated data; signers can continue as soon as it is ready.". Si ya estaba en modo firma, responde 200 con "Already in signing mode."; enter-correction sobre un documento que ya está en corrección responde 200 con "Already in 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": "Document voided. 2 pending signature(s) cancelled."
}

Error — already completed (400)

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

Error — already voided (400)

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

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

Add signer

Agrega un firmante a un documento ya enviado a firma. Requiere haber entrado antes en modo corrección.

El mismo endpoint es el paso de alta de firmantes en un documento nuevo, donde no hace falta modo corrección — la referencia completa del request body y los ejemplos viven en Signatures → Add signer.


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": "Signer removed."
}

Error — already signed (400)

{
  "error": {
    "code": "E1700",
    "type": "bad_request",
    "message": "A signer who already signed cannot be removed.",
    "error": "already_signed",
    "reason": "remove_signer_already_signed"
  }
}

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.

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. Opcional: si lo omites (o mandas null), el rol del firmante se deja intacto (200 con roleId: null).

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"}'

Response (200) — Rol asignado

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

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

{
  "success": true,
  "roleId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "roleName": "Proveedor",
  "roleContactEmail": null
}

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?