Contracts

Renew a contract

Changed on

Starts the contract's next term: end_date moves by renewal_term_months (12 when unset), or to the end_date sent, which must be after the current one. A value sent replaces the current one. Reopens an expired contract; a terminated one returns 400. Steps term, so the lifecycle alerts run again for the new term. Records a document_contract_renewed event. Needs a plan with contract tracking (403 otherwise). The body names the term the renewal starts from (the contract's current one) or the end_date it renews to, so a renewal answered with a 5xx error, or whose answer was lost, is safe to send again: the repeat is refused with 400, as the contract is then in its next term and that date is no longer after the current one (or with 409, when it sends the updated_at it read).

Copy as Markdown Open in ChatGPT Open in Claude

post/v1/accounts/{accountId}/documents/{documentId}/contract/renew

Request

  • Base URL
    https://api.assinafy.com.br
  • URL
    https://api.assinafy.com.br/v1/accounts/{accountId}/documents/{documentId}/contract/renew
  • Auth
    • HTTP bearer
    • or API key in header X-Api-Key

Path parameters

accountIdstring required

Workspace account ID.

documentIdstring required

Document ID.

Request body

end_datestring date nullable

The new end date, after the current one. Absent, empty or null: the current end date plus the renewal term, stepped until it is in the future; term is then required.

valuenumber nullable

The new value; unchanged when not sent, cleared by null.

terminteger

The term this renewal starts from, the contract's current term. Required unless end_date is sent; for a contract in another term the renewal is refused, so a repeated request never renews twice.

updated_atstring date-time

Optional precondition: the contract's updated_at as read. Changed since: 409, nothing renewed.

Example request

{
  "term": 1,
  "updated_at": "2026-10-23T12:00:00Z"
}

Response

The renewed contract

statusinteger

HTTP status code, mirrored in the body.

messagestring

Human-readable message; empty on success.

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