Skip to content

Deel: Create a termination request for the contract

Deel terminations.createContractTermination: arguments, response, policy and SDK examples.

← Terminations operations · Get started

Operation deel.terminations_createcontracttermination

Provider route: POST /contracts/{contract_id}/terminations. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/deel with npm, or alter-sdk-deel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { DeelIntegration } from "@alter-ai/deel";
async function execute(input: Parameters<DeelIntegration["terminations"]["createContractTermination"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new DeelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.terminations.createContractTermination(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_deel import DeelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = DeelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.terminations.create_contract_termination(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.contract_idstringRequired within parent
bodyobjectOptional
body.dataModelRequired within parentExpand Create a termination request for the contract — request body — body data
Termination data. At minimum, you must provide either terminate_now: true (for immediate termination) OR completion_date (for scheduled termination).

Referenced models: Create a termination request for the contract — request body — body data

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a termination request for the contract — 201 response body

Referenced models: Create a termination request for the contract — 201 response body

Create a termination request for the contract — request body — body data
FieldTypePresenceDescription and constraints
$objectRootTermination data. At minimum, you must provide either terminate_now: true (for immediate termination) OR completion_date (for scheduled termination).
completion_datestringOptionalContract completion date (YYYY-MM-DD). Required when terminate_now is false or not provided. Since terminate_now defaults to false, this field is required unless you explicitly set terminate_now to true.
Format: date
eligible_for_rehirestringOptionalIndicates whether the contractor is eligible for rehire in the future.
One of: YES, NO, DONT_KNOW
eligible_for_rehire_reasonstringOptionalProvides context when eligible_for_rehire is 'DONT_KNOW'. Should be empty or null for other values.
Maximum length: 255
messagestringOptionalOptional message to include with the termination
Maximum length: 1000
terminate_nowbooleanOptionalIf true, terminates the contract immediately. If false, completion_date is required.
Default: false
termination_reason_descriptionstringOptionalFree-form text providing additional context about the termination reason. Can be provided independently without termination_reason_id, or used to add context to a selected reason.
Maximum length: 1000
termination_reason_idstringOptionalThe UUID of the termination reason. Use GET /contracts/termination-reasons to retrieve the list of available reasons.
Format: uuid
termination_typestringOptionalThe type of termination. Specifies whether it is a resignation (contractor-initiated), termination (client-initiated), or end of contract (mutual/planned).
One of: RESIGNATION, TERMINATION, END_OF_CONTRACT
Create a termination request for the contract — 201 response body
FieldTypePresenceDescription and constraints
$objectRoot
dataModelOptionalExpand Create a termination request for the contract — 201 response body — data

Referenced models: Create a termination request for the contract — 201 response body — data

Create a termination request for the contract — 201 response body — data
FieldTypePresenceDescription and constraints
$objectRoot
completion_datestringOptionalContract completion date
Format: date-time
idstringOptionalContract id

SDK function policy ID: deel.terminations_createcontracttermination. Catalog operation: contracts/terminate. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["contracts:write"]

Pinned headers: {"X-Version": "2026-01-01"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.