Start agent sign-up (device authorization)
const url = 'https://api.ringingbytes.com/v1/agent/device/code';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"client_name":"example","client_id":"example","requested_scopes":["example"],"scope":"example","requested_monthly_cap_usd":1}'};
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://api.ringingbytes.com/v1/agent/device/code \ --header 'Content-Type: application/json' \ --data '{ "client_name": "example", "client_id": "example", "requested_scopes": [ "example" ], "scope": "example", "requested_monthly_cap_usd": 1 }'RFC 8628 device authorization request. No authentication. Show the person verification_uri_complete; they approve in the dashboard and choose the permissions and a monthly spending cap. Then poll /v1/agent/device/token. Limits per IP address: 10 requests an hour, 3 waiting at once. Accepts JSON or form encoding; scope (space-separated) and client_id are accepted as the RFC 8628 names of requested_scopes and client_name.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Shown to the person: a short plain name, no links or email addresses (at most 60 characters are kept).
Alias of client_name.
Subset of checks:create, account:read, billing:checkout. Default: checks:create, account:read.
Space-separated alias of requested_scopes.
A suggested monthly cap on this key’s billed usage, in US dollars. The person decides.
Example generated
{ "client_name": "example", "client_id": "example", "requested_scopes": [ "example" ], "scope": "example", "requested_monthly_cap_usd": 1}Responses
Section titled “Responses”OK
object
The agent’s secret for polling the token endpoint. Never show it to anyone.
Show this to the person, e.g. BCDF-GHJK.
Where the person approves: the dashboard’s /device page.
The same page with the code filled in. Show or open this.
Seconds until the request expires.
Seconds to wait between polls.
Example generated
{ "device_code": "example", "user_code": "example", "verification_uri": "example", "verification_uri_complete": "example", "expires_in": 1, "interval": 1}