Skip to main content
POST
/
v1
/
oauth
/
token
Exchange an authorization code or refresh token
curl --request POST \
  --url https://api.leanrails.com/v1/oauth/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "grant_type": "authorization_code",
  "code": "<string>",
  "redirect_uri": "<string>",
  "refresh_token": "<string>",
  "client_id": "<string>",
  "client_secret": "<string>"
}
'
{
  "access_token": "<string>",
  "token_type": "bearer",
  "expires_in": 123,
  "refresh_token": "<string>",
  "scope": "<string>",
  "merchant_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.fluveo.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use your secret API key as the username with an empty password.

Headers

X-API-Version
string

Override the API version for this request.

Body

application/json
grant_type
enum<string>
required

The type of grant.

Available options:
authorization_code,
refresh_token
code
string

Authorization code (required for authorization_code grant).

redirect_uri
string<uri>

The redirect URI used in the authorization request.

refresh_token
string

Refresh token (required for refresh_token grant).

client_id
string

OAuth client ID (if not using Basic auth).

client_secret
string

OAuth client secret (if not using Basic auth).

Response

Token response.

access_token
string
required
token_type
enum<string>
required
Available options:
bearer
expires_in
integer
required

Token lifetime in seconds.

refresh_token
string

Refresh token for obtaining new access tokens.

scope
string

Space-separated list of granted scopes.

merchant_id
string

The merchant who authorized the app.