Docs AI SyncDocs AI Sync

Authorization

Generate Token

POSThttps://app.aisync.link/oauth/token

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.

codestringpathrequired

The authorization code received from the authorize endpoint

client_idstringpathrequired

Your OAuth client ID

client_secretstringpathrequired

Your OAuth client secret (keep this secure!)

grant_typestringpathrequired

Must be set to authorization_code for this flow

redirect_uristringpathrequired

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_tokenstring

The access token to use for API requests. Include this in the Authorization header as Bearer {access_token}.

refresh_tokenstring

Token used to obtain a new access token when it expires. Store this securely.

token_typestring

The type of token, typically Bearer

expires_ininteger

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.