API
Exchange code / refresh / device-code for tokens
POST
/auth/cli/token
const url = 'https://mw.omazy.ai/api/v1/auth/cli/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ grant_type: 'example', client_id: 'example', code: 'example', code_verifier: 'example', redirect_uri: 'example', refresh_token: 'example', device_code: 'example', install_id: 'example', business_id: 'example' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://mw.omazy.ai/api/v1/auth/cli/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=example \ --data client_id=example \ --data code=example \ --data code_verifier=example \ --data redirect_uri=example \ --data refresh_token=example \ --data device_code=example \ --data install_id=example \ --data business_id=exampleMulti-grant OAuth token endpoint. grant_type accepts authorization_code, refresh_token, urn:ietf:params:oauth:grant-type:device_code, or switch_business.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
grant_type
required
One of authorization_code | refresh_token | urn:ietf:params:oauth:grant-type:device_code | switch_business
string
client_id
required
Must be ‘omazy-cli’
string
code
Auth code (authorization_code grant only)
string
code_verifier
PKCE verifier (authorization_code grant only)
string
redirect_uri
Must match the /authorize call
string
refresh_token
Refresh_token grant only
string
device_code
Device_code grant only
string
install_id
required
Stable per-install identifier
string
business_id
Switch_business grant only
string
Examplegenerated
grant_type=example&client_id=example&code=example&code_verifier=example&redirect_uri=example&refresh_token=example&device_code=example&install_id=example&business_id=exampleResponses
Section titled “Responses”OK
Media typeapplication/json
object
access_token
string
expires_in
integer
install_id
string
refresh_token
string
scope
string
token_type
Always “Bearer”
string
Examplegenerated
{ "access_token": "example", "expires_in": 1, "install_id": "example", "refresh_token": "example", "scope": "example", "token_type": "example"}Bad Request
Media typeapplication/json
object
error
string
error_description
string
Examplegenerated
{ "error": "example", "error_description": "example"}Unauthorized
Media typeapplication/json
object
error
string
error_description
string
Examplegenerated
{ "error": "example", "error_description": "example"}