---
title: "Send messages"
description: "Send SMS and WhatsApp messages, follow them, and cancel ones that haven't gone."
url: "https://docs.goomzo.africa/docs/developers/php-sdk/messages"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Guides"
related:
  - /docs/developers/php-sdk/templates
  - /docs/developers/php-sdk/customers
  - /docs/developers/php-sdk/webhooks
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# Send messages

> Send SMS and WhatsApp messages, follow them, and cancel ones that haven't gone.

`$goomzo->messages` sends messages, each to its own person, and reads them back. For the fields of a message, see
[Send messages](https://docs.goomzo.africa/docs/developers/messages/send?utm_source=llms&utm_medium=ai).

## Send one message

```php
$message = $goomzo->messages->sendOne([
    'to' => '+255712345678',
    'channel' => 'sms',
    'content' => ['text' => 'Amina, order #1042 is ready.'],
]);
```

`sendOne` returns the message, its `status` `sending`, or `scheduled` with a `sendAt`.

## Send up to 100

```php
$messages = $goomzo->messages->send(['messages' => [
    ['to' => '+255712345678', 'channel' => 'sms', 'content' => ['text' => 'Amina, order #1042 is ready.']],
    ['customerId' => 'cus_4hq2v9n1c8x0t6pk', 'channel' => 'whatsapp', 'content' => ['text' => 'Juma, order #1043 is ready.']],
]]);
```

They're queued all or none. If one isn't valid, none is sent, and the error names it, such as `messages[1].to`.

## Send to many people

A broadcast sends one message to segments, numbers or every customer:

```php
$goomzo->broadcasts->create([
    'name' => 'Black Friday',
    'channel' => 'sms',
    'content' => ['text' => 'Hi {{name|there}}, 20% off everything today.'],
    'audience' => ['segments' => [['name' => 'VIP']]],
]);
```

See [Broadcasts](https://docs.goomzo.africa/docs/developers/messages/broadcasts?utm_source=llms&utm_medium=ai).

## Read messages

```php
$message = $goomzo->messages->get('msg_7c1x9v2b4n6m8q0w');

foreach ($goomzo->messages->list(['status' => 'failed']) as $message) {
    echo $message['to']['phone'], ': ', $message['error'];
}
```

## Other methods

| Method                         | Does                                               |
| ------------------------------ | -------------------------------------------------- |
| `messages->cancel($id)`        | Cancels a message that hasn't gone.                |
| `messages->senders()`          | Lists the SMS sender IDs you can send from.        |
| `messages->media($receivedId)` | Gets a file a customer sent on WhatsApp.           |
| `broadcasts->get($id)`         | Gets a broadcast, with how its messages are doing. |
| `broadcasts->list()`           | Lists broadcasts.                                  |
| `broadcasts->cancel($id)`      | Cancels a broadcast that hasn't gone.              |

**Note:** Follow a message's status with [webhooks](https://docs.goomzo.africa/docs/developers/php-sdk/webhooks?utm_source=llms&utm_medium=ai), not by asking again and again.

## Next steps

- [Send templates](https://docs.goomzo.africa/docs/developers/php-sdk/templates?utm_source=llms&utm_medium=ai)
- [Webhooks](https://docs.goomzo.africa/docs/developers/php-sdk/webhooks?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
