> ## Documentation Index
> Fetch the complete documentation index at: https://help.lunacal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get team availability

> Read open slots for team events and for each host of a Managed Event.

> [!NOTE]
>
> Uses [Get availability](https://help.lunacal.ai/api/endpoints/get-availability.md): `POST /api/availability` with `Authorization: Bearer $LUNACAL_API_KEY` and a JSON body. [API key setup](https://help.lunacal.ai/api/authentication.md).

A username in `usernameList` only finds that person's own event types. Team events need a different request. Pick the one that matches how the event is set up:

| Event | Send |
| - | - |
| Team event (Round Robin or Collective) | The team event's `eventTypeId` |
| [Managed Event](https://help.lunacal.ai/event-types/managed-event) (each host has their own copy) | The host's username in `usernameList`, plus `eventTypeSlug` |

## Team events

Send the team event's `id`. [List event types](https://help.lunacal.ai/api/endpoints/event-types-list.md) returns team events inside each team's group.

```bash cURL theme={null}
curl -X POST https://app.lunacal.ai/api/availability \
  -H "Authorization: Bearer $LUNACAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "eventTypeId": 1234,
  "startTime": "2027-01-04T00:00:00-06:00",
  "endTime": "2027-01-31T23:59:59-06:00",
  "timeZone": "America/Chicago"
}'
```

If you don't have the ID, send the team slug as the only entry in `usernameList`, the event slug in `eventTypeSlug`, and `"isTeamEvent": true`. Both slugs are in the team booking link: `app.lunacal.ai/team/<team-slug>/<event-slug>`.

## Managed Events

A Managed Event is a team template, and each assigned host gets their own copy. The template has no hosts, so its `id` always returns empty `slots`.

Check each host's copy instead. Send the host's username and the event slug, both taken from the host's booking link: `app.lunacal.ai/<username>/<event-slug>`. Make one call per host.

```bash cURL theme={null}
curl -X POST https://app.lunacal.ai/api/availability \
  -H "Authorization: Bearer $LUNACAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "usernameList": ["aaron"],
  "eventTypeSlug": "mix-consultation",
  "startTime": "2027-01-04T00:00:00-06:00",
  "endTime": "2027-01-31T23:59:59-06:00",
  "timeZone": "America/Chicago"
}'
```

## Find the next open slot

Slots are grouped by date:

```json theme={null}
{
  "slots": {
    "2027-01-05": [
      { "time": "2027-01-05T16:00:00.000Z" },
      { "time": "2027-01-05T16:30:00.000Z" }
    ],
    "2027-01-06": [
      { "time": "2027-01-06T15:00:00.000Z" }
    ]
  }
}
```

* The first `time` under the earliest date is the next open slot.
* Date keys use the `timeZone` you send. Every `time` is in UTC.
* An empty `slots` object means nothing is open in that range.

## Empty or not found

| What you see | Why | Fix |
| - | - | - |
| Empty `slots` | `startTime` is in the past | Past slots are never returned. Start from today. |
| Empty `slots` | You sent a Managed Event template's `id` | Send the host's username and the event slug. |
| Empty `slots` after a certain date | The event's [Advance Booking Limit](https://help.lunacal.ai/event-types/limits.md) ends there | Raise the limit, or read it as "not open for booking yet". |
| `{"message":"NOT_FOUND"}` | No event matched the username or slug | For a team event, send its `eventTypeId`, or add `"isTeamEvent": true`. |

## Related

* [Get availability](https://help.lunacal.ai/api/endpoints/get-availability.md)
* [List event types](https://help.lunacal.ai/api/endpoints/event-types-list.md)
* [Managed Events](https://help.lunacal.ai/event-types/managed-event)


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