# List out of office entries (/docs/api-reference/scheduling-out-of-office/list-scheduling-out-of-office)

The environment's entries, newest first.

`GET https://api.coss.com/v1/scheduling/out_of_office`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Query parameters

- `limit` (integer, 1-100, default 20)
- `after` (string): The last id of the previous page.
- `host` (string): One host's entries, by id or uid.
- `start_after` (string): Entries ending after this.
- `start_before` (string): Entries starting before this.
- `group` (string): The entries one request made.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.scheduling.outOfOffice.list({
  start_after: "2027-01-04T15:00:00.000Z",
  start_before: "2027-01-04T15:00:00.000Z",
});
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/scheduling/out_of_office?start_after=2027-01-04T15%3A00%3A00.000Z&start_before=2027-01-04T15%3A00%3A00.000Z" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

## Response 200

A page of entries.

- `object` ("list", required)
- `data` (object[], required)
  - `object` ("scheduling.out_of_office", required)
  - `id` (string, required)
  - `host` (string, required)
  - `start` (string, required)
  - `end` (string, required)
  - `all_day` (object | null, required): How it was given, when it was as whole dates.
    - `start_date` (string, required)
    - `end_date` (string, required)
    - `time_zone` (string, required)
  - `reason` (string, required)
  - `notes` (string | null, required)
  - `public_message` (string | null, required)
  - `show_on_calendar` (boolean, required)
  - `delegates` (string[], required): Who can be booked in their place.
  - `existing_bookings` ("leave" | "reassign", required)
  - `external_id` (string | null, required)
  - `group` (string | null, required): Shared by the entries one request made for several hosts.
  - `source` ("api" | "host" | "manager" | "dashboard" | "holiday", required)
  - `created_at` (string, required)
  - `updated_at` (string, required)
- `has_more` (boolean, required)

Example:

```json
{
  "object": "list",
  "data": [
    {
      "object": "scheduling.out_of_office",
      "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m",
      "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m",
      "start": "2027-08-02T04:00:00.000Z",
      "end": "2027-08-14T04:00:00.000Z",
      "all_day": {
        "start_date": "2027-08-02",
        "end_date": "2027-08-13",
        "time_zone": "America/New_York"
      },
      "reason": "vacation",
      "notes": null,
      "public_message": "Back on the 16th.",
      "show_on_calendar": true,
      "delegates": [
        "host_01kd2m9a0b1c2d3e4f5g6h7j8n"
      ],
      "existing_bookings": "leave",
      "external_id": null,
      "group": null,
      "source": "api",
      "created_at": "2027-01-01T10:00:00.000Z",
      "updated_at": "2027-01-01T10:00:00.000Z"
    }
  ],
  "has_more": false
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `404`: Nothing with this id or uid exists in the environment (`not_found`).
- `422`: The request failed validation (`validation_error`, see `issues`), or can't be done: see `code`.
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).