Skip to content

Start agent sign-up (device authorization)

POST
/v1/agent/device/code
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.

Media typeapplication/json
object
client_name

Shown to the person: a short plain name, no links or email addresses (at most 60 characters are kept).

string
<= 200 characters
client_id

Alias of client_name.

string
<= 200 characters
requested_scopes

Subset of checks:create, account:read, billing:checkout. Default: checks:create, account:read.

Array<string>
<= 10 items
scope

Space-separated alias of requested_scopes.

string
<= 200 characters
requested_monthly_cap_usd

A suggested monthly cap on this key’s billed usage, in US dollars. The person decides.

number
<= 1000000

Example generated

{
"client_name": "example",
"client_id": "example",
"requested_scopes": [
"example"
],
"scope": "example",
"requested_monthly_cap_usd": 1
}

OK

Media typeapplication/json
object
device_code
required

The agent’s secret for polling the token endpoint. Never show it to anyone.

string
user_code
required

Show this to the person, e.g. BCDF-GHJK.

string
verification_uri
required

Where the person approves: the dashboard’s /device page.

string
verification_uri_complete
required

The same page with the code filled in. Show or open this.

string
expires_in
required

Seconds until the request expires.

number
interval
required

Seconds to wait between polls.

number

Example generated

{
"device_code": "example",
"user_code": "example",
"verification_uri": "example",
"verification_uri_complete": "example",
"expires_in": 1,
"interval": 1
}