# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gem-suite.com/api-reference/resources/agenda/appointments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
