# Booked slots

## /api/booked\_slots

<mark style="color:blue;">`GET`</mark> `https://datelist.io/api/booked_slots`

This endpoint allows you to list the booked slots.&#x20;

#### Query Parameters

| Name         | Type    | Description                                                          |
| ------------ | ------- | -------------------------------------------------------------------- |
| email        | string  | Only get booked slots matching a specific email                      |
| calendar\_id | string  | Only get booked slots for a specific calendar                        |
| from         | string  | Get booked slots starting from a specified date (in iso 8601 format) |
| to           | boolean | Get booked slots up to a specified date (in iso 8601 format)         |

#### Headers

| Name           | Type   | Description                                             |
| -------------- | ------ | ------------------------------------------------------- |
| Authentication | string | Authentication token (see the "authentication section") |

{% tabs %}
{% tab title="200 Returns the requested slots" %}

```
[
    {
        "id": 2163,
        "calendar_id": 31,
        "start": "2021-07-21T11:00:00.000Z",
        "end": "2021-07-21T11:10:00.000Z",
        "email": "alexis@datelist.io",
        "phone": "123456789",
        "created_at": "2021-07-11T11:04:22.542Z",
        "updated_at": "2021-07-11T11:04:22.542Z",
        "external_id": null,
        "created_from": "booking",
        "email_notification_sent_at": null,
        "phone_notification_sent_at": null,
        "deleted_at": null,
        "first_name": "Alexis",
        "last_name": "Clarembeau",
        "product_id": 63,
        "language": "default",
        "email_notification_really_sent_at": null,
        "phone_notification_really_sent_at": null,
        "custom_field_values": {
            "31": "Custom field value 1"
        },
        "integration_details": null
    },
    {...}
]
```

{% endtab %}
{% endtabs %}

## /api/booked\_slots/:id

<mark style="color:purple;">`PATCH`</mark> `https://datelist.io/api/booked_slots/:id`

Update data of a booked slot

#### Path Parameters

| Name | Type   | Description               |
| ---- | ------ | ------------------------- |
| id   | number | The ID of the booked slot |

#### Headers

| Name           | Type   | Description                                             |
| -------------- | ------ | ------------------------------------------------------- |
| Authentication | string | Authentication token (see the "Authentication" section) |

#### Request Body

| Name | Type   | Description                                                |
| ---- | ------ | ---------------------------------------------------------- |
| Body | string | Data to update (in same format as the GET endpoint result) |

{% tabs %}
{% tab title="200 The updated booked slot" %}

```
{
    "id": 2163,
    "calendar_id": 31,
    "start": "2021-07-21T11:00:00.000Z",
    "end": "2021-07-21T11:10:00.000Z",
    "email": "alexis.clarembeau@gmail.com",
    "phone": "123456789",
    "created_at": "2021-07-11T11:04:22.542Z",
    "updated_at": "2021-07-11T11:04:22.542Z",
    "external_id": null,
    "created_from": "booking",
    "email_notification_sent_at": null,
    "phone_notification_sent_at": null,
    "deleted_at": null,
    "first_name": "Alexis",
    "last_name": "Clarembeau",
    "product_id": 63,
    "language": "default",
    "email_notification_really_sent_at": null,
    "phone_notification_really_sent_at": null,
    "custom_field_values": {
        "31": "Custom field value 1"
    },
    "integration_details": null
}
```

{% endtab %}
{% endtabs %}

## /api/booked\_slots/:id

<mark style="color:red;">`DELETE`</mark> `https://datelist.io/api/booked_slots/:id`

Cancels a booked slot

#### Path Parameters

| Name                                 | Type   | Description               |
| ------------------------------------ | ------ | ------------------------- |
| id<mark style="color:red;">\*</mark> | number | The ID of the booked slot |

#### Query Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| send\_email\_on\_delete | boolean |             |

#### Headers

| Name           | Type   | Description                                             |
| -------------- | ------ | ------------------------------------------------------- |
| Authentication | string | Authentication token (see the "Authentication" section) |

{% tabs %}
{% tab title="200 The deleted booked slot" %}

```
{
    "id": 2163,
    "calendar_id": 31,
    "start": "2021-07-21T11:00:00.000Z",
    "end": "2021-07-21T11:10:00.000Z",
    "email": "alexis.clarembeau@gmail.com",
    "phone": "123456789",
    "created_at": "2021-07-11T11:04:22.542Z",
    "updated_at": "2021-07-11T11:04:22.542Z",
    "external_id": null,
    "created_from": "booking",
    "email_notification_sent_at": null,
    "phone_notification_sent_at": null,
    "deleted_at": null,
    "first_name": "Alexis",
    "last_name": "Clarembeau",
    "product_id": 63,
    "language": "default",
    "email_notification_really_sent_at": null,
    "phone_notification_really_sent_at": null,
    "custom_field_values": {
        "31": "Custom field value 1"
    },
    "integration_details": null
}
```

{% endtab %}
{% endtabs %}
