Skip to main content
POST
/
oauth2
/
token
OAuth 2.0 token
curl --request POST \
  --url https://account.sendcloud.com/oauth2/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'grant_type=<string>' \
  --data 'client_id=<string>' \
  --data 'code=<string>' \
  --data 'redirect_uri=<string>' \
  --data 'refresh_token=<string>'
{
  "access_token": "<string>",
  "expires_in": 123,
  "id_token": "<string>",
  "refresh_token": "<string>",
  "scope": "<string>",
  "token_type": "<string>"
}
OAuth 2.0 authentication is currently available as a beta feature for a limited number of clients. Following this beta phase, we are planning a gradual rollout of the OAuth2 authentication feature to all users. Our aim is to ensure a smooth transition and to continue providing an optimal user experience throughout the process.
You can find a list of open-source libraries to help with OAuth 2.0 authentication at https://oauth.net/code/

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/x-www-form-urlencoded
grant_type
string
required
client_id
string
code
string
redirect_uri
string
refresh_token
string

Response

OAuth2TokenExchange

OAuth2 Token Exchange Result

access_token
string

The access token issued by the authorization server.

expires_in
integer<int64>

The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.

id_token
string

To retrieve a refresh token request the id_token scope.

refresh_token
string

The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope "offline" to your access token request.

scope
string

The scope of the access token

token_type
string

The type of the token issued