# Find meeting slots across accounts

Finds meeting slots across accounts.

```http
POST https://api.pozy.ai/v1/calendar/availability
```

- Area: Email, calendar & files / Calendar
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `participants`, array of object, required: At least 1 item. Up to 10 items
  - `accountId`, string, required
  - `openHours`, array of object
    - `days`, array of integer, required: Each item: 0 to 6
    - `timezone`, string, required
    - `start`, string, required
    - `end`, string, required
    - `exdates`, array of string (date)
- `from`, string (date-time), required
- `to`, string (date-time), required
- `durationMinutes`, integer, required: 5 to 480
- `intervalMinutes`, integer: Default `30`. 5 to 240
- `roundTo`, integer: 5 to 60
- `buffer`, object
  - `before`, integer: Default `0`. 0 to 240
  - `after`, integer: Default `0`. 0 to 240
- `defaultOpenHours`, array of object
  - `days`, array of integer, required: Each item: 0 to 6
  - `timezone`, string, required
  - `start`, string, required
  - `end`, string, required
  - `exdates`, array of string (date)
- `method`, string: One of `collective`, `max_availability`. Default `collective`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/calendar/availability" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "participants": [
    {
      "accountId": "696e0b682d0a31188e7a2ba9"
    }
  ],
  "from": "2026-10-02T09:00:00.000Z",
  "to": "2026-10-02T09:00:00.000Z",
  "durationMinutes": 5
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/calendar/availability", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    participants: [
      {
        accountId: "696e0b682d0a31188e7a2ba9"
      }
    ],
    from: "2026-10-02T09:00:00.000Z",
    to: "2026-10-02T09:00:00.000Z",
    durationMinutes: 5
  }),
});
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/calendar/availability",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "participants": [
            {
                "accountId": "696e0b682d0a31188e7a2ba9",
            },
        ],
        "from": "2026-10-02T09:00:00.000Z",
        "to": "2026-10-02T09:00:00.000Z",
        "durationMinutes": 5,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `data`, object
  - `timeSlots`, array of object
    - `from`, string (date-time)
    - `to`, string (date-time)
    - `accountIds`, array of string

```json
{
  "data": {
    "timeSlots": [
      {
        "from": "2026-10-02T09:00:00.000Z",
        "to": "2026-10-02T09:00:00.000Z",
        "accountIds": [
          "string"
        ]
      }
    ]
  }
}
```
