Create a QR token to connect a device number
POST
/numbers/device/claim/rest
const url = 'https://api.clearance.rest/numbers/device/claim/rest';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"label":"example","preview":"0"}'};
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.clearance.rest/numbers/device/claim/rest \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "label": "example", "preview": "0" }'The token is single-use and valid for 30 seconds; use the claim socket for a QR that refreshes itself. preview=true returns the QR as an SVG image.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Default Response
Default Response
Media typeapplication/json
Error envelope returned by every JSON endpoint.
object
success
required
boolean
error
required
object
code
required
Machine-readable error code (snake_case).
string
message
required
Human-readable message.
string
details
Extra context for the error.
object
key
additional properties
Example
{ "success": false}Default Response
Media typeapplication/json
Error envelope returned by every JSON endpoint.
object
success
required
boolean
error
required
object
code
required
Machine-readable error code (snake_case).
string
message
required
Human-readable message.
string
details
Extra context for the error.
object
key
additional properties
Example
{ "success": false}