Skip to main content
POST
/
connect
/
token
Request an access token
curl --request POST \
  --url https://app.trelica.com/connect/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'scope=<string>' \
  --data 'code=<string>' \
  --data 'redirect_uri=<string>' \
  --data 'refresh_token=<string>'
{
  "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "Users.Read offline_access",
  "refresh_token": "8xLOxBtZp8..."
}

Authorizations

Authorization
string
header
required

HTTP Basic authentication: the client ID and client secret, joined with a colon and Base64-encoded (RFC 7617).

Body

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

The OAuth 2.0 grant type.

Available options:
client_credentials,
authorization_code,
refresh_token
scope
string

Space-separated scopes to request. Defaults to all scopes configured for the app.

code
string

The authorization code (Authorization Code flow).

redirect_uri
string

Must match the redirect URI from the authorization request (Authorization Code flow).

refresh_token
string

The refresh token (Refresh flow).

Response

The access token.

access_token
string

The access token to send as a bearer token on API requests.

token_type
string

The token type; always Bearer.

expires_in
integer<int32>

The token lifetime in seconds (access tokens expire after ~60 minutes).

scope
string

The space-separated scopes granted.

refresh_token
string

A refresh token (Authorization Code flow only, when offline_access was requested).