> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.deel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.deel.com/_mcp/server.

# Terminate contract

POST https://api.letsdeel.com/rest/contracts/{contract_id}/terminations
Content-Type: application/json

Initiates termination of an active contract, recording the termination reason, effective date, and any final payment details. Can only be called on contracts that are currently active.

 **Token scopes**: `contracts:write`

Reference: https://developer.deel.com/api/embedded/ic-endpoints/terminations/create-contract-termination

## Authentication

- `Authorization` header (bearer token, required) — ## Authentication The Deel API uses bearer tokens to authenticate requests. All API calls must be made over HTTPS — calls over plain HTTP or without authentication will fail. ```curl curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \ -H 'Authorization: Bearer YOUR-TOKEN-HERE' ``` [Learn more about authentication](/api/authentication)
- `Authorization` header (bearer token, required) — Standard OAuth2 security scheme based on https://swagger.io/docs/specification/authentication/

## Servers

- `https://api.letsdeel.com/rest` (Production, default)
- `https://api-staging.letsdeel.com/rest` (Demo)

## Request

### Path parameters

- `contract_id` (string, required) — The unique identifier of the contractor contract

### Body (application/json)

This endpoint expects an object.

- `data` (ContractsContractIdTerminationsPostRequestBodyContentApplicationJsonSchemaData, required) — Termination data. At minimum, you must provide either terminate_now: true (for immediate termination) OR completion_date (for scheduled termination).

## Response

### 201

Successful operation

- `data` (ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Validation or business-rule failure. Possible codes: invalid_parameter (Joi schema violation, e.g. missing completion_date when terminate_now is false); contract_not_active (contract is not in an active state and cannot be terminated); invalid_completion_date (completion_date is in the past or otherwise invalid); invalid_termination_reason (termination_reason_id does not exist or is not applicable).

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 401 Unauthorized Error

Missing or invalid bearer token.

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 403 Forbidden Error

Caller lacks permission to terminate this contract. Either the caller does not have the contracts.terminate permission, is not a CLIENT profile, or does not have access to the specified contract.

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 404 Not Found Error

No active contract was found for the provided contract_id, or the caller does not have access to it.

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 409 Conflict Error

A termination request already exists for this contract and cannot be duplicated.

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 500 Internal Server Error

Unhandled server error or downstream service failure during contract termination. The transaction is rolled back and no termination is persisted.

- `errors` (list of ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)

## Types

### ContractsContractIdTerminationsPostRequestBodyContentApplicationJsonSchemaData

Termination data. At minimum, you must provide either terminate_now: true (for immediate termination) OR completion_date (for scheduled termination).

- `message` (string, optional) — Optional message to include with the termination
- `terminate_now` (boolean, optional, default: false) — If true, terminates the contract immediately. If false, completion_date is required.
- `completion_date` (string, optional) — Contract 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.
- `termination_type` (enum, optional) — The type of termination. Specifies whether it is a resignation (contractor-initiated), termination (client-initiated), or end of contract (mutual/planned).
  - Allowed values: `RESIGNATION`, `TERMINATION`, `END_OF_CONTRACT`
- `eligible_for_rehire` (enum, optional) — Indicates whether the contractor is eligible for rehire in the future.
  - Allowed values: `YES`, `NO`, `DONT_KNOW`
- `termination_reason_id` (string, optional) — The UUID of the termination reason. Use GET /contracts/termination-reasons to retrieve the list of available reasons.
- `eligible_for_rehire_reason` (string, optional) — Provides context when eligible_for_rehire is 'DONT_KNOW'. Should be empty or null for other values.
- `termination_reason_description` (string, optional) — Free-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.

### ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaData

- `id` (string, optional) — Contract id
- `completion_date` (string, optional) — Contract completion date

### ContractsContractIdTerminationsPostResponsesContentApplicationJsonSchemaErrorsItems

- `code` (string, optional) — Machine-readable error code
- `message` (string, optional) — Human-readable explanation of the error

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "id": "5f4e1e4e",
    "completion_date": "2022-01-01T00:00:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/contracts/eq2ykjw/terminations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```