Handle Contract Termination
Terminate the contract, or chosen services on it (CRM-11489).
Running recurring services end on their new date with auto-renewal off and their total prorated to the shorter term, so ARR does not inflate. Services that would not have started by then are canceled and keep their dates. One-time services are never touched.
The notice, its per-service snapshot and the service writes are
one transaction; the contract figures are recomputed after it
commits. A contract with financialOverride keeps its figures. An
end date in the past expires the contract straight away and the
notice is saved as TERMINATED; otherwise it is SCHEDULED.
Status codes: 400 for a refused request (structured body, same shape as the terms flows), 403 from the Update terms gate, 404 for a missing contract.
Path Parameters
- Type: stringcontract
_id required
Body·
A termination notice for the whole contract or for chosen services.
- Type: stringFormat: date-timenotice
Date requiredWhen notice was given. Not in the future
- Type: enumscoperequired
ENTIRE_CONTRACT or PER_SERVICE
valuesENTIRE_CONTRACTPER_SERVICE - Type: stringFormat: date-timenullableeffective
End Date The contract's last active day. Required for ENTIRE_CONTRACT, ignored otherwise
- Type: stringnotesmax length:8192nullable
Free-text notes
- Type: integernullablereason
Id Termination reason ID
- Type: array of TerminationServiceInputnullableservicesProperties: 2
The recurring services to end. Required for PER_SERVICE, ignored otherwise
Responses
- application/json
- application/json
- application/json
curl 'https://crm.dreamhub.ai/api/v1/contracts/{contract_id}/termination' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"scope": "ENTIRE_CONTRACT",
"noticeDate": "2026-11-12T20:58:40.544Z",
"effectiveEndDate": "2026-11-12T20:58:40.544Z",
"services": [
{
"revenueItemId": "",
"endDate": "2026-11-12T20:58:40.544Z"
}
],
"reasonId": 1,
"notes": ""
}'
{
"id": "string",
"contractId": "string",
"scope": "ENTIRE_CONTRACT",
"state": "SCHEDULED",
"noticeDate": "2026-11-12T20:58:40.549Z",
"effectiveEndDate": "2026-11-12T20:58:40.549Z",
"reasonId": 1,
"notes": "string",
"createdBy": "string",
"createdAt": "2026-11-12T20:58:40.549Z",
"items": [
{
"revenueItemId": "string",
"action": "END",
"newServiceEndDate": "2026-11-12T20:58:40.549Z",
"newTotalLocal": 1,
"originalServiceEndDate": "2026-11-12T20:58:40.549Z",
"originalTotalLocal": 1,
"originalAutoRenewal": true
}
]
}
