Manage an existing document’s CLM record: set creates/patches terms or links a signed amendment; renew starts the next term; terminate closes tracking. Requires a tracking plan. Read first: include terms.updated_at for existing terms or links; renew requires the current term and updated_at, terminate requires updated_at. A conflict needs a fresh read and user review, never blind retries. Only supplied terms change; external_references replaces the list; null can clear values or unlink a pending amendment. Assinafy owns auto-renewal and owner reminders; changes can trigger lifecycle emails/webhooks. These actions do not sign, send or cancel the document itself. Use only for changes the user authorized.
View input schema
{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"minLength": 1
},
"action": {
"type": "string",
"enum": [
"set",
"renew",
"terminate"
]
},
"document_id": {
"type": "string",
"minLength": 1
},
"end_date": {
"type": [
"string",
"null"
],
"description": "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.",
"format": "date"
},
"reason": {
"type": [
"string",
"null"
],
"description": "Kept in the `document_contract_terminated` event; HTML is stripped.",
"maxLength": 500
},
"term": {
"type": "integer",
"description": "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.",
"minimum": 1
},
"terms": {
"type": "object",
"properties": {
"auto_renew": {
"type": "boolean",
"description": "Whether the hourly run starts the next term the day after `end_date`, by `renewal_term_months`, instead of expiring the contract."
},
"counterparty_name": {
"type": [
"string",
"null"
],
"description": "Emoji are kept; other characters outside the 3-byte range are dropped.",
"maxLength": 255
},
"currency": {
"type": [
"string",
"null"
],
"description": "Three letters, such as `BRL` or `USD`, stored in capitals; `BRL` when a `value` is set without one."
},
"end_date": {
"type": [
"string",
"null"
],
"description": "`YYYY-MM-DD`, on or after `start_date`.",
"format": "date"
},
"external_references": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Kept as sent; must not contain emoji or other 4-byte characters.",
"maxLength": 255,
"example": "98765"
},
"system": {
"type": "string",
"description": "Letters, digits, `_`, `-` and `.`; stored in lower case.",
"maxLength": 64,
"example": "hubspot"
}
},
"required": [
"system",
"id"
]
},
"description": "Replaces the whole list; `[]` or `null` clears it. Two items whose `system` and `id` compare equal case aside are one reference (the first sent is kept); a pair the database takes for one beyond that (accents, `ß` and `ss`) answers `400`.",
"maxItems": 20
},
"metadata": {
"type": [
"object",
"null"
],
"description": "Your own fields: up to 50 keys of 1 to 40 letters, digits, `_`, `-` or `.`, each holding plain text of at most 500 characters; no number under a key ending in `_at`, or `stuck_since`.",
"maxProperties": 50,
"additionalProperties": {
"type": "string",
"maxLength": 500
}
},
"notice_period_days": {
"type": [
"integer",
"null"
],
"description": "Days before `end_date` the notice period starts (`document_contract_renewal_notice`); none when unset.",
"minimum": 0,
"maximum": 3650
},
"owner_id": {
"type": [
"string",
"null"
],
"description": "An active member of this workspace."
},
"parent_document_id": {
"type": [
"string",
"null"
],
"description": "Links the document as an amendment of this contract document, or of any document in its family (resolved to the root); `null` unlinks a pending amendment. With it, the other attributes are the terms the instrument changes, not terms of its own; on a pending amendment a `null` value drops that term from the delta rather than clearing it on the parent."
},
"relation_type": {
"type": "string",
"description": "Required on the first link. `amendment` may change `value`, `currency`, `start_date` (effective from, display only), `end_date`, `auto_renew`, `renewal_term_months`, `notice_period_days`, `counterparty_name` and `metadata`; `renewal` only `end_date` and `value`; `termination` only `end_date` (the effective date).",
"enum": [
"amendment",
"renewal",
"termination"
]
},
"renewal_term_months": {
"type": [
"integer",
"null"
],
"description": "How far a renewal by the term moves `end_date`; 12 when unset.",
"minimum": 1,
"maximum": 600
},
"start_date": {
"type": [
"string",
"null"
],
"description": "`YYYY-MM-DD`, from the year 1000.",
"format": "date"
},
"status": {
"type": "string",
"description": "On creation any status, so a contract that ended before it was tracked is registered as it ended: `expired` needs an `end_date` in the past, `terminated` its `end_date`; neither is walked by the lifecycle. Afterwards only `draft` or `active` (a contract in force never goes back to `draft`): `expired` and `terminated` are set by the lifecycle and the terminate endpoint; a closed contract is reopened by renewing it.",
"enum": [
"draft",
"active",
"expired",
"terminated"
]
},
"updated_at": {
"type": "string",
"description": "Optional precondition: the `updated_at` the client read the contract (or this document's amendment link) with, as the API returned it. If the contract or link changed since, nothing is written and the answer is `409` with `code: ContractChanged`. Not sent, or `null`: the write applies whatever changed meanwhile (last write wins). Compared to the second; a fraction of a second, as a JavaScript date prints it, is read and ignored. New terms and a first link have nothing to have read, so sending one answers `409`; on a pending amendment, send the link's own `updated_at` (the GET on that document).",
"format": "date-time"
},
"value": {
"type": [
"number",
"null"
],
"description": "Two decimal places at most.",
"minimum": 0,
"maximum": 9999999999999.99
}
},
"description": "Every attribute is optional and only the ones sent change. `null` clears an attribute, except `auto_renew` (back to `false`) and `currency` (back to `BRL` while a `value` is set); `status` does not accept `null`. A changed `end_date` starts a new `term`.",
"minProperties": 1,
"additionalProperties": false,
"anyOf": [
{
"required": [
"status"
]
},
{
"required": [
"counterparty_name"
]
},
{
"required": [
"value"
]
},
{
"required": [
"currency"
]
},
{
"required": [
"start_date"
]
},
{
"required": [
"end_date"
]
},
{
"required": [
"auto_renew"
]
},
{
"required": [
"renewal_term_months"
]
},
{
"required": [
"notice_period_days"
]
},
{
"required": [
"owner_id"
]
},
{
"required": [
"metadata"
]
},
{
"required": [
"external_references"
]
},
{
"required": [
"parent_document_id"
]
},
{
"required": [
"relation_type"
]
}
]
},
"updated_at": {
"type": "string",
"description": "Optional precondition: the contract's `updated_at` as read. Changed since: `409`, nothing terminated.",
"format": "date-time"
},
"value": {
"type": [
"number",
"null"
],
"description": "The new value; unchanged when not sent, cleared by `null`."
}
},
"required": [
"action"
],
"additionalProperties": false,
"oneOf": [
{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"minLength": 1
},
"action": {
"type": "string",
"const": "set"
},
"document_id": {
"type": "string",
"minLength": 1
},
"terms": {
"type": "object",
"properties": {
"auto_renew": {
"type": "boolean",
"description": "Whether the hourly run starts the next term the day after `end_date`, by `renewal_term_months`, instead of expiring the contract."
},
"counterparty_name": {
"type": [
"string",
"null"
],
"description": "Emoji are kept; other characters outside the 3-byte range are dropped.",
"maxLength": 255
},
"currency": {
"type": [
"string",
"null"
],
"description": "Three letters, such as `BRL` or `USD`, stored in capitals; `BRL` when a `value` is set without one."
},
"end_date": {
"type": [
"string",
"null"
],
"description": "`YYYY-MM-DD`, on or after `start_date`.",
"format": "date"
},
"external_references": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Kept as sent; must not contain emoji or other 4-byte characters.",
"maxLength": 255,
"example": "98765"
},
"system": {
"type": "string",
"description": "Letters, digits, `_`, `-` and `.`; stored in lower case.",
"maxLength": 64,
"example": "hubspot"
}
},
"required": [
"system",
"id"
]
},
"description": "Replaces the whole list; `[]` or `null` clears it. Two items whose `system` and `id` compare equal case aside are one reference (the first sent is kept); a pair the database takes for one beyond that (accents, `ß` and `ss`) answers `400`.",
"maxItems": 20
},
"metadata": {
"type": [
"object",
"null"
],
"description": "Your own fields: up to 50 keys of 1 to 40 letters, digits, `_`, `-` or `.`, each holding plain text of at most 500 characters; no number under a key ending in `_at`, or `stuck_since`.",
"maxProperties": 50,
"additionalProperties": {
"type": "string",
"maxLength": 500
}
},
"notice_period_days": {
"type": [
"integer",
"null"
],
"description": "Days before `end_date` the notice period starts (`document_contract_renewal_notice`); none when unset.",
"minimum": 0,
"maximum": 3650
},
"owner_id": {
"type": [
"string",
"null"
],
"description": "An active member of this workspace."
},
"parent_document_id": {
"type": [
"string",
"null"
],
"description": "Links the document as an amendment of this contract document, or of any document in its family (resolved to the root); `null` unlinks a pending amendment. With it, the other attributes are the terms the instrument changes, not terms of its own; on a pending amendment a `null` value drops that term from the delta rather than clearing it on the parent."
},
"relation_type": {
"type": "string",
"description": "Required on the first link. `amendment` may change `value`, `currency`, `start_date` (effective from, display only), `end_date`, `auto_renew`, `renewal_term_months`, `notice_period_days`, `counterparty_name` and `metadata`; `renewal` only `end_date` and `value`; `termination` only `end_date` (the effective date).",
"enum": [
"amendment",
"renewal",
"termination"
]
},
"renewal_term_months": {
"type": [
"integer",
"null"
],
"description": "How far a renewal by the term moves `end_date`; 12 when unset.",
"minimum": 1,
"maximum": 600
},
"start_date": {
"type": [
"string",
"null"
],
"description": "`YYYY-MM-DD`, from the year 1000.",
"format": "date"
},
"status": {
"type": "string",
"description": "On creation any status, so a contract that ended before it was tracked is registered as it ended: `expired` needs an `end_date` in the past, `terminated` its `end_date`; neither is walked by the lifecycle. Afterwards only `draft` or `active` (a contract in force never goes back to `draft`): `expired` and `terminated` are set by the lifecycle and the terminate endpoint; a closed contract is reopened by renewing it.",
"enum": [
"draft",
"active",
"expired",
"terminated"
]
},
"updated_at": {
"type": "string",
"description": "Optional precondition: the `updated_at` the client read the contract (or this document's amendment link) with, as the API returned it. If the contract or link changed since, nothing is written and the answer is `409` with `code: ContractChanged`. Not sent, or `null`: the write applies whatever changed meanwhile (last write wins). Compared to the second; a fraction of a second, as a JavaScript date prints it, is read and ignored. New terms and a first link have nothing to have read, so sending one answers `409`; on a pending amendment, send the link's own `updated_at` (the GET on that document).",
"format": "date-time"
},
"value": {
"type": [
"number",
"null"
],
"description": "Two decimal places at most.",
"minimum": 0,
"maximum": 9999999999999.99
}
},
"description": "Every attribute is optional and only the ones sent change. `null` clears an attribute, except `auto_renew` (back to `false`) and `currency` (back to `BRL` while a `value` is set); `status` does not accept `null`. A changed `end_date` starts a new `term`.",
"minProperties": 1,
"additionalProperties": false,
"anyOf": [
{
"required": [
"status"
]
},
{
"required": [
"counterparty_name"
]
},
{
"required": [
"value"
]
},
{
"required": [
"currency"
]
},
{
"required": [
"start_date"
]
},
{
"required": [
"end_date"
]
},
{
"required": [
"auto_renew"
]
},
{
"required": [
"renewal_term_months"
]
},
{
"required": [
"notice_period_days"
]
},
{
"required": [
"owner_id"
]
},
{
"required": [
"metadata"
]
},
{
"required": [
"external_references"
]
},
{
"required": [
"parent_document_id"
]
},
{
"required": [
"relation_type"
]
}
]
}
},
"required": [
"action",
"document_id",
"terms"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"minLength": 1
},
"action": {
"type": "string",
"const": "renew"
},
"document_id": {
"type": "string",
"minLength": 1
},
"end_date": {
"type": [
"string",
"null"
],
"description": "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.",
"format": "date"
},
"term": {
"type": "integer",
"description": "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.",
"minimum": 1
},
"updated_at": {
"type": "string",
"description": "Optional precondition: the contract's `updated_at` as read. Changed since: `409`, nothing renewed.",
"format": "date-time"
},
"value": {
"type": [
"number",
"null"
],
"description": "The new value; unchanged when not sent, cleared by `null`."
}
},
"required": [
"action",
"document_id",
"updated_at",
"term"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"minLength": 1
},
"action": {
"type": "string",
"const": "terminate"
},
"document_id": {
"type": "string",
"minLength": 1
},
"reason": {
"type": [
"string",
"null"
],
"description": "Kept in the `document_contract_terminated` event; HTML is stripped.",
"maxLength": 500
},
"updated_at": {
"type": "string",
"description": "Optional precondition: the contract's `updated_at` as read. Changed since: `409`, nothing terminated.",
"format": "date-time"
}
},
"required": [
"action",
"document_id",
"updated_at"
],
"additionalProperties": false
}
]
}