API tokens and developer access

Updated Nov 28, 20266 min read
English
On this page

API tokens let your code or scripts talk to your Deskwoot account without a password. You create one per integration (a CRM sync, a custom dashboard, an internal tool) and give it only the permissions that integration actually needs.

Which plan do I need?

The REST API is an Enterprise feature. The 7 day Enterprise trial that every new account starts on includes it too. Tokens made on a lower plan before the API became an Enterprise feature keep working until they expire.

For what the API covers, see the REST API overview.

How do I generate an API token?

The API Tokens page with the token Fernhill CRM sync: its scopes Read everything and Write everything, Last used Never, its expiry date and Revoke
A new token in the list, with its scopes, last use and expiry date.

Administrators can create tokens, and so can agents whose custom role has Create API tokens (see Custom roles and permissions). A token acts as the person who created it and can do only what their role allows.

  1. Go to Settings > API Tokens.
  2. Click Create token.
  3. Give the token a descriptive name (for example CRM sync, production) so you can tell later what it is for.
  4. Under When does it run out?, choose when the token stops working: 1 year is picked for you, and you can switch to 30 days, 90 days, On a day you pick or No expiry.
  5. Under What may it do?, select the permission scopes the token should have. Grant only the access your integration actually needs.
  6. Click Create token and confirm with your password, and with your second factor when you use two factor sign in.
  7. Click Copy. For security reasons, the full token is shown only once.
  8. Click Done.

You and your workspace's administrators get an email about the new token.

No password because you signed up with Google or Apple, or because your workspace signs you in through your company's single sign on? Sign out, sign in that way again and create the token within a few minutes.

How do I use the API?

All API requests go to this base URL:

https://api.deskwoot.com/v1/

Include your API token in the Authorization header of every request:

Authorization: Bearer YOUR_TOKEN

Example request

A simple cURL call to test your connection:

curl -H "Authorization: Bearer YOUR_TOKEN" https://api.deskwoot.com/v1/me

If the token is valid, the API returns your account ID and the token's scopes. If not, you get an authentication error. The full endpoint reference is in the API docs.

What are the best practices?

  • Grant the least access needed. Give each token only the permissions it requires. Avoid tokens with full admin access unless you really need it.
  • Rotate tokens regularly. Revoke old tokens now and then and create new ones, especially when team members change roles or leave. Revoking works at once and does not affect any other token.
  • Store tokens securely. Keep them in environment variables or a secrets manager. Never write them into code that runs in the browser, and never commit them to version control.
  • Use descriptive names. Naming tokens after the integration or environment they serve makes audits easy.
  • Monitor usage. Each member sees and revokes their own tokens in Settings > API Tokens. Review them regularly and delete any you no longer use. Administrators also see every member's API tokens there, under Tokens of other members, and can revoke them.

How do I troubleshoot token errors?

  • 401 Unauthorized: check that the token is copied correctly, has not expired or been revoked, and sits in the header with the Bearer prefix.
  • 401 for a token that worked before: a token stops working while the person who created it is suspended or their role no longer has Create API tokens, and works again once that changes back. Removing that person from the workspace deletes their tokens.
  • 403 Forbidden: the token may lack the scope for the endpoint you call. Create a new token with the right scopes and revoke the old one.
  • 403 although the scope is right: the workspace is no longer on the Enterprise plan, or the person who created the token may not do this in the dashboard. An agent's token has that agent's role, so the reports, for example, need View reports.
  • Rate limiting: if you get rate limit errors, call the API less often or add exponential backoff to your code.

Frequently asked questions

What scopes are available?

In Settings > API Tokens you can pick Read everything (read) or Write everything (write). Or tick Read or Write for single areas only: Contacts, Conversations, Help center, Fynn and Deployed versions (for your CI's deploy reports).

In the API these are contacts:read, contacts:write, conversations:read, conversations:write, help_center:read, help_center:write, fynn:read, fynn:write, deployments:read and deployments:write. Pick the narrowest scopes the integration actually needs.

Bring in incoming messages (inbound:ingest) pushes messages into a REST API channel inbox and is not covered by Write everything. It also needs Manage inboxes in the role of the person who creates the token (administrators always have it).

Without that permission the page does not offer this scope, and if that person loses it later, their token gets a 403 for every message it pushes.

Does a token belong to a user or to the account?

Both: a token belongs to the person who created it, inside one account, and acts as that person. Its actions are attributed to them.

It sees the same conversations and needs the same permissions as they do in the dashboard, so an administrator's token reaches the whole workspace and an agent's token only what that agent may do.

For shared integrations, let a dedicated user own the integration's tokens, with a role that allows only what the integration needs.

Does the API count toward my AI conversations quota?

Only a reply to a customer does. Reading conversations and notes or managing contacts through the API never uses AI conversations.

A reply that reaches the customer through a REST API token counts as 1 AI conversation, once per conversation window, on top of Fynn and Copilot; next to them it adds at most 0.5.

Replies of connected AI agents and of Custom webhook bots share that count with the API, see How AI conversations are counted and billed.

Can I scope a token to a single inbox or team?

Not with scopes. But a token sees what the person who created it sees. So give a role with Their teams' and their own the permission Create API tokens, and let an agent with that role create the token.

That token reaches only the conversations of the agent's teams, plus their own, the ones they are mentioned in and unassigned ones without a team. For a single inbox, filter every request to that inbox's ID on your side.

What happens if I lose a token?

Revoke it and create a new one. There is no recovery, on purpose: Deskwoot stores only a SHA-256 hash of the token, never the token itself.

How do I rotate tokens without downtime?

Create the new token, deploy it everywhere, leave the old one active for one deploy cycle, then revoke it. Both tokens work in parallel during that window, so nothing breaks.

Was this guide helpful?

Keep reading

Still need help?

Fynn answers from these guides in the chat, and you can reach the team there too.