Authorization and scopes

|

View as Markdown

Every authenticated API request needs credentials that carry the scope the endpoint requires. An API key carries the scopes assigned to it. With other authentication methods, the roles of the user determine the scopes.



API scopes

A scope is an additional layer of control and security over the REST API. It limits which endpoints an authenticated user, API key, or OAuth client can call. Scopes provide access to a specific set of API endpoints, typically designed to serve specific use cases.

By granting a specific scope to a user or an API key, you can:

  • Limit their access to a subset of API endpoints covered by the scope
  • Prevent users from accessing data or API functionality outside their role
  • Reduce the potential negative impact of leaked or stolen API keys
  • Combine multiple scopes on the same user or API key to cover the different endpoints a complex integration needs

Scope naming pattern [#scope-naming-pattern-api-scopes]

Scopes follow a consistent naming pattern: product:resource:action (for example, sms:message:send). In this example, sms is the product or channel, message is the resource being acted on, and send is the action. The action determines the level of access granted.

Understanding the pattern helps you identify the correct scope without checking every scope individually. The following table lists the common actions:

ActionWhat it coversWhen to use
:manageThe broadest scope within a single channel or product. Covers all associated endpoints: sending traffic, reading logs, managing inbound messages, and configuration.When your integration needs full access to one channel. Prefer narrower scopes where possible to limit exposure if a key is compromised.
:sendOutbound traffic only.When your integration only needs to send messages and has no reason to access logs, inbox, or configuration endpoints.
:read and :logs:readRead-only access to data such as delivery logs and inbound messages, without any ability to send or configure.When your integration queries data only.
:deleteDeletion of specific resources such as recordings. More targeted than :manage.When your integration needs to delete specific resources but not configure or send.
:receiveInbound traffic only. Complement to :send.When your integration only needs to handle incoming calls or messages, not send them.
:recordRecording of calls or sessions.When your integration needs to record traffic but not otherwise manage it.
:useLimited execute access. Use an existing resource without full management rights.When your integration needs to trigger a resource (for example, add participants to a flow or submit data to a form) but not configure it.
:viewView-only access, narrower than :read. Common in product-specific contexts.When your integration needs visibility into a resource without being able to query raw data.
:controlLaunch, stop, or cancel a resource without the ability to edit it.When your integration orchestrates existing flows or campaigns but does not need to configure them.
:provisionProvisioning and setup actions, such as registering senders or numbers.When your integration automates onboarding or resource setup.
:sdkClient-side SDK access (web:sdk, mobile-app-messaging:sdk, 2fa:sdk, web:tracking:sdk). Listed for backward compatibility. Applies only when the SDK runs in the browser or mobile device of an end user.Only for keys used in client-side contexts. Do not assign to server-side integrations.

The number of scopes available for a given channel depends on the complexity of the product and the variety of use cases it supports. Some product-specific actions exist beyond these patterns (for example, :query, :testing, :conversions). For the complete list, see API scopes reference.


General cross-channel scopes [#general-cross-channel-scopes-api-scopes]

Two general scopes span all channels and do not need to be specified per channel. The following table lists them:

ScopeWhat it covers
message:sendEnables sending of mobile terminated (MT) messages regardless of the channel. Includes all channel:message:send endpoints across all channels.
inbound-message:readEnables fetching of mobile originated (MO) messages regardless of the channel. Includes all channel:inbound-message:read endpoints across all channels.

These cover sending and receiving across all channels with a single scope. Unlike :manage, they do not include channel configuration. Use them when your integration spans multiple channels and you only need to send or receive messages without configuring individual channels.


How scopes apply to endpoints [#how-scopes-apply-to-endpoints-api-scopes]

Each API endpoint requires at least one specific scope. Your API key only needs to have one of the listed scopes to access that endpoint. You do not need to assign every scope an endpoint lists.

To find the required scopes for a specific endpoint, go to the endpoint in the API reference. Check the Scopes field, listed next to Authorizations on the endpoint page. Each endpoint lists the exact scopes it accepts (for example, message:send).



Assign scopes when creating an API key

Only users with the Account admin or Channel setup and integrations role can create API keys. You can only assign scopes your own user role has.


  1. Go to Developer Tools > API Keys > Create API key.
  2. Set the key name and expiration date.
  3. Optionally, add allowed IP addresses to restrict usage to specific sources.
  4. Under API Scopes, expand the relevant category and select the scopes you need.
  5. Select Create, then copy the key and store it securely.

The web interface offers the following scope categories:

  • General: Cross-channel scopes (for example, message:send, inbound-message:read)
  • Channels: Per-channel scopes (SMS, Email, WhatsApp, Voice, and more)
  • Connectivity: Number lookup, Mobile Identity, Number Activation State
  • Platform: Account management, Messages API, Subscriptions, Signals, Blocklist
  • Customer Engagement: Conversations, People, Answers, Moments flows, Forms
  • Client-side SDK: Client-side SDK scopes


Update scopes on an API key

You can change the scopes on an existing API key in the web interface or through the API.

IMPORTANTRemoving a scope from a key that is actively in use immediately disrupts any traffic or functionality that depends on it. Confirm which integrations rely on the scope before you update the key.

Go to Developer Tools > API Keys. Select the key, change the scopes, and select Save.



User roles and API scopes

If you are using Basic authentication instead of an API key, scopes are not assigned directly to the user. Instead, user roles grant scopes implicitly. For the full role-to-scope mapping and role capability descriptions, see User roles and API scopes in API scopes reference. To assign a role to a user, see Manage roles.



Authorization errors

A 403 Forbidden response means your credentials are valid, so authentication succeeded. Your API key or user role does not have the required scope for the endpoint you are calling. This is distinct from 401 Unauthorized, which means authentication itself failed. See Authentication errors for 401 error handling.

To fix a 403, check the Scopes field of the endpoint in the API reference, and add one of the listed scopes to your API key or a role with that scope to your user.

Authorization error
1{
2 "errorCode": "E403",
3 "description": "Insufficient permissions to access the requested resource.",
4 "action": "Repeat the request with new or different credentials.",
5 "violations": [],
6 "resources": [
7 {
8 "name": "API Scopes",
9 "url": "/docs/developer-resources/authentication-and-access/authorization-and-scopes#api-scopes"
10 }
11 ]
12}

Some endpoints can return a previous version of the error:

Authorization error (legacy format)
1{
2 "requestError": {
3 "serviceException": {
4 "messageId": "FORBIDDEN",
5 "text": "Forbidden"
6 }
7 }
8}

For all HTTP status codes and how to handle them, see Handling errors.



Related pages

API scopes reference
All available API scopes and the scopes granted by predefined user roles.

API authentication
Authenticate requests using API keys, OAuth 2.0, IBSSO tokens, or HTTP Basic authentication.

Security best practices
Guidelines for securing API integrations: authentication, traffic encryption, credential storage, and AIT prevention.




Was this page helpful?