Skip to main content
POST
/
v0
/
auth
/
token
Get an Access Token
curl --request POST \
  --url https://api.sandbox.getasset.com/v0/auth/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'client_id=<string>' \
  --data 'client_secret=The oauth client secret' \
  --data grant_type=client_credentials \
  --data business_id=biz_GA6EG2qFxA97NZHtxeLPUy \
  --data expires_in=3600 \
  --data 'scope=<string>' \
  --data resource=https://api.example.com
{
  "access_token": "<string>",
  "expires_in": 123,
  "token_type": "Bearer"
}

Body

application/x-www-form-urlencoded
client_id
string
required

The oauth client id

client_secret
string
default:The oauth client secret
grant_type
enum<string>
default:client_credentials

The grant type. Defaults to client_credentials

Available options:
client_credentials
business_id
string | null

Scope the access token to a specific business

Example:

"biz_GA6EG2qFxA97NZHtxeLPUy"

expires_in
integer
default:3600

Access token expiration time in seconds

scope
string | null

Space-separated list of requested scopes, e.g. 'ledger:read invoice:create'

resource
string[] | null

RFC 8707 resource indicator(s) identifying the protected resource(s) where the token is intended to be used. Sets the JWT aud claim. Each value must be an absolute URI with no fragment. May be repeated. Defaults to the current host.

Example:
["https://api.example.com"]

Response

Successful Response

access_token
string
required

The access token

expires_in
integer
required

The token expiration time as a unix timestamp (seconds)

Example:

1777657168

token_type
string
default:Bearer

The token type