> This page is for API, version 2026-01-01 (Stable) (default).
> For other versions, use one of these documentation indexes:
> - 2026-01-01 (Stable) (default): https://developer.deel.com/api/stable/llms.txt
> - Beta: https://developer.deel.com/api/beta/llms.txt
> - Deprecated: https://developer.deel.com/api/deprecated/llms.txt

> 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.

# Assign a project to contracts

POST https://api.letsdeel.com/rest/time-tracking/projects/{project_id}/contracts
Content-Type: application/json

Assigns the project to up to 100 contracts, so their workers can record shifts against it. All or nothing: if any contract cannot take it, nothing is assigned. Contracts already assigned are kept, so a retry gets the same answer.

 **Token scopes**: `time-tracking:write`

 **Beta**: this version requires the `X-Beta: true` request header and its contract may change before it is promoted to stable. It is scheduled to become stable on 2027-02-25.

Reference: https://developer.deel.com/api/reference/endpoints/time-tracking-projects/assign-project-contracts-v-2026-11-25

## 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

- `project_id` (string, required) — Deel ID of the project, as returned in the project's id field.

### Headers

- `Idempotency-Key` (string, optional) — Unique key for this write, up to 64 characters, kept for 24 hours. Repeating a successful request with the same key returns the first response instead of writing again; a failed request is not kept and can be retried with the same key. A request whose key is still in progress, or was used for a different request, gets 409.
- `X-Beta` (enum, required, default: true) — Opts in to the beta version of this endpoint. Must be `true`.
  - Allowed values: `true`

### Body (application/json)

This endpoint expects an object.

- `data` (TimeTrackingProjectsProjectIdContractsPostRequestBodyContentApplicationJsonSchemaData, required) — Contracts to assign the project to.

## Response

### 200

Every requested contract, in request order, with the date the project was assigned to it.

- `data` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaDataItems, required) — One item per requested contract.

## Errors

### 400 Bad Request Error

MALFORMED_REQUEST. The body is not a JSON object with a data object.

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 401 Unauthorized Error

The token is missing, invalid, inactive or revoked (INVALID_TOKEN, TOKEN_INACTIVE, TOKEN_REVOKED or UNAUTHORIZED).

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 403 Forbidden Error

INSUFFICIENT_SCOPES (the token lacks the time-tracking:write scope) or TOKEN_TYPE_NOT_ALLOWED (only organization tokens can change projects).

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 404 Not Found Error

PROJECT_NOT_FOUND. No such project in the caller's organization, or the id is not a UUID.

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 409 Conflict Error

IDEMPOTENCY_CONFLICT (a request with the same Idempotency-Key is still in progress; retry after the seconds in the retry-after header) or IDEMPOTENCY_KEY_REUSED (the key was already used for a different request).

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 422 Unprocessable Entity Error

INVALID_FIELD (contract_ids empty, over 100 or repeated), PROJECT_ARCHIVED, or, together in one answer, CONTRACT_NOT_FOUND (contracts not in the organization) and CONTRACT_NOT_ELIGIBLE (pay-as-you-go, inactive or deleted contracts), each with details.contract_ids.

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 429 Too Many Requests Error

RATE_LIMITED. Over 5 requests per second for the organization.

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

### 500 Internal Server Error

INTERNAL_ERROR. Unexpected failure; safe to retry with the same Idempotency-Key.

- `errors` (list of TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems, required) — Every problem found, not only the first.

## Types

### TimeTrackingProjectsProjectIdContractsPostRequestBodyContentApplicationJsonSchemaData

Contracts to assign the project to.

- `contract_ids` (list of string, required) — Deel contracts to assign, 1 to 100, without repeats. Contracts already assigned are kept as they are.

### TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaDataItems

A contract the project is assigned to.

- `assigned_at` (string, required) — When the project was assigned to the contract, in UTC.
- `contract_id` (string, required) — Deel contract the project is assigned to.

### TimeTrackingProjectsProjectIdContractsPostResponsesContentApplicationJsonSchemaErrorsItems

One problem with the request.

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable explanation. May change; do not parse it.
- `field` (string, optional) — Request field the error refers to, when there is one.
- `details` (map from string to any, optional) — Extra data for the error code, such as the contract ids it refers to.

## Examples

**Request**

```json
{
  "data": {
    "contract_ids": [
      "m3x9k2p",
      "q7w2e5r"
    ]
  }
}
```

**Response**

```json
{
  "data": [
    {
      "assigned_at": "2026-11-03T21:05:12.000Z",
      "contract_id": "m3x9k2p"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.letsdeel.com/rest/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts"

payload = { "data": { "contract_ids": ["m3x9k2p", "q7w2e5r"] } }
headers = {
    "Idempotency-Key": "3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c",
    "X-Beta": "true",
    "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/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c',
    'X-Beta': 'true',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"data":{"contract_ids":["m3x9k2p","q7w2e5r"]}}'
};

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/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts"

	payload := strings.NewReader("{\n  \"data\": {\n    \"contract_ids\": [\n      \"m3x9k2p\",\n      \"q7w2e5r\"\n    ]\n  }\n}")

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

	req.Header.Add("Idempotency-Key", "3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c")
	req.Header.Add("X-Beta", "true")
	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/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c'
request["X-Beta"] = 'true'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"contract_ids\": [\n      \"m3x9k2p\",\n      \"q7w2e5r\"\n    ]\n  }\n}"

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/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts")
  .header("Idempotency-Key", "3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c")
  .header("X-Beta", "true")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"contract_ids\": [\n      \"m3x9k2p\",\n      \"q7w2e5r\"\n    ]\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts', [
  'body' => '{
  "data": {
    "contract_ids": [
      "m3x9k2p",
      "q7w2e5r"
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c',
    'X-Beta' => 'true',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c");
request.AddHeader("X-Beta", "true");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"contract_ids\": [\n      \"m3x9k2p\",\n      \"q7w2e5r\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "3f1c2b9e-7a4d-4e1b-9c2a-5d8e6f7a1b2c",
  "X-Beta": "true",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["data": ["contract_ids": ["m3x9k2p", "q7w2e5r"]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/time-tracking/projects/0b6f3c1e-2d4a-4f8b-9e7c-1a2b3c4d5e6f/contracts")! 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()
```