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

# Send bulk

> Bulk sending of WhatsApp Business template messages

## Description

This endpoint allows you to send a WhatsApp template to multiple recipients in a single request. It implements an **asynchronous pattern**: when creating the send, it returns a `bulk_send_id` that you can use to [check the progress](/en/api-reference/envio-masivo/estado-envio) of the send.

The API automatically handles Meta's rate limits based on the number's tier, distributes the sends, and tracks the status of each individual message.

## Authentication header

<ParamField header="X-API-Key" type="string" required>
  Your Mindo API Key. Format: `mindo_xxxxxxxxxxxxxxxxxxxxxxxx`
</ParamField>

## Body parameters

<ParamField body="phone_number_id" type="string" required>
  Meta's WhatsApp phone number ID from which messages will be sent. You can get it from the [Get business accounts](/en/api-reference/cuentas-negocio/obtener-cuentas) endpoint.
</ParamField>

<ParamField body="template_name" type="string" required>
  Name of the approved template to send. Must have `APPROVED` status in Meta.
</ParamField>

<ParamField body="language" type="string">
  Template language. Default: `"es"`. Examples: `"es"`, `"en"`, `"pt_BR"`.
</ParamField>

<ParamField body="recipients" type="array" required>
  List of recipients with their custom variables.

  <Expandable title="Properties of each recipient">
    <ParamField body="phone" type="string" required>
      Phone number in international format (e.g.: `"+5491112345678"`). No spaces.
    </ParamField>

    <ParamField body="variables" type="object">
      Custom variables for this recipient. Keys must match the template variables.
    </ParamField>

    <ParamField body="button_variables" type="object">
      Variables for dynamic template buttons. Keys use the format `button_0`, `button_1`, etc., where the number corresponds to the button index (starting at 0). Values are the dynamic suffixes or payloads for each button.

      **Important:** URL buttons only support 1 variable.
    </ParamField>
  </Expandable>
</ParamField>

## Response (202 Accepted)

<ResponseField name="bulk_send_id" type="string (UUID)">
  Unique bulk send ID. Use to check progress with [Send status](/en/api-reference/envio-masivo/estado-envio).
</ResponseField>

<ResponseField name="task_id" type="string">
  Background processing task ID.
</ResponseField>

<ResponseField name="status" type="string">
  Initial send status. Always `"queued"` when created.
</ResponseField>

<ResponseField name="template_name" type="string">
  Name of the template to be sent.
</ResponseField>

<ResponseField name="total_recipients" type="integer">
  Total recipients in the submitted list.
</ResponseField>

<ResponseField name="unique_recipients" type="integer">
  Number of unique recipients after automatic deduplication.
</ResponseField>

<ResponseField name="estimated_time_minutes" type="float">
  Estimated processing time in minutes, based on the number's tier.
</ResponseField>

<ResponseField name="created_at" type="string (ISO 8601)">
  Send creation date and time.
</ResponseField>

<ResponseField name="whatsapp_phone_number" type="object">
  Information about the WhatsApp number that will send the messages.

  <Expandable title="whatsapp_phone_number properties">
    <ResponseField name="id" type="integer">
      Internal number ID.
    </ResponseField>

    <ResponseField name="phone_number_id" type="string">
      Meta's WhatsApp phone number ID.
    </ResponseField>

    <ResponseField name="display_phone_number" type="string">
      Formatted display number.
    </ResponseField>

    <ResponseField name="verified_name" type="string">
      Meta-verified name.
    </ResponseField>

    <ResponseField name="quality_rating" type="string">
      Number quality rating (`GREEN`, `YELLOW`, `RED`).
    </ResponseField>

    <ResponseField name="messaging_limit_tier" type="string">
      Meta messaging limit tier.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="quota_info" type="object">
  Quota and send limit information.

  <Expandable title="quota_info properties">
    <ResponseField name="can_send" type="boolean">
      Whether the send is possible with the current quota.
    </ResponseField>

    <ResponseField name="quota_needed" type="integer">
      Quota needed for this send.
    </ResponseField>

    <ResponseField name="quota_available" type="integer">
      Currently available quota.
    </ResponseField>

    <ResponseField name="quota_total" type="integer">
      Total plan quota.
    </ResponseField>

    <ResponseField name="tier" type="string">
      Number's WhatsApp tier.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/ \
    -H "X-API-Key: mindo_xxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number_id": "813497231850626",
      "template_name": "welcome_message",
      "language": "es",
      "recipients": [
        {
          "phone": "+5491112345678",
          "variables": {
            "name": "Juan Perez",
            "code": "ABC123"
          },
          "button_variables": {
            "button_0": "ABC-123"
          }
        },
        {
          "phone": "+5491187654321",
          "variables": {
            "name": "Maria Garcia",
            "code": "DEF456"
          },
          "button_variables": {
            "button_0": "DEF-456"
          }
        },
        {
          "phone": "+5491199887766",
          "variables": {
            "name": "Carlos Lopez",
            "code": "GHI789"
          },
          "button_variables": {
            "button_0": "GHI-789"
          }
        }
      ]
    }'
  ```

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

  response = requests.post(
      "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
      headers={"X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx"},
      json={
          "phone_number_id": "813497231850626",
          "template_name": "welcome_message",
          "language": "es",
          "recipients": [
              {
                  "phone": "+5491112345678",
                  "variables": {"name": "Juan Perez", "code": "ABC123"},
                  "button_variables": {"button_0": "ABC-123"}
              },
              {
                  "phone": "+5491187654321",
                  "variables": {"name": "Maria Garcia", "code": "DEF456"},
                  "button_variables": {"button_0": "DEF-456"}
              },
              {
                  "phone": "+5491199887766",
                  "variables": {"name": "Carlos Lopez", "code": "GHI789"},
                  "button_variables": {"button_0": "GHI-789"}
              }
          ]
      }
  )

  data = response.json()
  print(f"Bulk Send ID: {data['bulk_send_id']}")
  print(f"Recipients: {data['unique_recipients']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
    {
      method: "POST",
      headers: {
        "X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        phone_number_id: "813497231850626",
        template_name: "welcome_message",
        language: "es",
        recipients: [
          {
            phone: "+5491112345678",
            variables: { name: "Juan Perez", code: "ABC123" },
            button_variables: { button_0: "ABC-123" }
          },
          {
            phone: "+5491187654321",
            variables: { name: "Maria Garcia", code: "DEF456" },
            button_variables: { button_0: "DEF-456" }
          },
          {
            phone: "+5491199887766",
            variables: { name: "Carlos Lopez", code: "GHI789" },
            button_variables: { button_0: "GHI-789" }
          }
        ]
      })
    }
  );

  const data = await response.json();
  console.log("Bulk Send ID:", data.bulk_send_id);
  console.log("Recipients:", data.unique_recipients);
  ```
</RequestExample>

<ResponseExample>
  ```json 202 - Accepted theme={null}
  {
    "bulk_send_id": "a3f2b8c9-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    "task_id": "7f8e9d0c-1b2a-3c4d-5e6f-7a8b9c0d1e2f",
    "status": "queued",
    "template_name": "welcome_message",
    "total_recipients": 3,
    "unique_recipients": 3,
    "estimated_time_minutes": 0.4,
    "created_at": "2025-11-16T21:30:00Z",
    "whatsapp_phone_number": {
      "id": 123,
      "phone_number_id": "813497231850626",
      "display_phone_number": "+54 9 223 675-0780",
      "verified_name": "Mindo Software",
      "quality_rating": "GREEN",
      "messaging_limit_tier": "TIER_1000"
    },
    "quota_info": {
      "can_send": true,
      "quota_needed": 3,
      "quota_available": 997,
      "quota_total": 1000,
      "tier": "TIER_1000"
    }
  }
  ```

  ```json 400 - Validation theme={null}
  {
    "phone_number_id": ["This field is required."],
    "recipients": ["This field is required."]
  }
  ```

  ```json 400 - Empty recipients theme={null}
  {
    "error": "recipients es requerido y no puede estar vacio"
  }
  ```

  ```json 404 - Template not found theme={null}
  {
    "error": "Template 'welcome_message' (language: es) no encontrado en este business account"
  }
  ```

  ```json 404 - Number not found theme={null}
  {
    "error": "Numero de WhatsApp con ID '813497231850626' no encontrado"
  }
  ```

  ```json 401 - Not authenticated theme={null}
  {
    "error": "Este endpoint requiere autenticacion con API Key (header X-API-Key)"
  }
  ```
</ResponseExample>

## Send statuses

The bulk send `status` field can have the following values:

| Status       | Description                            |
| ------------ | -------------------------------------- |
| `QUEUED`     | Send created and queued for processing |
| `PROCESSING` | Actively sending messages              |
| `COMPLETED`  | All messages processed successfully    |
| `PARTIAL`    | Processed with some failures           |
| `FAILED`     | Send failed completely                 |
| `CANCELLED`  | Send cancelled manually                |

<Note>
  Use the [Send status](/en/api-reference/envio-masivo/estado-envio) endpoint with the `bulk_send_id` to check progress in real time, including counters for sent, delivered, read, and failed messages.
</Note>

## Automatic deduplication

The API automatically removes duplicate phone numbers from the `recipients` list. The `unique_recipients` field in the response indicates the actual number of unique recipients that will receive the message, while `total_recipients` reflects the original count submitted.

## Use cases

<AccordionGroup>
  <Accordion title="Welcome campaign for new customers">
    Send a personalized welcome message to a list of newly registered customers.

    ```python theme={null}
    import requests

    new_customers = [
        {"phone": "+5491112345678", "name": "Juan Perez"},
        {"phone": "+5491187654321", "name": "Maria Garcia"},
        {"phone": "+5491199887766", "name": "Carlos Lopez"},
    ]

    response = requests.post(
        "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
        headers={"X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx"},
        json={
            "phone_number_id": "813497231850626",
            "template_name": "welcome_message",
            "recipients": [
                {"phone": c["phone"], "variables": {"name": c["name"]}}
                for c in new_customers
            ]
        }
    )

    bulk = response.json()
    print(f"Send created: {bulk['bulk_send_id']}")
    print(f"Recipients: {bulk['unique_recipients']}")
    ```
  </Accordion>

  <Accordion title="Bulk verification codes">
    Send unique verification codes to each recipient.

    ```python theme={null}
    import requests
    import secrets

    users = [
        {"phone": "+5491112345678", "name": "Juan"},
        {"phone": "+5491187654321", "name": "Maria"},
    ]

    recipients = [
        {
            "phone": user["phone"],
            "variables": {
                "name": user["name"],
                "code": secrets.token_hex(3).upper()
            }
        }
        for user in users
    ]

    response = requests.post(
        "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
        headers={"X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx"},
        json={
            "phone_number_id": "813497231850626",
            "template_name": "verification_code",
            "recipients": recipients
        }
    )
    ```
  </Accordion>

  <Accordion title="Order status notifications">
    Notify multiple customers about updates to their orders.

    ```javascript theme={null}
    const orders = [
      { phone: "+5491112345678", orderId: "ORD-001", status: "Shipped" },
      { phone: "+5491187654321", orderId: "ORD-002", status: "In transit" },
      { phone: "+5491199887766", orderId: "ORD-003", status: "Delivered" },
    ];

    const response = await fetch(
      "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
      {
        method: "POST",
        headers: {
          "X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx",
          "Content-Type": "application/json"
        },
        body: JSON.stringify({
          phone_number_id: "813497231850626",
          template_name: "order_update",
          recipients: orders.map(o => ({
            phone: o.phone,
            variables: { order_id: o.orderId, status: o.status }
          }))
        })
      }
    );

    const data = await response.json();
    console.log(`Send ${data.bulk_send_id} created for ${data.unique_recipients} recipients`);
    ```
  </Accordion>

  <Accordion title="Event reminders">
    Send personalized reminders with event date and time.

    ```python theme={null}
    import requests

    attendees = [
        {"phone": "+5491112345678", "name": "Juan Perez"},
        {"phone": "+5491187654321", "name": "Maria Garcia"},
    ]

    response = requests.post(
        "https://api.mindosoftware.com/api/v1/meta-templates/send-bulk/",
        headers={"X-API-Key": "mindo_xxxxxxxxxxxxxxxxxxxxxxxx"},
        json={
            "phone_number_id": "813497231850626",
            "template_name": "event_reminder",
            "recipients": [
                {
                    "phone": a["phone"],
                    "variables": {
                        "name": a["name"],
                        "event_name": "Webinar: API Introduction",
                        "event_date": "November 28, 6:00 PM"
                    }
                }
                for a in attendees
            ]
        }
    )

    bulk = response.json()
    print(f"Reminders sent: {bulk['unique_recipients']}")
    print(f"Estimated time: {bulk['estimated_time_minutes']} minutes")
    ```
  </Accordion>
</AccordionGroup>
