Set a document's contract terms
Changed onCreates the document's contract terms, or changes only the attributes sent (see the request body for what null does). external_references, when sent, replaces the whole list. Records a document_contract_updated event when the terms change; a retry that changes nothing records none. The body must be a JSON object with at least one attribute. With parent_document_id, the document is instead linked as an amendment, renewal or termination of that contract (or of any document in its family, resolved to the root) and the other attributes are the terms it changes; a later PUT on a pending amendment merges into that delta (a null drops a key) and parent_document_id: null unlinks it; every change to the link records document_contract_amendment_updated on this document. The delta applies to the parent once the document is certificated (at once, if it already is), in signing order (the order the documents' certifications were recorded in, fixed for each once it is; a certificated document with none recorded waits, and is placed by its certification time an hour on): instruments signed earlier apply first, one that cannot holds the later ones back, and an instrument signed before one already applied is blocked instead of applied over it. Applying records document_contract_amended; an applied amendment is read-only. A cancelled, declined or expired document takes no new terms and no new link; terms or a link already on one stay and can still change. Send the updated_at you read with the write to have it refused (409) if the contract or link changed meanwhile. Needs a plan with contract tracking (403 otherwise).
Request
- Base URLhttps://api.assinafy.com.br
- URLhttps://api.assinafy.com.br/v1/accounts/{accountId}/documents/{documentId}/contract
- Auth
- HTTP bearer
- or API key in header X-Api-Key
Path parameters
Workspace account ID.
Document ID.
Request body
Example request
{
"currency": "BRL",
"external_references": [
{
"system": "hubspot",
"id": "98765"
}
],
"updated_at": "2026-10-23T12:00:00Z"
}Response
The contract terms as saved, or the amendment as linked
Example response
{
"status": 200,
"data": {
"resource": "document_contract",
"document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
"status": "active",
"counterparty_name": "Acme Ltda",
"counterparty_taxpayer_id": "11222333000181",
"value": 120000.5,
"currency": "BRL",
"start_date": "2026-11-01",
"end_date": "2027-10-31",
"auto_renew": true,
"renewal_term_months": 12,
"notice_period_days": 30,
"term": 1,
"owner_id": "d6zqpbyog2v3xvxerwn8la94",
"metadata": {
"crm_stage": "won"
},
"external_references": [
{
"system": "hubspot",
"id": "98765"
}
],
"document": {
"resource": "document",
"id": "615601fab04c0a3147bb1246",
"account_id": "d199996981dbd199996981db",
"name": "document.pdf",
"status": "metadata_ready",
"artifacts": {
"original": "https://api.assinafy.com.br/v1/documents/doc1/download/original"
},
"signing_url": "https://api.assinafy.com.br/v1/sign/doc1",
"verification_code": "a3f1c9e07b2d4e8f9a6c5b1d0e7f3a2c9b8d4e6f",
"verification_url": "https://www.assinafy.com.br/verificador/a3f1c9e07b2d4e8f9a6c5b1d0e7f3a2c9b8d4e6f",
"declined_by": {
"resource": "signer",
"id": "62d6ee35c7741ca4006b9e11",
"full_name": "John Signer",
"email": "john@email.com",
"whatsapp_phone_number": "+5548999990000",
"government_id": "39053344705"
},
"assignment": {
"resource": "assignment",
"id": "615606ef81d199996981dbce",
"document_id": "615601fab04c0a3147bb1246",
"created_at": "2026-06-03T03:54:16Z",
"sender_email": "sender@example.com",
"method": "virtual",
"signers": [
{
"resource": "signer",
"id": "62d6ee35c7741ca4006b9e11",
"full_name": "John Signer",
"email": "john@email.com",
"whatsapp_phone_number": "+5548999990000",
"government_id": "39053344705",
"verification_method": "Email",
"notification_methods": [
"Email"
],
"step": 1,
"identity_verification_status": "InReview",
"notification_history": [
{
"event": "signature_request",
"status": "sent",
"sent_at": "2026-07-07T12:00:00Z"
}
]
}
],
"items": [
{
"page": {
"id": "615601faf166d6d1d8e7dc30",
"number": 1,
"height": 2100,
"width": 1275,
"download_url": "https://api.assinafy.com.br/v1/documents/doc1/pages/1a/download"
}
}
],
"signing_urls": [
{
"url": "https://api.assinafy.com.br/v1/sign/doc1?email=joe@example.com"
}
]
},
"pages": [
{
"id": "615601faf166d6d1d8e7dc30",
"number": 1,
"height": 2100,
"width": 1275,
"download_url": "https://api.assinafy.com.br/v1/documents/doc1/pages/1a/download"
}
],
"has_contract": true,
"created_at": "2026-06-03T03:54:16Z",
"updated_at": "2026-06-03T03:54:16Z"
},
"amendments": [
{
"resource": "document_contract_amendment",
"document_id": "7c3d1e2f4a5b6c7d8e9f0a1b",
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
"parent_document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
"relation_type": "amendment",
"number": 1,
"status": "pending",
"document_status": "pending_signature",
"currency": "BRL",
"terms": {
"value": 130000,
"end_date": "2028-06-30"
},
"changes": {
"value": {
"from": 120000.5,
"to": 130000
},
"end_date": {
"from": "2027-10-31",
"to": "2028-06-30"
},
"term": {
"from": 1,
"to": 2
}
},
"created_at": "2026-10-23T12:00:00Z",
"updated_at": "2026-10-23T12:00:00Z"
}
],
"created_at": "2026-10-23T12:00:00Z",
"updated_at": "2026-10-23T12:00:00Z"
}
}Changes
- info
endpoint added
- info