# Send an SMS/MMS

Sends an SMS/MMS.

```http
POST https://api.pozy.ai/v1/sms/messages
```

- Area: Messaging / SMS
- Auth: Authorization: Bearer pz_live_...

## Header parameters

- `Idempotency-Key` (string)

## Request body

Content type: `application/json`

- `from`, string, required
- `to`, string, required
- `text`, string
- `mediaUrls`, array of string (URL): Up to 10 items
- `sendAt`, string (date-time)

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/sms/messages" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "+14155550123",
  "to": "+14155550123"
}'
```

```ts
import { randomUUID } from "node:crypto";

const res = await fetch("https://api.pozy.ai/v1/sms/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Idempotency-Key": randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    from: "+14155550123",
    to: "+14155550123"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/sms/messages",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "from": "+14155550123",
        "to": "+14155550123",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `id`, string
- `conversationId`, string
- `status`, string: One of `sent`

```json
{
  "id": "6bfebd43ddc270f6d2c56fc5",
  "conversationId": "6e525f3820fc636aa96d2ee9",
  "status": "sent"
}
```
