End a conversation session
POST
Ends a session started with POST /v1/sessions now: the room
closes and the avatar leaves. End it with the credential that
started it:
- API key — a session your backend started. Billing stops; the
session settles
completedwithendReason: ended_by_api, billed only for the time both the visitor and the avatar were in the room. Idempotent: ending one that already ended answers200withalreadyEnded: true(AvatarSessionEndResponse). Read its state and cost withGET /v1/sessions/{id}. - Signed-in user — a website session of the user's account.
Ending one that already ended answers
409(ForceEndSessionResponseon success).
With both credentials, the API key's end applies.
header
X-Api-Key<token>Secret embed API key (sk_atmee_...; keys minted before 2026-09
carry sk_live_...), held by the customer's own backend and never
sent to a browser. Format: X-Api-Key: sk_atmee_....
session_id*stringSession ID to forcefully end
Format
uuidThe session is ended (API key: or already was, alreadyEnded).
application/json- response
sessionId*stringFormat
uuidstatus*stringValue in
"completed""failed"endedAt?stringFormat
date-timealreadyEnded*booleanTrue when the session was already terminal before this call.
endReason?stringWhy the session ended: ended_by_api for this call, or the
earlier reason when it had already ended (see
AvatarSessionStatusResponse.endReason).
curl -X POST 'https://api.atmanity.us/v1/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/end'Example Response
{ "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459", "status": "completed", "endedAt": "2019-08-24T14:15:22Z", "alreadyEnded": true, "endReason": "string"}
