# Send sticker

> Send a WebP sticker, static or animated, over WhatsApp.

Send a sticker with `POST /v1/messages` and `type: "sticker"`. Only WhatsApp accepts this type. Fields shared by every type (`to`, `reply_to`, `typing`, `delay_ms`, the 24 h window) are in [Common fields](/en/send/text/#common-fields).

  **cURL**

```bash
curl -X POST https://api.messajo.com/v1/messages \
  -H "Authorization: Bearer $MESSAJO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "connection_id": "con_123",
  "to": "5511999990000",
  "type": "sticker",
  "sticker": {
    "link": "https://cdn.example.com/thumbs-up.webp"
  }
}'
```

  **TypeScript**

```ts
import { Messajo } from "@messajo/sdk";

const messajo = new Messajo({ apiKey: process.env.MESSAJO_API_KEY! });

const message = await messajo.messages.send({
  connection_id: "con_123",
  to: "5511999990000",
  type: "sticker",
  sticker: { link: "https://cdn.example.com/thumbs-up.webp" },
});
console.log(message.id, message.status);
```

  **n8n**
n8n HTTP Request: POST https://api.messajo.com/v1/messages

```json
{
  "connection_id": "con_123",
  "to": "5511999990000",
  "type": "sticker",
  "sticker": {
    "link": "https://cdn.example.com/thumbs-up.webp"
  }
}
```

The response is `201` with `id` (`msg_…`), `status: "queued"` and `conversation_id`. The final state arrives by webhook.

## Link or upload

Provide **exactly one** of `link` and `media_id`. Sending both, or neither, returns `400 validation_failed` with `exactly one of media_id or link is required`. Stickers have no caption.

- `link`: URL of the `.webp` file.
- `media_id` (`med_…`): comes from `POST /v1/media`, a `multipart/form-data` request with `file` (and `connection_id`, except with a connection key `mjc_…`). Requires the `send` permission. The type is read from the file bytes, not the extension.

  **cURL**

```bash
curl -X POST https://api.messajo.com/v1/media \
  -H "Authorization: Bearer $MESSAJO_API_KEY" \
  -F connection_id=con_123 \
  -F file=@thumbs-up.webp
```

  **TypeScript**

```ts
import { readFile } from "node:fs/promises";

const media = await messajo.media.upload({
  file: new Blob([await readFile("thumbs-up.webp")]),
  connection_id: "con_123",
});

await messajo.messages.send({
  connection_id: "con_123",
  to: "5511999990000",
  type: "sticker",
  sticker: { media_id: media.id },
});
```

The upload returns the media `id` (`med_…`), which you use in `sticker.media_id`.

## Format and size

**WebP** only. The upload detects from the file whether the sticker is animated:

| Type | Max size |
| --- | --- |
| Static | 100 KiB |
| Animated | 500 KiB |

Above the limit, the upload returns `413 media_too_large`.

## Instagram and Messenger

They do not accept stickers: `type: "sticker"` returns `422 type_not_supported_by_channel`.

## Errors

| Code | Status | When |
| --- | --- | --- |
| `validation_failed` | 400 | `link` and `media_id` together, or neither |
| `media_too_large` | 413 | Above 100 KiB (static) or 500 KiB (animated) |
| `media_type_not_supported` | 415 | File is not WebP |
| `media_error` | 422 | Meta could not process the media |
| `type_not_supported_by_channel` | 422 | Instagram or Messenger |
| `outside_service_window` | 422 | Free-form message outside the 24 h window |
