Create a claim socket ticket
POST
/providers/mobile/claim/ticket
const url = 'https://api.clearance.rest/numbers/providers/mobile/claim/ticket';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"label":"agency-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.clearance.rest/numbers/providers/mobile/claim/ticket \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "label": "agency-1" }'Creates a single-use ticket that lets a browser open the claim socket. A browser WebSocket cannot send custom headers, and your API key must never reach the browser, so call this from your backend and hand only the ticketed socket URL to the browser.
A ticket starts with cst_, is tied to your project, is valid for 60 seconds, and is consumed by the first connection attempt.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
label
Your own note, written onto every QR token the session produces.
string
Example
{ "label": "agency-1"}Responses
Section titled “Responses”The ticket.
Media typeapplication/json
object
success
required
boolean
ticket
required
string
expires_at
required
integer
ttl_ms
required
integer
Example
{ "success": true, "ticket": "cst_3f9a…", "expires_at": 1700000060000, "ttl_ms": 60000}The X-API-Key header is missing or invalid.
Media typeapplication/json
Error envelope returned with a non-2xx status.
object
success
required
boolean
error
required
Human-readable error message.
string
Example
{ "success": false, "error": "geçersiz API anahtarı"}