End a session
POST
Ends a session started with POST /v1/sessions now: the room closes and
the avatar leaves. Use the credential that started it; with both, the
API key applies.
- API key: billing stops and the session settles
completedwithendReason: ended_by_api, billed only for the time both the visitor and the avatar were in the room. Idempotent: a session that already ended answers200withalreadyEnded: true. - Signed-in user: ends a website session of the user's account. A
session that already ended is
409.
header
X-Api-Key<token>Your secret API key (sk_atmee_...; older keys start sk_live_),
sent as X-Api-Key. Keep it on your server and never send it to a
browser.
session_id*stringThe session to 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"}
