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

# Communications

> Send WhatsApp and email messages to your learners from your own systems.

`POST /v1/communications/send/` sends one of your company's approved templates to up to 500
recipients, by WhatsApp or email, through your company's WhatsApp line.

## Send a message

```bash theme={null}
curl https://app.reinvented.education/api/v1/communications/send/ \
  --request POST \
  --header "Authorization: Api-Key YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: reminder-2026-03-20-batch-1" \
  --data '{
    "template_slug": "recordatorio-curso",
    "channel": "whatsapp",
    "variables": { "1": "Ana", "2": "https://example.com/course" },
    "recipients": ["+573001112233", "+573004445566"]
  }'
```

```json theme={null}
{ "id": 8812, "status": "COMPLETED", "queued": 2, "invalid_recipients": [] }
```

| Field | Notes |
| - | - |
| `template_slug` | An approved template of your company. Ask your account manager for the slugs and their variables. |
| `variables` | Template variables by position (`"1"`, `"2"`…). Every variable of the template is required. Links are shortened automatically. |
| `channel` | `whatsapp` or `email`. |
| `recipients` | Phone numbers in international format for WhatsApp, or email addresses. Up to 500. |
| `media` | Optional attachment: see below. |

## Status

| `status` | Meaning |
| - | - |
| `COMPLETED` | Every recipient was queued. |
| `PARTIAL` | Valid recipients were queued; the invalid ones are in `invalid_recipients`. |
| `PENDING` | More than 100 valid recipients: they are queued in the background after the response. |
| `FAILED` | Nothing could be queued. |

"Queued" means hackU accepted the message for delivery; delivery itself is asynchronous.

## Retries and idempotency

Send an `Idempotency-Key` header (any unique string up to 255 characters) on every send. If the
request is retried with the same key, hackU answers `202` with the original result and does not send
again, so a timeout on your side never produces duplicate messages.

## Attachments

Upload the file first, then reference it in the send:

```bash theme={null}
curl https://app.reinvented.education/api/v1/communications/media/ \
  --request POST \
  --header "Authorization: Api-Key YOUR_API_KEY" \
  --form "file=@brochure.pdf" \
  --form "name=Brochure"
```

```json theme={null}
{ "url_pk": 2207, "media": "document", "url": "https://…", "name": "Brochure" }
```

```json theme={null}
"media": { "url_pk": 2207, "media": "document" }
```

## Limits

* Up to 500 recipients per request.
* WhatsApp lines have a daily sending limit. If a request has more valid recipients than the line can
  still send today, nothing is sent and the API answers `429`, saying how many messages remain. Send a
  smaller batch or try again the next day.
* Templates marked as offline cannot be sent through the API and return `422`.
* Your company needs a WhatsApp line configured, even for email; without one the API answers `400`.


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