Authentication

Overview

All Deel API requests require authentication and must be made over HTTPS. Deel supports two authentication methods:

This page covers API tokens. For OAuth2 authentication, see the OAuth2 documentation.

Token types

Deel supports three API token variants. All are used as Bearer tokens in the Authorization header, but they differ in who they represent, how you obtain them, and which endpoints they can call.

Token typeRepresentsHow to obtainUse it for
Organization tokenThe entire organizationDeveloper Center (dashboard)Server-to-server integrations: contracts, payroll, invoices, SCIM
Personal tokenA single user (you)Developer Center (dashboard)Contract creation, SSO integrations, user-scoped actions
Worker API tokenA single EOR workerCreate worker access token endpointEmbedded flows where the worker acts on their own data — for example, worker-initiated resignation

For OAuth2-based authentication, see the OAuth2 documentation.

API tokens

API tokens provide a straightforward way to authenticate server-to-server API requests. Tokens are used as Bearer tokens in the Authorization header.

Generating an API token

2

Access the Tokens tab

Click on Access Tokens tab

3

Create new token

Click Generate new token

4

Choose token type

Select the appropriate token type for your use case:

Organization token: Provides access to all organization resources

Use this for:

  • Reading contract data
  • Managing timesheets
  • Invoice adjustments
  • Accounting data
  • SCIM API access
5

Select scopes

Choose the scopes (permissions) your token needs. Scopes are listed in the API reference.

6

Configure sensitive data access

Customize what sensitive data the token can access

7

Generate and save

Review your settings and click Generate

Important: Copy and securely store the token immediately. You cannot retrieve it again after this screen.

Using API tokens

Include your token in the Authorization header as a Bearer token:

$curl -X GET 'https://api.letsdeel.com/rest/contracts' \
> -H 'Authorization: Bearer YOUR-TOKEN-HERE'
1const axios = require('axios');
2
3const deelAPI = axios.create({
4 baseURL: 'https://api.letsdeel.com/rest',
5 headers: {
6 'Authorization': `Bearer ${process.env.DEEL_API_TOKEN}`
7 }
8});
9
10// Make authenticated request
11const response = await deelAPI.get('/contracts');

Best practices for API tokens

  • Never commit tokens to version control
  • Use environment variables to store tokens
  • Rotate tokens regularly to minimize security risks
  • Use HTTPS only for all API requests
  • Delete unused tokens immediately
  • Use the least privilege principle: Only grant the minimum scopes needed
  • Separate tokens by function: Create different tokens for different integrations
  • Organization vs personal: Choose based on your access requirements

API credentials should be changed regularly. Employees leave, API credentials can be accidentally committed to version control, and security flaws can be discovered.

When to rotate:

  • Proactively on a regular schedule (quarterly recommended)
  • Immediately if potential compromise is suspected
  • When team members with access leave

Worker API tokens

A worker API token authenticates as a specific EOR worker rather than the client organization. Use it when an integration needs to act on behalf of an employee — for example, when the worker submits their own resignation or retrieves their own pending offboarding tasks.

Unlike organization and personal tokens, worker tokens are generated programmatically through the API, not the Developer Center dashboard.

Generating a worker API token

Call the Create worker access token endpoint using a client API token. The response returns a Bearer token scoped to a single worker.

Using a worker API token

Send the worker token in the Authorization header like any other Bearer token:

$curl -X GET 'https://api.letsdeel.com/rest/v2/eor/workers/resignations' \
> -H 'Authorization: Bearer YOUR-WORKER-TOKEN'

Limitations

  • Worker-scoped: A worker token can only act on the worker it was issued for.
  • Limited endpoint coverage: Worker tokens authenticate only against worker-side endpoints (paths under /rest/v2/eor/workers/). Calling standard client endpoints with a worker token returns 403 Forbidden.
  • Not interchangeable with client tokens: Standard client API tokens cannot call worker-side endpoints either. Flows that span both sides — such as client-initiated resignation — require both token types.

When to use a worker API token

ScenarioToken type
Worker submits their own resignationWorker API token
Worker previews their resignation letterWorker API token
Worker views their pending offboarding tasksWorker API token
Client initiates a resignation on behalf of a workerClient API token
Client reviews PTO during resignationClient API token
Client terminates a workerClient API token

For flows that combine both token types, see the EOR offboarding guide.

When to use API tokens vs OAuth2

ScenarioRecommended method
Server-to-server integrationAPI tokens
Internal automation scriptsAPI tokens
Third-party app requiring user consentOAuth2 (see OAuth2 docs)
Multi-tenant SaaS applicationOAuth2 (see OAuth2 docs)
Accessing your own organization’s dataAPI tokens
App Store published applicationsOAuth2 (see OAuth2 docs)

Scopes

Scopes control granular access to different parts of the Deel API. When creating a token, you’ll select the scopes (permissions) it needs.

Least privilege principle: Only grant the minimum scopes necessary for your use case. Each API endpoint lists its required scopes in the API reference.

Common scope patterns:

  • Read scopes: {resource}:read (e.g., contracts:read, people:read)
  • Write scopes: {resource}:write (e.g., contracts:write, timesheets:write)

Check each endpoint’s documentation to see which scopes are required.

Troubleshooting

Common causes:

  • Invalid or expired token
  • Missing Authorization header
  • Token doesn’t have required scopes

Solutions:

  • Verify token is correct and not expired
  • Check header formatting: Authorization: Bearer TOKEN
  • Ensure token has necessary scopes
  • Generate a new token if needed

Common causes:

  • Token lacks required scopes for the endpoint
  • Attempting to access resources outside token’s permissions

Solutions:

  • Review the scopes assigned to your token
  • Generate a new token with appropriate scopes

Solution:

  • Generate a new token in Developer Center
  • Update your application with the new token
  • Consider setting up a rotation schedule

Cause:

  • Attempting to make requests over HTTP

Solution:

  • All API requests must use HTTPS
  • Update your base URL to https://api.letsdeel.com/rest

Security best practices

Store credentials in environment variables or secure vaults, never in code

Rotate tokens quarterly or when team members leave

Request only the scopes your application absolutely needs

Log and monitor API calls to detect unusual patterns

Never make API requests over unencrypted connections

Immediately revoke tokens if compromise is suspected

Next steps