Skip to main content
POST
Request an access token
Exchange the client ID and client secret of your OAuth application for a short-lived access token using the OAuth 2.0 client credentials grant. Send the credentials in the Authorization header with HTTP Basic authentication (recommended), or as the client_id and client_secret form fields. Use one method or the other, not both. The access token expires after 15 minutes and carries the scopes configured for your OAuth application. Include it in the Authorization header of Users API requests as Bearer <access_token>. Refresh tokens aren’t issued, so request a new access token when the current one expires. Learn how to encode your client credentials, and review the rate limits that apply to the OAuth API endpoints.

Authorizations

Authorization
string
header
required

HTTP Basic authentication with the OAuth application's client credentials: the client ID as the username and the client secret as the password, joined with a colon and base64-encoded (Authorization: Basic <base64(client_id:client_secret)>). Tools such as curl encode the credentials for you when you pass them with --user "<client_id>:<client_secret>". Alternatively, send the credentials as the client_id and client_secret form fields in the request body. Don't use both methods in the same request.

Body

application/x-www-form-urlencoded
grant_type
enum<string>
required

The OAuth 2.0 grant type. Must be client_credentials.

Available options:
client_credentials
client_id
string

The client ID of the OAuth application. Use together with client_secret as an alternative to HTTP Basic authentication.

Example:

"H3WVOKGN4B7JXQYCQ6DJFAW5ZU"

client_secret
string

The client secret of the OAuth application. Use together with client_id as an alternative to HTTP Basic authentication.

Response

An access token for the OAuth application.

access_token
string
required

The opaque access token. Include it in the Authorization header of Users API requests as Bearer <access_token>. Access tokens begin with op_o_c_.

token_type
string
required

The token type. Always Bearer.

Example:

"Bearer"

expires_in
integer
required

The lifetime of the access token in seconds. Access tokens expire after 15 minutes (900 seconds).

Example:

900

scope
string

The scopes granted to the access token, separated by spaces. These are the scopes configured for the OAuth application, for example users.view, users.suspend, and users.reactivate.

Example:

"users.view users.suspend users.reactivate"