> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Sticker

> Send a sticker from an image URL (PNG/JPEG/GIF) with automatic conversion to WebP 512×512

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no

## Description

Sends a sticker (`sticker`) from an `imageUrl`. The server downloads the image (PNG, JPEG or GIF) and **automatically converts** it to the format expected by WhatsApp: **WebP, 512×512**, with the background preserved when applicable. Supports `replyTo`, `replyPrivate`, `delay` (in seconds) and `source` for traceability.

## Examples

### Minimum (public URL)

Sends a sticker pointing only to a public image URL (PNG/JPEG/GIF). The server downloads it and automatically converts to WebP 512×512 before delivering.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/sticker/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":   "5511999999999",
      "imageUrl": "https://example.com/sticker.png"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/sticker/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:   "5511999999999",
      imageUrl: "https://example.com/sticker.png"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/sticker/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":   "5511999999999",
          "imageUrl": "https://example.com/sticker.png"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":   "5511999999999",
          "imageUrl": "https://example.com/sticker.png"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/sticker/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### From base64 (data URL)

`imageUrl` accepts a `data:` URL with inline base64. The server decodes it and follows the same conversion flow to WebP 512×512.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/sticker/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":   "5511999999999",
      "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/sticker/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:   "5511999999999",
      imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/sticker/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":   "5511999999999",
          "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":   "5511999999999",
          "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/sticker/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### As a reply to a message

Sends the sticker quoting a previous message via `replyTo`. Typical combination for visual reactions ("reaction stickers") in direct response to something said earlier in the conversation.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/sticker/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":   "5511999999999",
      "imageUrl": "https://example.com/reaction.png",
      "replyTo":  "3EB08FCF27E532F1B0F5"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/sticker/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:   "5511999999999",
      imageUrl: "https://example.com/reaction.png",
      replyTo:  "3EB08FCF27E532F1B0F5"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/sticker/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":   "5511999999999",
          "imageUrl": "https://example.com/reaction.png",
          "replyTo":  "3EB08FCF27E532F1B0F5"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":   "5511999999999",
          "imageUrl": "https://example.com/reaction.png",
          "replyTo":  "3EB08FCF27E532F1B0F5"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/sticker/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The `messageType` is always `sticker` and `mediaMimeType` is fixed at `image/webp` (the original image was converted by the server). There is no `content` in the payload, stickers do not carry a caption.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Sticker sent successfully",
  "status":  "sent",
  "data": {
    "messageId":     "3EB08FCF27E532F1B0F5",
    "direction":     "sent",
    "messageType":   "sticker",
    "source":        "api",
    "timestamp":     "2026-04-30T14:30:00Z",
    "chat": {
      "jid":     "5511999999999@s.whatsapp.net",
      "isGroup": false
    },
    "sender": {
      "jid":      "5511777777777@s.whatsapp.net",
      "instance": "minha-instancia"
    }
  }
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name (e.g., `$Instance_Name`).
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="number" type="string" required>
  Destination: phone (`5511999999999`) or JID (`@s.whatsapp.net`, `@lid`, `@g.us`, `@newsletter`).
</ParamField>

<ParamField body="imageUrl" type="string" required>
  Public URL of the image (PNG, JPEG or GIF) **or** a `data:` URL with inline base64. The server downloads/decodes it and automatically converts to WebP 512×512.
</ParamField>

<ParamField body="delay" type="int" default="0">
  Time in **seconds** to wait before sending. During the interval, the server sends the "typing..." indicator to the recipient and fires "paused" before the actual send.
</ParamField>

<ParamField body="replyTo" type="string">
  ID of the message to be quoted (reply). The original message must belong to the same instance and have been saved in the database.
</ParamField>

<ParamField body="replyPrivate" type="boolean" default="false">
  When `true` **and** `replyTo` points to a message originating from a group, the reply is redirected to the original author's **private** chat (keeping the quote). Ignored if the original message is not from a group.
</ParamField>

<ParamField body="source" type="string" default="api">
  Origin identifier for traceability (e.g., `crm`, `bot-suporte`, `n8n`). Saved on the message record in the database and propagated to webhooks. When omitted, defaults to `"api"`.
</ParamField>

## Notes

<Note>
  * **`delay` is in seconds**, not milliseconds.
  * The server **automatically converts** PNG/JPEG/GIF to **WebP 512×512** before sending. There is no need to send a pre-formatted WebP.
  * Animated GIFs are accepted, but the animation may only be partially preserved depending on the encoder; for reliable animated stickers, send an animated WebP already in the correct format via `imageUrl`.
  * Stickers **do not support mentions** or `mentionAll` (a WhatsApp limitation for sticker-type messages).
  * The `imageUrl` must be publicly accessible, or a base64 `data:` URL.
  * For BR numbers (starting with `55`), the service automatically tries variations with and without the 9th digit.
</Note>

## Errors

| HTTP | Internal status           | Message                                             |
| ---- | ------------------------- | --------------------------------------------------- |
| 400  | ,                         | `Instance name is required`                         |
| 400  | ,                         | `Invalid request body: <detail>`                    |
| 400  | ,                         | `Number is required`                                |
| 400  | ,                         | `ImageURL is required`                              |
| 400  | `invalid_number`          | `Invalid phone number format: <detail>`             |
| 400  | `image_download_failed`   | `Failed to download image: <reason>`                |
| 500  | `image_conversion_failed` | `Failed to convert image to sticker (WebP 512x512)` |
| 500  | `sticker_upload_failed`   | `Failed to upload sticker to WhatsApp servers`      |
| 500  | `send_failed`             | `Failed to send message: <reason>`                  |
| 404  | ,                         | `Instance not found`                                |
| 503  | `disconnected`            | `Instance is not connected to WhatsApp`             |

Error envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "ImageURL is required" }
}
```
