Skip to main content
POST
/
oauth
/
token
Generate Token
curl --request POST \
  --url https://app.aisync.link/oauth/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'code=<string>' \
  --data 'client_id=<string>' \
  --data 'client_secret=<string>' \
  --data grant_type=authorization_code \
  --data 'redirect_uri=<string>'
{
  "access_token": "<string>",
  "refresh_token": "<string>",
  "token_type": "Bearer",
  "expires_in": 123
}

Generate Token

Exchange the authorization code for an access token and refresh token. This endpoint is used after receiving the authorization code from the authorize endpoint.
code
string
required
The authorization code received from the authorize endpoint
client_id
string
required
Your OAuth client ID
client_secret
string
required
Your OAuth client secret (keep this secure!)
grant_type
string
required
Must be set to authorization_code for this flow
redirect_uri
string
required
The same redirect URI used in the authorization request
curl --location 'https://app.aisync.link/oauth/token' \
  --form 'code="{{code}}"' \
  --form 'client_id="{{client_id}}"' \
  --form 'client_secret="{{client_secret}}"' \
  --form 'grant_type="authorization_code"' \
  --form 'redirect_uri="{{redirect_uri}}"'
access_token
string
The access token to use for API requests. Include this in the Authorization header as Bearer {access_token}.
refresh_token
string
Token used to obtain a new access token when it expires. Store this securely.
token_type
string
The type of token, typically Bearer
expires_in
integer
The number of seconds until the access token expires
Store your refresh token securely. You’ll need it to get new access tokens without requiring user re-authorization.

Body

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

The authorization code received from the authorize endpoint

client_id
string
required

Your OAuth client ID

client_secret
string<password>
required

Your OAuth client secret

grant_type
enum<string>
default:authorization_code
required

Must be set to 'authorization_code' for this flow

Available options:
authorization_code
redirect_uri
string<uri>
required

The same redirect URI used in the authorization request

Response

Token response

access_token
string
required

The access token to use for API requests

token_type
string
default:Bearer
required

The type of token, typically 'Bearer'

expires_in
integer
required

The number of seconds until the access token expires

refresh_token
string

Token used to obtain a new access token when it expires