Skip to main content
POST
/
oauth
/
token
cURL
curl --request POST \
  --url https://api.buildpass.global/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "scope": "read:builders read:subcontractors read:prequalifications read:insurances",
  "audience": "https://api.buildpass.global",
  "grant_type": "client_credentials"
}'
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "expires": 3600,
  "scope": "read:builders read:subcontractors"
}

Body

Client credentials to obtain OAuth token

scope
string
required

The scopes you want to request access to. Available: read:builders, read:subcontractors, read:prequalifications, read:insurances, read:swms, read:timesheets, read:contacts.

Example:

"read:builders read:subcontractors read:prequalifications read:insurances"

audience
enum<string>
required

The audience for the token (resource server identifier).

Available options:
https://api.buildpass.global
Example:

"https://api.buildpass.global"

grant_type
enum<string>
required

The grant type you want to use. Currently only client_credentials is supported.

Available options:
client_credentials
Example:

"client_credentials"

client_id
string

Your client ID. Can be provided in request body or via HTTP Basic Authentication.

Example:

"your_client_id"

client_secret
string

Your client secret. Can be provided in request body or via HTTP Basic Authentication.

Example:

"your_client_secret"

Response

Token response

access_token
string
required

The access token that can be used in the Authorization header to access the API.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

token_type
string
required

The type of token that was issued.

Example:

"Bearer"

expires_in
integer
required

The number of seconds until the token expires.

Example:

3600

expires
integer

The number of seconds until the token expires. Deprecated, use expires_in instead.

Example:

3600

scope
string

The scopes that were granted for this token.

Example:

"read:builders read:subcontractors"

I