Summary
When we create a contractor contract via POST /rest/v2/contracts using a personal API token with contracts:write (and related scopes), Deel responds with HTTP 403 and error code TOKEN_TYPE_NOT_ALLOWED / message “Invalid token type for this endpoint”. The personal API token has the correct scopes enabled.
Example Request
POST https://api.letsdeel.com/rest/v2/contracts
Content-Type: application/json
Accept: application/json
Authorization: Bearer <personal_token_redacted>
Body –
{
"data": {
"title": "<contractor name>",
"country_code": "US",
"state_code": "<state>",
"scope_of_work": "As described",
"special_clause": "",
"client": {
"legal_entity": { "id": "<legal_entity_id>" },
"team": { "id": "<team_id>" }
},
"job_title": { "name": "Software Developer" },
"notice_period": 10,
"who_reports": "client",
"meta": { "documents_required": true },
"worker": {
"expected_email": "<provider@email.com>",
"first_name": "<first>",
"last_name": "<last>"
},
"type": "pay_as_you_go_time_based",
"start_date": "YYYY-MM-DD",
"compensation_details": {
"amount": 30,
"currency_code": "USD",
"frequency": "semimonthly",
"cycle_end": 15,
"cycle_end_type": "DAY_OF_MONTH",
"payment_due_type": "REGULAR",
"payment_due_days": 0,
"pay_before_weekends": false,
"scale": "hourly"
}
}
Actual response
HTTP status: 403
Response body (example)
{
"request": {
"method": "POST",
"url": "/rest/contracts",
"status": 403,
"api_req_id": "<api_req_id>",
"docs": "no match",
"source": "rest"
},
"errors": [
{
"message": "Invalid token type for this endpoint",
"code": "TOKEN_TYPE_NOT_ALLOWED"
}
]
}
Please investigate using api_req_id from the error response:
864b4475ce3f67749e98cfdd3925c5e3