API
Initialize a device-authorization flow (RFC 8628)
POST
/auth/cli/device
const url = 'https://mw.omazy.ai/api/v1/auth/cli/device';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ client_id: 'example', scope: 'example', install_id: 'example', install_name: '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/device \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data client_id=example \ --data scope=example \ --data install_id=example \ --data install_name=exampleReturns user_code + device_code pair. The user enters the user_code at the verification_uri to authorize. The CLI polls /token with the device_code.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
client_id
required
Must be ‘omazy-cli’
string
scope
Space-separated scopes
string
install_id
required
Stable identifier for the machine or integration being authorised
string
install_name
Human-readable label shown in the installs list
string
Examplegenerated
client_id=example&scope=example&install_id=example&install_name=exampleResponses
Section titled “Responses”OK
Media typeapplication/json
object
device_code
string
expires_in
integer
interval
integer
user_code
string
verification_uri
string
verification_uri_complete
string
Examplegenerated
{ "device_code": "example", "expires_in": 1, "interval": 1, "user_code": "example", "verification_uri": "example", "verification_uri_complete": "example"}Bad Request
Media typeapplication/json
object
error
string
error_description
string
Examplegenerated
{ "error": "example", "error_description": "example"}