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

# Enviar Imagem

> Enviar mensagem de imagem

## Tipos de arquivos suportados

* **JPEG** (.jpeg) - até 5 MB \

* **PNG** (.png) - até 5 MB

### Authorization

**api\_key** `string` *required*

Chave de autenticação da sua conexão, utilizada no header Authorization como
**Bearer** Token. \\

Você encontra sua API Key no botão **API** da sua conexão no painel ZapClass. \\

A chave sempre começa com o prefixo `zc_`. \\

Exemplo: `zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP`

### Body Parameters

**number** `string` *required*

Número do destinatário no formato internacional. \\

Deve incluir código do país DDI + DDD + número. \\

Exemplo: `5511999999999`

**file** `string` *required*

URL ou Base64da do arquivo enviado. \\

Exemplo: `https://placehold.co/600x400.png`

**message** `string`

Conteúdo da mensagem de texto a ser enviada. \\

Suporta texto simples, emojis e caracteres especiais. \\

Exemplo: `Olá! Bem-vindo à nossa plataforma ZapClass`

**delay** `integer`

Atraso em milissegundos antes do envio (agendamento). \\

Útil para envios programados ou intervalos entre mensagens. \\

Aparecerá "Digitando..." antes do envio. \\

Exemplo: `3000`

**forward** `boolean`

Marca a mensagem como encaminhada para o destinatário. \\

Exemplo: `true`

**message\_reply\_id** `string`

Identificador da mensagem para responder. \\

Exemplo: `5511999999999:1AB2C3DEFG4H56I78JKL9M`

**message\_source** `string`

Origem do envio da mensagem. \\

Normalmente usado para rastreamento da mensagem. \\

Exemplo: `typebot`

**message\_id** `string`

Identificador do envio da mensagem. \\

Combinado com o `message_source` pode ser usado para rastreamento. \\

Exemplo: `5511999999999:1AB2C3DEFG4H56I78JKL9M`

**mentions** `string`

Relação de números de telefone a serem mencionados na mensagem. \\

O números devem ser separads por vírgula. \\

Exemplo: `5511999999999,5511888888888`

**read** `boolean`

Marca a conversa como lida após o envio. \\

Exemplo: `true`

**read\_messages** `boolean`

Marca as últimas mensagens como lidas após o envio. \\

Exemplo: `true`

```bash cURL theme={null}
curl -X POST https://zapclass.com.br/api/messages/image \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP" \
  -d '{
    "number": "5511999999999",
    "file": "https://placehold.co/600x400.png",
    "message": "Veja essa imagem aqui",
    "delay": 3000,
    "forward": true,
    "message_repy_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    "message_source": "typebot",
    "message_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    "mentions": "5511999999999,5511888888888",
    "read": true,
    "read_messages": true
  }'
```

```javascript JavaScript theme={null}
const response = await fetch("https://zapclass.com.br/api/messages/image", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP",
  },
  body: JSON.stringify({
    number: "5511999999999",
    file: "https://placehold.co/600x400.png",
    message: "Veja essa imagem aqui",
    delay: 3000,
    forward: true,
    message_repy_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    message_source: "typebot",
    message_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    mentions: "5511999999999,5511888888888",
    read: true,
    read_messages: true,
  }),
});
```

```php PHP theme={null}
<?php
$ch = curl_init('https://zapclass.com.br/api/messages/image');

$payload = [
    "number" => "5511999999999",
    "file" => "https://placehold.co/600x400.png",
    "message" => "Veja essa imagem aqui",
    "delay" => 3000,
    "forward" => true,
    "message_repy_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    "message_source" => "typebot",
    "message_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
    "mentions" => "5511999999999,5511888888888",
    "read" => true,
    "read_messages" => true
];

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_exec($ch);
curl_close($ch);
?>
```

```json 200 theme={null}
{
  "success": true,
  "id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
  "chat_id": "5511999999999@s.whatsapp.net"
}
```

```json 400 theme={null}
{
  "success": false,
  "message": "Token de autenticação inválido"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.