v29

latestOpenAPI 3.0.3raw.githubusercontent.com2026-05-13511526891.2 KB
OAuth Tokens

Create Token

Returns an OAuth access token with a specified scope.

Refresh tokens aren't used. An access token doesn't expire but it can be revoked.

For a tutorial, see Creating and using OAuth tokens with the API.

Note: For OAuth authorization code, use the Create Token for Grant Type endpoint. The two APIs don't share the same path, JSON format, or request parameters. However, both APIs return access tokens that can be used to authenticate API requests.

Allowed For

  • Admins

Request parameters

The POST request takes a "token" object that contains an OAuth client's resource id and scopes.

NameTypeDescription
client_idintegerThe resource id of an OAuth client (not the client's unique identifier). For the ids, see List Clients
scopesarrayValid scopes for the token. See Scopes below

Scopes

The scopes parameter defines whether requests authenticated with the token can post, put, and delete data, or only get data.

Note: Don't confuse the scopes parameter (plural) with the scope parameter (singular) for grant-type tokens.

The scopes parameter is an array of strings, each specifying a resource name and an access setting. Access is either "read" or "write". If you don't specify a resource, access to all resources is assumed. If you don't specify the access, read and write access are assumed.

The syntax is as follows:

"scopes": [resource:scope, ...]

where resource is optional.

Examples

"scopes": ["read"]

"scopes": ["tickets:read"]

To give read and write access to a resource, specify both scopes:

"scopes": ["users:read", "users:write"]

To give write access only to one resource and read access to everything else:

"scopes": ["organizations:write", "read"]

Note: The endpoint returns an access token even if you specify an invalid scope. Any request you make with the token will return a "Forbidden" error.

Available scopes

  • read - gives access to GET endpoints. Includes permission to sideload related resources
  • write - gives access to POST, PUT, and DELETE endpoints
  • impersonate - allows Zendesk Support admins to make requests on behalf of end users. See Making API requests on behalf of end users

Resources that can be scoped

  • tickets
  • users
  • auditlogs (read only)
  • organizations
  • hc
  • apps
  • triggers
  • automations
  • targets
  • webhooks
  • macros
  • requests
  • satisfaction_ratings
  • dynamic_content
  • any_channel (write only)
  • web_widget (write only)
post/api/v2/oauth/tokens

Response

Created response