Skip to main content
POST
End a browser session nobody has opened
Requires calls:create, the permission that minted the session. A browser session minted with POST /calls {"type":"web"} is a call from the moment the mint answers, waiting as status: "pending_connection" until a browser opens it. If you know nobody will (the visitor closed the page, your test is over), end it here instead of waiting for its token to expire:
The call is final at once: GET /calls/{id} reads status: "no_answer", ended_by: "operator", disconnect_reason: "Ended by operator" and cost_cents: 0, and a browser that later tries the session’s token is turned away. It takes no body. It is your end, not a failure. The call has no failure member and its timeline no failed phase: ended_by and disconnect_reason already say why it stopped. ended_at is when you ended it. A call_request session has no call to end until its request starts (call_id: null). Discard its token with the cancel_url the mint returned instead — see Discarding a session nobody will use. That URL takes the token rather than your key, so the page you handed the token to can call it too. It is not a hang-up. Only a session no browser has opened can be ended. A call a browser has opened, a phone call, or a call that has already settled is refused with 409 CALL_NOT_PENDING, whose status names the state the call is in, and nothing changes.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Response

The session was ended.

id
string<uuid>
required
status
enum<string>
required
Available options:
no_answer
ended_at
string<date-time>
required
ended_by
enum<string>
required
Available options:
operator