OAuth2

Issue tokens

Issue access tokens using various grant types:

  • client_credentials: Exchange client credentials for an access token
  • urn:ietf:params:oauth:grant-type:jwt-bearer: Exchange JWT assertion (Keycloak for brokerdash or Google for admin)
  • refresh_token: Refresh an admin access token using a refresh token
post/oauth2/token

Request

  • Base URL
    https://authx.giftcity.in.alpaca.markets/v1
  • URL
    https://authx.giftcity.in.alpaca.markets/v1/oauth2/token
  • Auth
    none required

Request body application/x-www-form-urlencoded

client_assertionstring

Client assertion JWT (if using private_key_jwt)

client_assertion_type'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'

Client assertion type (if using private_key_jwt)

client_idstring

Client ID

client_secretstring

Client secret (if using client_secret)

grant_type'client_credentials' | 'urn:ietf:params:oauth:grant-type:jwt-bearer' | 'refresh_token' required

Grant type

Example request

{
  "client_id": "AKSF5FVOKXYKG4ATGCJQBA",
  "client_secret": "MFRGGZDFMZTWQYLCMNSGKZTHNBQWEY3EMVTGO2DBMJRWIZLGM5UGCYTDMRSWMZ3I"
}

Response

OK

access_tokenstring required

Access token

expires_ininteger required

Time in seconds until the token expires

refresh_tokenstring

Refresh token

token_type'Bearer' required

Type of the token (e.g., Bearer)

Example response

{
  "expires_in": 900
}

Changes

No recorded changes to this operation across all 1 revision of this API.