> For the complete documentation index, see [llms.txt](https://docs.gem-suite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gem-suite.com/api-reference/resources/agenda/appointments.md).

# Appointments

## List all agenda appointments

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_appointments`

This endpoint allows you to get the list of your appointments. \
The appointments are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 2,
            "sale_id": 1,
            "sale_product_id": 1,
            "date_at": "2023-01-19",
            "time_at": "00:00:00",
            "workflow_id": 0,
            "duration": "1.00",
            "client_id": 1,
            "vehicle_id": 1,
            "description": null,
            "title": null,
            "date_end": "2023-01-19",
            "time_end": "10:00:00",
            "notes": null,
            "color": null,
            "bay_id": 1
        },
        {
            "id": 1,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-01-18",
            "time_at": "10:00:00",
            "workflow_id": 0,
            "duration": "100.00",
            "client_id": 0,
            "vehicle_id": 0,
            "description": "",
            "title": "TEST",
            "date_end": "2023-02-07",
            "time_end": "11:00:00",
            "notes": null,
            "color": "#519103",
            "bay_id": 2
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda appointment

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

This endpoint allows you to get one specific appointment.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-01-18",
            "time_at": "10:00:00",
            "workflow_id": 0,
            "duration": "100.00",
            "client_id": 0,
            "vehicle_id": 0,
            "description": "",
            "title": "TEST",
            "date_end": "2023-02-07",
            "time_end": "11:00:00",
            "notes": null,
            "color": "#519103",
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda appointment

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/agenda_appointments`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-03-23",
            "time_at": "13:00:00",
            "workflow_id": 0,
            "duration": "2.00",
            "client_id": 0,
            "car_id": 0,
            "description": null,
            "title": null,
            "date_end": "2023-03-23",
            "time_end": "15:00:00",
            "notes": null,
            "color": null,
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "sale_id": 0,
    "sale_product_id": 0,
    "date_at": "2023-03-23",
    "time_at": "13:00:00",
    "workflow_id": 0,
    "duration": "2.00",
    "client_id": 0,
    "vehicle_id": 0,
    "description": null,
    "title": null,
    "date_end": "2023-03-23",
    "time_end": "15:00:00",
    "notes": null,
    "color": null,
    "bay_id": null
}
```

## Update an appointment

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-03-23",
            "time_at": "13:00:00",
            "workflow_id": 0,
            "duration": "2.00",
            "client_id": 0,
            "car_id": 0,
            "description": null,
            "title": null,
            "date_end": "2023-03-23",
            "time_end": "15:00:00",
            "notes": null,
            "color": null,
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "sale_id": 0,
    "sale_product_id": 0,
    "date_at": "2023-03-23",
    "time_at": "13:00:00",
    "workflow_id": 0,
    "duration": "2.00",
    "client_id": 0,
    "vehicle_id": 0,
    "description": null,
    "title": null,
    "date_end": "2023-03-23",
    "time_end": "15:00:00",
    "notes": null,
    "color": null,
    "bay_id": null
}
```

## Delete an appointment

<mark style="color:red;">`DELETE`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "result": "success",
    "success": true
}
```

{% endtab %}
{% endtabs %}
