Skip to main content
POST
/
v1
/
external-support
/
{projectId}
/
conversations
/
close
Close Conversation
curl --request POST \
  --url https://gateway.jelou.ai/jelouapi/v1/external-support/{projectId}/conversations/close \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "botId": "<string>",
  "userId": "<string>",
  "redirectPayload": {
    "type": "<string>",
    "text": "<string>"
  }
}
'
{
  "message": "<string>",
  "statusMessage": "<string>",
  "status": 123,
  "error": {
    "code": "<string>",
    "key": "<string>",
    "description": "<string>",
    "developerMessages": {},
    "clientMessages": {}
  },
  "validationError": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt

Use this file to discover all available pages before exploring further.

Description

Closes an active conversation in the external support panel. Allows specifying a closing message to send to the user and the reason for closing. Upon execution, Jelou emits the conversation.close event to the webhook configured in the integration.

Endpoint

POST https://gateway.jelou.ai/jelouapi/v1/external-support/{projectId}/conversations/close

Path parameters

projectId
string
required
Unique identifier of the Jelou project from which the conversation is closed.

Body parameters

botId
string
required
Identifier of the Jelou bot associated with the conversation.
userId
string
required
Identifier of the end user whose conversation you want to close.
redirectPayload
object
Message to be sent to the user at the time of closing the conversation.
  • type — Message type: text or edge.
  • text — Text of the closing message (when type is text).

Authentication

All requests must include the x-api-key header with your Jelou project API key.
x-api-key: API_KEY

Request example

The following example closes the conversation for user USER_ID and includes a closing message:
cURL
curl --request POST \
  --url https://gateway.jelou.ai/jelouapi/v1/external-support/PROJECT_ID/conversations/close \
  --header 'x-api-key: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "botId": "BOT_ID",
    "userId": "USER_ID",
    "redirectPayload": {
      "type": "text",
      "text": "Conversation closing message"
    }
  }'

Responses

CodeStatusDescription
200OKConversation closed successfully.
401UnauthorizedInvalid or missing authentication credentials.
404Not FoundBot or user not found.
422Unprocessable EntityFields sent contain invalid values or fail validations.
500Internal Server ErrorInternal server error.

Response example

{
  "message": [
    "Conversation closed successfully"
  ],
  "statusMessage": "success",
  "status": 1,
  "data": {
    "conversationId": "CONVERSATION_ID",
    "status": "closed",
    "endedReason": "closed_by_operator"
  }
}

Webhook event conversation.close

When this resource is executed, Jelou will emit the conversation.close event to the webhook configured in the integration. The payload includes the close reason and the message sent to the user.
{
  "event": "conversation.close",
  "timestamp": 1777992928697,
  "field": "conversation",
  "object": "conversation_event",
  "event_type": "close",
  "project_id": "PROJECT_ID",
  "room_id": "ROOM_ID",
  "contact": {
    "id": "USER_ID",
    "name": "USER_NAME"
  },
  "conversation": {
    "id": "CONVERSATION_ID"
  },
  "bot": {
    "id": "BOT_ID",
    "name": "BOT_NAME"
  },
  "value": {
    "reason": "closed_by_operator",
    "redirectPayload": {
      "type": "text",
      "text": "Conversation closing message"
    }
  }
}

Payload fields

FieldTypeDescription
eventstringEvent name: conversation.close
timestampnumberUnix timestamp in milliseconds at the time of the event.
project_idstringJelou project identifier.
room_idstringConversation room identifier.
contact.idstringEnd user identifier.
contact.namestringEnd user name.
conversation.idstringUnique identifier of the closed conversation.
bot.idstringAssociated bot identifier.
bot.namestringAssociated bot name.
value.reasonstringClose reason: closed_by_operator.
value.redirectPayload.typestringClosing message type: text or edge.
value.redirectPayload.textstringText of the message sent to the user upon closing (optional).

Authorizations

Authorization
string
header
required

Basic authentication using Base64 encoded clientId:clientSecret

Path Parameters

projectId
string
required

Unique identifier of the Jelou project

Body

application/json
botId
string
required
userId
string
required
redirectPayload
object

Response

Conversation closed successfully