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

# Mesaj Gönderme

> Wappfy API üzerinden metin, medya, konum, anket, kişi, tepki ve daha fazlasını gönderin.

# Mesaj G\u00f6nderme

T\u00fcm mesajlar tek bir ucu noktas\u0131 \u00fczerinden g\u00f6nderilir. `type` alan\u0131 ne t\u00fcr bir mesaj g\u00f6nderilece\u011fini belirler ve di\u011fer alanlar buna g\u00f6re de\u011fi\u015fir.

**Ucu Noktas\u0131:**

```
POST https://api.wappfy.io/api/instances/{instanceId}/messages/send
```

**Ba\u015fl\u0131klar:**

| Ba\u015fl\u0131k | De\u011fer                |
| ---------------- | ------------------------- |
| `X-Api-Key`      | API anahtar\u0131n\u0131z |
| `Content-Type`   | `application/json`        |

***

## Metin Mesaj\u0131

D\u00fcz metin mesaj\u0131 g\u00f6nderin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "text",
      "text": "Hello from Wappfy!"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "text",
        text: "Hello from Wappfy!",
      }),
    }
  );

  const result = await response.json();
  console.log(result.data.message_id);
  ```
</CodeGroup>

**Yan\u0131t:**

```json theme={null}
{
  "data": {
    "message_id": "BAE5F2C4D3B2A1",
    "status": "sent"
  }
}
```

***

## G\u00f6rsel Mesaj\u0131

\u0130ste\u011fe ba\u011fl\u0131 bir a\u00e7\u0131klama ile g\u00f6rsel g\u00f6nderin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "image",
      "media_url": "https://example.com/photo.jpg",
      "caption": "Check out this photo!"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "image",
        media_url: "https://example.com/photo.jpg",
        caption: "Check out this photo!",
      }),
    }
  );
  ```
</CodeGroup>

***

## Video Mesaj\u0131

\u0130ste\u011fe ba\u011fl\u0131 a\u00e7\u0131klama ile video dosyas\u0131 g\u00f6nderin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "video",
      "media_url": "https://example.com/clip.mp4",
      "caption": "Watch this!"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "video",
        media_url: "https://example.com/clip.mp4",
        caption: "Watch this!",
      }),
    }
  );
  ```
</CodeGroup>

***

## Ses Mesaj\u0131

Ses dosyas\u0131 g\u00f6nderin. Ses mesajlar\u0131 WhatsApp'ta sesli mesaj olarak g\u00f6r\u00fcn\u00fcr.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "audio",
      "media_url": "https://example.com/voice-note.ogg"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "audio",
        media_url: "https://example.com/voice-note.ogg",
      }),
    }
  );
  ```
</CodeGroup>

<Note>
  En iyi uyumluluk i\u00e7in sesli mesajlarda Opus codec ile kodlanm\u0131\u015f `.ogg` dosyalar\u0131 kullan\u0131n.
</Note>

***

## Belge Mesaj\u0131

Bir dosyay\u0131 belge eki olarak g\u00f6nderin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "document",
      "media_url": "https://example.com/report.pdf",
      "filename": "Q1-Report.pdf",
      "caption": "Here is the quarterly report"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "document",
        media_url: "https://example.com/report.pdf",
        filename: "Q1-Report.pdf",
        caption: "Here is the quarterly report",
      }),
    }
  );
  ```
</CodeGroup>

***

## Konum Mesaj\u0131

Co\u011frafi konum i\u011fnesi g\u00f6nderin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "location",
      "latitude": -23.5505,
      "longitude": -46.6333,
      "name": "Sao Paulo",
      "address": "Sao Paulo, SP, Brazil"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "location",
        latitude: -23.5505,
        longitude: -46.6333,
        name: "Sao Paulo",
        address: "Sao Paulo, SP, Brazil",
      }),
    }
  );
  ```
</CodeGroup>

***

## Anket Mesaj\u0131

Etkile\u015fimli bir anket olu\u015fturun. Al\u0131c\u0131lar do\u011frudan WhatsApp \u00fczerinden se\u00e7eneklere oy verebilir.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "poll",
      "poll_name": "What day works best for the meeting?",
      "poll_options": ["Monday", "Wednesday", "Friday"],
      "poll_allow_multiple": false
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "poll",
        poll_name: "What day works best for the meeting?",
        poll_options: ["Monday", "Wednesday", "Friday"],
        poll_allow_multiple: false,
      }),
    }
  );
  ```
</CodeGroup>

***

## Ki\u015fi / vCard Mesaj\u0131

Ki\u015fi kart\u0131 payla\u015f\u0131n.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "contact",
      "contact_name": "Maria Silva",
      "contact_phone": "+5511988887777"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "contact",
        contact_name: "Maria Silva",
        contact_phone: "+5511988887777",
      }),
    }
  );
  ```
</CodeGroup>

***

## Mesaj Y\u00f6nlendirme

Mevcut bir mesaj\u0131 ba\u015fka bir sohbete y\u00f6nlendirin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511888887777@s.whatsapp.net",
      "type": "forward",
      "forward_message_id": "BAE5F2C4D3B2A1",
      "forward_chat_id": "5511999998888@s.whatsapp.net"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511888887777@s.whatsapp.net",
        type: "forward",
        forward_message_id: "BAE5F2C4D3B2A1",
        forward_chat_id: "5511999998888@s.whatsapp.net",
      }),
    }
  );
  ```
</CodeGroup>

***

## Tepki

Bir mesaja emoji ile tepki verin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "reaction",
      "reaction_message_id": "BAE5F2C4D3B2A1",
      "reaction": "\ud83d\udc4d"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "reaction",
        reaction_message_id: "BAE5F2C4D3B2A1",
        reaction: "\ud83d\udc4d",
      }),
    }
  );
  ```
</CodeGroup>

<Tip>
  Bir tepkiyi kald\u0131rmak i\u00e7in `reaction` de\u011feri olarak bo\u015f bir dize g\u00f6nderin.
</Tip>

***

## Geli\u015fmi\u015f \u00d6zellikler

### Mesaj\u0131 Yan\u0131tlama

`quoted_message_id` ekleyerek \u00f6nceki bir mesaj\u0131 al\u0131nt\u0131lay\u0131n. Bu, herhangi bir mesaj t\u00fcr\u00fcyle \u00e7al\u0131\u015f\u0131r.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "text",
      "text": "Yes, I agree with this!",
      "quoted_message_id": "BAE5F2C4D3B2A1"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "text",
        text: "Yes, I agree with this!",
        quoted_message_id: "BAE5F2C4D3B2A1",
      }),
    }
  );
  ```
</CodeGroup>

### G\u00f6nderilmi\u015f Mesaj\u0131 D\u00fczenleme

`edit_message_id` sa\u011flayarak daha \u00f6nce g\u00f6nderdi\u011finiz bir mesaj\u0131 d\u00fczenleyin.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "5511999998888@s.whatsapp.net",
      "type": "text",
      "text": "Updated message content",
      "edit_message_id": "BAE5F2C4D3B2A1"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "5511999998888@s.whatsapp.net",
        type: "text",
        text: "Updated message content",
        edit_message_id: "BAE5F2C4D3B2A1",
      }),
    }
  );
  ```
</CodeGroup>

<Warning>
  Yaln\u0131zca kendi g\u00f6nderdi\u011finiz mesajlar\u0131 d\u00fczenleyebilirsiniz. D\u00fczenleme, WhatsApp taraf\u0131ndan belirlenen bir zaman s\u0131n\u0131r\u0131na tabidir (g\u00f6nderdikten sonra yakla\u015f\u0131k 15 dakika).
</Warning>

### Bahsetmeler

Grup mesaj\u0131nda belirli ki\u015filerden bahsedin. Bahsedilen ki\u015filer bildirim alacakt\u0131r.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "chat_id": "120363012345678901@g.us",
      "type": "text",
      "text": "Hey @Maria and @Carlos, please review this.",
      "mentions": [
        "5511999998888@s.whatsapp.net",
        "5511888887777@s.whatsapp.net"
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/messages/send",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        chat_id: "120363012345678901@g.us",
        type: "text",
        text: "Hey @Maria and @Carlos, please review this.",
        mentions: [
          "5511999998888@s.whatsapp.net",
          "5511888887777@s.whatsapp.net",
        ],
      }),
    }
  );
  ```
</CodeGroup>

***

## Sohbet Kimli\u011fi Formatlar\u0131

| Format                   | A\u00e7\u0131klama | \u00d6rnek                     |
| ------------------------ | ------------------ | ------------------------------ |
| `{phone}@s.whatsapp.net` | Bireysel sohbet    | `5511999998888@s.whatsapp.net` |
| `{id}@g.us`              | Grup sohbeti       | `120363012345678901@g.us`      |

***

## Brezilya Telefon Numaralar\u0131

<Note>
  Wappfy, Brezilya 9. hane sorununu otomatik olarak y\u00f6netir. Bir mesaj "no LID found" hatas\u0131yla ba\u015far\u0131s\u0131z olursa, sistem otomatik olarak alternatif formatla (9. haneyi ekleyerek veya kald\u0131rarak) yeniden dener.

  \u00d6rne\u011fin, `5511999998888` ba\u015far\u0131s\u0131z olursa `551199998888` ile yeniden dener ve tersi de ge\u00e7erlidir. Bu \u015feffaf bir \u015fekilde ger\u00e7ekle\u015fir -- kendiniz y\u00f6netmeniz gerekmez.
</Note>

***

## Mesaj T\u00fcr\u00fc Referans\u0131

| T\u00fcr   | Zorunlu Alanlar                         | \u0130ste\u011fe Ba\u011fl\u0131 Alanlar           |
| ---------- | --------------------------------------- | -------------------------------------------------- |
| `text`     | `text`                                  | `quoted_message_id`, `edit_message_id`, `mentions` |
| `image`    | `media_url`                             | `caption`, `quoted_message_id`                     |
| `video`    | `media_url`                             | `caption`, `quoted_message_id`                     |
| `audio`    | `media_url`                             | `quoted_message_id`                                |
| `document` | `media_url`                             | `filename`, `caption`, `quoted_message_id`         |
| `location` | `latitude`, `longitude`                 | `name`, `address`, `quoted_message_id`             |
| `poll`     | `poll_name`, `poll_options`             | `poll_allow_multiple`                              |
| `contact`  | `contact_name`, `contact_phone`         | `quoted_message_id`                                |
| `forward`  | `forward_message_id`, `forward_chat_id` | --                                                 |
| `reaction` | `reaction_message_id`, `reaction`       | --                                                 |

***

## Hata Y\u00f6netimi

| Durum Kodu | A\u00e7\u0131klama                                                                                                                              |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`      | Ge\u00e7ersiz mesaj verisi (orn. verilen t\u00fcr i\u00e7in eksik zorunlu alanlar).                                                             |
| `404`      | \u00d6rnek bulunamad\u0131 veya ba\u011fl\u0131 de\u011fil.                                                                                     |
| `422`      | Mesaj do\u011frulamas\u0131 ba\u015far\u0131s\u0131z oldu (orn. ge\u00e7ersiz telefon numaras\u0131 format\u0131).                              |
| `429`      | H\u0131z s\u0131n\u0131r\u0131 a\u015f\u0131ld\u0131. [H\u0131z S\u0131n\u0131rlar\u0131](/tr/rate-limits) sayfas\u0131na bak\u0131n.           |
| `502`      | WhatsApp sa\u011flay\u0131c\u0131s\u0131 bir hata d\u00f6nd\u00fcrd\u00fc. Ayr\u0131nt\u0131lar i\u00e7in hata mesaj\u0131n\u0131 kontrol edin. |
