> ## 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.

# Send message to end user

> Send text and multimedia messages to the end user from the external provider

<Warning>
  The `X-Jelou-Signature` header is required.
</Warning>

## Description

Sends a message to the end user through Jelou. The client executes this resource to notify Jelou that it must deliver a message to the end user active in the conversation.

Jelou will validate the request signature, process the content, and deliver it to the user through the configured channel (for example, WhatsApp).

## Endpoint

```
POST https://chatbot.jelou.ai/v1/external-support/webhook
```

## Body parameters

<ParamField body="field" type="string" required>
  Event field type. Fixed value: `messages`.
</ParamField>

<ParamField body="object" type="string" required>
  Event object type. Fixed value: `message_event`.
</ParamField>

<ParamField body="event_type" type="string" required>
  Event type. Fixed value: `incoming_message`.
</ParamField>

<ParamField body="project_id" type="string" required>
  Identifier of the Jelou project the conversation belongs to.
</ParamField>

<ParamField body="room_id" type="string" required>
  Identifier of the active conversation room.
</ParamField>

<ParamField body="bot_id" type="string" required>
  Identifier of the Jelou bot associated with the conversation.
</ParamField>

<ParamField body="user_id" type="string" required>
  Identifier of the end user who will receive the message.
</ParamField>

<ParamField body="value" type="object" required>
  Content of the message to deliver to the end user.

  * `id` — Unique message identifier.
  * `type` — Message type: `text`, `image`, `video`, `audio`, `document`.
  * `content` — Object with the content according to the type (see the message types table at the bottom of this page).
</ParamField>

## Authentication

This resource validates the `X-Jelou-Signature` header using HMAC-SHA256. Basic Auth is not used for this endpoint.

## Request example

The following example sends a text message to the end user through Jelou:

```bash cURL theme={null}
curl --request POST \
  --url https://chatbot.jelou.ai/v1/external-support/webhook \
  --header 'Content-Type: application/json' \
  --header 'X-Jelou-Signature: sha256=HMAC_SIGNATURE' \
  --data '{
    "field": "messages",
    "object": "message_event",
    "event_type": "incoming_message",
    "project_id": "PROJECT_ID",
    "room_id": "ROOM_ID",
    "bot_id": "BOT_ID",
    "user_id": "USER_ID",
    "value": {
      "id": "MESSAGE_ID",
      "type": "text",
      "content": {
        "body": "Hello user, how can I help you?"
      }
    }
  }'
```

## Responses

| Code | Status                | Description                              |
| ---- | --------------------- | ---------------------------------------- |
| 200  | OK                    | Message received and processed by Jelou. |
| 500  | Internal Server Error | Internal server error.                   |

## Supported message types

| Type       | `value.content` field                              | Additional fields     |
| ---------- | -------------------------------------------------- | --------------------- |
| `text`     | `{ "body": "Message text" }`                       | —                     |
| `image`    | `{ "url": "...", "mime_type": "image/jpeg" }`      | `caption` (optional)  |
| `video`    | `{ "url": "...", "mime_type": "video/mp4" }`       | `caption` (optional)  |
| `audio`    | `{ "url": "...", "mime_type": "audio/mpeg" }`      | —                     |
| `document` | `{ "url": "...", "mime_type": "application/pdf" }` | `filename` (optional) |

<Note>
  Multimedia file URLs must be accessible via HTTPS.
</Note>
