End Chat

Ends a chat. Help Scout then creates a conversation from it, and the transcript becomes a single thread on that conversation.

Request

PUT /v2/chats/5a0da3c3-4882-3352-8db9-8fc47e14111f/end HTTP/1.1
Authorization: Bearer oauth_token
Content-Type: application/json

{
  "status": "closed"
}

Path Parameters

/v2/chats/{chatId}/end

Request Body

Name Type Description
status String The status the resulting conversation is filed under: closed, active or pending. Required.

Answer the visitor before you end

Beacon chooses what it tells the visitor from the state of the chat when it ends. End a chat while the visitor’s last message is unanswered and they are shown

Sorry about that — your question has been added to our email queue and we’ll get back to you shortly.

rather than

All done! A copy of this conversation will land in your inbox shortly.

It is the state of the chat that decides this, not who ended it, and an internal note does not count as an answer. The call returns 200 either way, so this is invisible from the API — only the visitor sees the difference.

Either reply before ending, or leave the chat open.

After a chat ends

Writes to an ended chat return 404. The chat remains readable through Get Chat, and endedAt is set.

Response

Every write answers with the chat, in the same shape Get Chat returns — so a caller sees the result of what it just did without a follow-up read.

HTTP/1.1 200 OK
Content-Type: application/hal+json

{
  "id": "5a0da3c3-4882-3352-8db9-8fc47e14111f",
  "beaconId": "ed8e9fe0-acf4-4b44-b1fc-a5bff956e7a8",
  "mailboxId": 2599,
  "createdAt": "2020-07-03T07:03:29.982028Z",
  "assignee": { "id": 4440, "type": "agent", "first": "Jack", "last": "Sprout" },
  "customer": { "id": 498746, "type": "customer", "first": "Vernon", "last": "Bear" },
  "_embedded": {
    "events": [ "..." ]
  },
  "_links": {
    "self": { "href": "..." }
  }
}

The full field reference is on Get Chat.

Errors

Status When
403 The caller cannot use chat, has no name on their profile, or cannot access the chat’s inbox
404 No such chat, the chat belongs to another company, or the chat has already ended
422 status is missing or is not closed, active or pending