Atmee.aiDocs
APIAPI referenceSession

End a conversation session

POST
/v1/sessions/{session_id}/end

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 completed with endReason: ended_by_api, billed only for the time both the visitor and the avatar were in the room. Idempotent: ending one that already ended answers 200 with alreadyEnded: true (AvatarSessionEndResponse). Read its state and cost with GET /v1/sessions/{id}.
  • Signed-in user — a website session of the user's account. Ending one that already ended answers 409 (ForceEndSessionResponse on success).

With both credentials, the API key's end applies.

Authorization

headerX-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_....

Path Parameters

session_id*string

Session ID to forcefully end

Formatuuid

Response Body

The session is ended (API key: or already was, alreadyEnded).

application/json
  1. response
sessionId*string
Formatuuid
status*string
Value in"completed""failed"
endedAt?string
Formatdate-time
alreadyEnded*boolean

True when the session was already terminal before this call.

endReason?string

Why the session ended: ended_by_api for this call, or the earlier reason when it had already ended (see AvatarSessionStatusResponse.endReason).

Example Request
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"}
End a conversation session — Atmee Docs