# Start an iMessage group chat

Starts an iMessage group chat.

```http
POST https://api.pozy.ai/v1/imessage/groups
```

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

## Request body

Content type: `application/json`

- `accountId`, string, required
- `contacts`, array of string, required: At least 2 items. Up to 32 items
- `text`, string, required: Up to 10000 characters
- `name`, string: Up to 32 characters
- `channel`, string: One of `imessage`, `sms`, `rcs`, `whatsapp`. Default `imessage`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/imessage/groups" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "contacts": [
    "string"
  ],
  "text": "Hello from Pozy"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/imessage/groups", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    contacts: [
      "string"
    ],
    text: "Hello from Pozy"
  }),
});
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/imessage/groups",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "contacts": [
            "string",
        ],
        "text": "Hello from Pozy",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 202

- `success`, boolean
- `requestId`, string

```json
{
  "success": true,
  "requestId": "62281f30b62a8870b34602a4"
}
```
