Create a ticket for the claim socket
POST
/numbers/device/claim/ticket
const url = 'https://api.clearance.rest/numbers/device/claim/ticket';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"label":"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://api.clearance.rest/numbers/device/claim/ticket \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "label": "example" }'Browsers cannot send headers on a WebSocket and the API key must not reach the browser: a backend gets a single-use, 60-second ticket with its key and hands it to the browser.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
label
string
Examplegenerated
{ "label": "example"}Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
success
required
boolean
mobile_claim_ticket
required
string
expires_at
required
number
ttl_ms
required
number
apk_url
required
string
Example
{ "success": true}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}