End a conversation with Rosie
POST
/public/assistant/sessions/{id}/end
const url = 'https://example.com/public/assistant/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/end';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"closed"}'};
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://example.com/public/assistant/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/end \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "closed" }'With closed (the default), no more messages after this; the conversation can still be read and emailed. The website sends interest_registered when the register interest form went in from the chat: that is recorded and the conversation carries on.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Body
Section titled “Request Body”Media typeapplication/json
object
reason
string
Responses
Section titled “Responses”Ended
Missing, wrong or expired session token
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Rosie is not set up here
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}