Authentication
Overview
All Deel API requests require authentication and must be made over HTTPS. Deel supports two authentication methods:
Creating API tokens, authorizing OAuth apps, and connecting Model Context Protocol (MCP) clients require a completed Customer Due Diligence (CDD) check for your organization. Tokens you already have keep working. If creation fails with 403, contact your Deel representative.
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.
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
Create tokens from the Tokens page in the Developer Center. You need Developer Center access (developer_center.manage) to create and manage tokens.
The redesigned Developer Center is rolling out in phases. Until it reaches your organization, you see the previous token pages and wizard. Existing tokens keep working unchanged in both experiences.
Open the Tokens page
Click the cog icon in the top bar to open All Settings. Under Services, select Developer, then Tokens. The list shows each token with its scopes, owner, last used date, expiry and status.
Open the create drawer
Click Create token. The Create access token drawer opens. Scopes are fixed once the token is created, so confirm them before you continue.
Name the token and choose its type
Enter a Token name (required), then select the token type for your use case:
Organization token
Personal token
Organization token: Belongs to the company and survives people leaving. Provides access to all organization resources.
Use this for:
- Reading contract data
- Managing timesheets
- Invoice adjustments
- Accounting data
- SCIM API access
Select access
Under Access, pick a preset to fill in the scopes: Read-only, People & HR, Payroll & finance, Full access, or Custom. Use Filter resources to find a resource, then choose Read, Write, or both for each one. Expand a resource to select individual scopes. The drawer shows how many scopes are selected, for example 53 of 104. Scopes are listed in the API reference.
Set limits and privacy
Open Limits and privacy to restrict the token:
- Applies to: Choose Whole organization for every entity and group, or Specific groups to limit where the token can be used.
- Hide from API responses: Turn on Hide personally identifiable information to redact names, emails and addresses. Turn on Hide compensation data to redact salary and payment amounts.
- Expires: Choose when the token expires. The default is 90 days. The API rejects expired tokens immediately.
Create and save
The footer summarizes what the token can do, for example read-only access to 53 resources across the whole organization that expires in 90 days. Review it and click Create token.
The Token created panel shows the token with a copy button, an Import to Doppler button, and a ready to run curl request to try it. The panel also summarizes what the token can do. Click Done when you have saved the token.
Important: Copy and securely store the token immediately. It is never shown again. If you lose it, invalidate the token and create a new one.
Managing API tokens
The Tokens page lists every token in your organization with its scopes, owner, last used date, expiry and status. Search the list, filter it by Owner, sort it (for example, newest first), and use Export CSV to download it. A summary row at the top counts the tokens that need attention, so you can spot risky tokens:
Click the three dot menu at the end of a token row to choose one of these actions:
- View details: Open the token drawer.
- Duplicate as new token: Create a new token based on this one.
- Usage log: Review the token’s requests over the last 15 days.
- Invalidate: Stop the token from authenticating requests.
To invalidate several tokens at once, select them with the checkboxes in the list. A bar appears with the number selected, Clear selection and Invalidate. Click Invalidate to invalidate every selected token.
Token details
View details opens the token drawer. The drawer shows:
- Type, Owner, Status and Created date
- Expires, Last used and Applies to (for example, whole organization)
- Scopes: The full list of scopes, with the total and the number of write scopes. Scopes are fixed at creation and cannot be edited.
- Recent activity: Requests in the last 15 days, the last request and the busiest day. Select See all to open the usage log, which you can export to CSV.
A token with no expiry shows a warning, because it stays valid until you invalidate it. To add an expiry, duplicate the token with an expiry, then invalidate the original. Use Duplicate as new token or Invalidate at the bottom of the drawer.
Click Inspect a token on the Tokens page to decode a token and check its details without calling the API.
Using API tokens
Include your token in the Authorization header as a Bearer token:
Best practices for API tokens
Security
- 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
Scope selection
- 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
Token rotation
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.
This endpoint is only available to organizations with the Embedded partnership model enabled. Contact your Deel representative to enable it. See Getting started for the full Embedded prerequisites.
Using a worker API token
Send the worker token in the Authorization header like any other Bearer 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/eor/workers/). Calling standard client endpoints with a worker token returns403 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
For flows that combine both token types, see the EOR offboarding guide.
When to use API tokens vs OAuth2
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
401 Unauthorized error
Common causes:
- Invalid or expired token
- Missing
Authorizationheader - 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
403 Forbidden error
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
Token expired
Solution:
- Generate a new token in Developer Center
- Update your application with the new token
- Consider setting up a rotation schedule
HTTPS required error
Cause:
- Attempting to make requests over HTTP
Solution:
- All API requests must use HTTPS
- Update your base URL to
https://api.letsdeel.com/rest
Request logs in the Developer Center list every request made with your organization’s tokens, including rejected ones, for 15 days. Each rejected request includes the reason it was rejected. Look up a failed call by its X-Request-ID response header.
Security best practices
Secure storage
Store credentials in environment variables or secure vaults, never in code
Regular rotation
Rotate tokens quarterly or when team members leave
Minimal scopes
Request only the scopes your application absolutely needs
Monitor usage
Log and monitor API calls to detect unusual patterns. The Developer Center Request logs keep 15 days of every request made with your organization’s tokens, including the token, source IP, and calling client.
HTTPS only
Never make API requests over unencrypted connections
Revoke quickly
Immediately revoke tokens if compromise is suspected