# Appointments

## To Fetch Appointments

## Get Appointments

<mark style="color:blue;">`GET`</mark> `https://app.appointo.me/api/appointments`

Fetch Appointments

#### Query Parameters

| Name            | Type    | Description                       |
| --------------- | ------- | --------------------------------- |
| appointment\_id | integer | to fetch single appointment       |
| product\_id     | integer | to fetch appointments for product |
| limit           | integer | Default and Max value: 100        |
| offset          | integer | Default: 0                        |
| search\_term    | string  | (optional)                        |

#### Headers

| Name                                             | Type   | Description        |
| ------------------------------------------------ | ------ | ------------------ |
| APPOINTO-TOKEN<mark style="color:red;">\*</mark> | String | Appointo API token |

{% tabs %}
{% tab title="200 Appointments successfully fetched" %}

```json
[{
    id: 123,
    ...
}]
```

{% endtab %}

{% tab title="401 Permission denied" %}
{"error\_code":"invalid\_api\_token","message":"API token is invalid. Please check token in Appointo settings."}
{% endtab %}
{% endtabs %}

## Get Availability for Appointment

<mark style="color:blue;">`GET`</mark> `https://app.appointo.me/api/appointments/:appointment_id/calendar_availability`

Fetch Availability for the Appointment

#### Query Parameters

| Name                                          | Type       | Description                                                          |
| --------------------------------------------- | ---------- | -------------------------------------------------------------------- |
| start\_date<mark style="color:red;">\*</mark> | string     | YYYY-MM-DD format. start date for availability                       |
| end\_date                                     | string     | YYYY-MM-DD format. end date for availability                         |
| impersonated\_tms                             | \[integer] | To show availability for specific team members. Example: \[123, 234] |

#### Headers

| Name                                             | Type   | Description        |
| ------------------------------------------------ | ------ | ------------------ |
| APPOINTO-TOKEN<mark style="color:red;">\*</mark> | String | Appointo API token |

{% tabs %}
{% tab title="200 Availability successfully fetched" %}

```json
[{
    id: 123,
    ...
}]
```

{% endtab %}

{% tab title="401 Permission denied" %}
{"error\_code":"invalid\_api\_token","message":"API token is invalid. Please check token in Appointo settings."}
{% endtab %}
{% endtabs %}

## Upsert Appointment Config

<mark style="color:blue;">`PUT`</mark> `https://app.appointo.me/api/appointments/:appointment_id`

Upsert Availability config and date overrides

#### Headers

| Name                                             | Type   | Description        |
| ------------------------------------------------ | ------ | ------------------ |
| APPOINTO-TOKEN<mark style="color:red;">\*</mark> | String | Appointo API token |

```
Request payload
// Please make sure to send all date overrides in the following format
{
    "config": {
        "timezone": "America/New_York",
        "duration": "30",
        "minimum_notice": "240",
        "max_capacity": "10",
        "meeting_detail": "",
        "note": "",
        "interval": "30",
        "reminder_duration": "10",
        "send_reminder": true,
        "whatsapp_duration": "15",
        "send_whatsapp_reminder": false,
        "enable_max_events_per_day": false,
        "max_events_per_day": 1,
        "start_buffer_time": "0",
        "end_buffer_time": "0",
        "location_type": "null",
        "location_value": "",
        "allow_cancel": true,
        "allow_reschedule": true,
        "reschedule_duration": 10,
        "cancel_duration": 10,
        "date_range_type": "all",
        "tm_assign_rule": "random",
        "days_in_future": "1",
        "start_date_range": "2022-11-10",
        "end_date_range": "2022-11-10",
        "is_combo_service": false,
        "send_text_reminder": false,
        "text_duration": "0",
        "min_day_duration": "1",
        "max_day_duration": "1",
        "fixed_multi_day_price": true,
        "rem_group_slot_after_booking": false,
        "start_month": "2024-10-29",
        "color": "#51796B",
        "allow_waitlist": true,
        "email_label": "email",
        "name_label": "name",
        "phone_label": "phone",
        "show_phone": true
    },
"availabilities": [
        {
            "id": 6028,
            "weekday": "monday",
            "weekday_index": 1,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": true,
            "max_capacity": null
        },
        {
            "id": 6029,
            "weekday": "tuesday",
            "weekday_index": 2,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": true,
            "max_capacity": null
        },
        {
            "id": 6030,
            "weekday": "wednesday",
            "weekday_index": 3,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": true,
            "max_capacity": null
        },
        {
            "id": 6031,
            "weekday": "thursday",
            "weekday_index": 4,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": false,
            "max_capacity": null
        },
        {
            "id": 6032,
            "weekday": "friday",
            "weekday_index": 5,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": false,
            "max_capacity": null
        },
        {
            "id": 6884,
            "weekday": "sunday",
            "weekday_index": 0,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM", "surge": true, "price": "20" }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": true,
            "max_capacity": null
        },
        {
            "id": 6885,
            "weekday": "saturday",
            "weekday_index": 6,
            "slots": [
                { "start_time": "09:00AM", "end_time": "10:00PM", "max_capacity": 5 }
            ],
            "shop_id": 135,
            "appointment_id": 304,
            "day_available": true,
            "max_capacity": null
        }
    ],
    "override": [
        {
            "id": 511,
            "day": "2024-03-28",
            "slots": [
                {
                    "start_time": "09:00AM",
                    "end_time": "05:00PM"
                }
            ],
            "shop_id": 135,
            "appointment_id": 299,
            "day_available": true
        },
        {
            "day": "2024-03-29",
            "slots": [
                {
                    "start_time": "09:00AM",
                    "end_time": "05:00PM"
                }
            ],
            "day_available": true
        }
    ]
}

```

{% tabs %}
{% tab title="200 Availability successfully created" %}

```json
[{
    id: 123,
    ...
}]
```

{% endtab %}

{% tab title="401 Permission denied" %}
{"error\_code":"invalid\_api\_token","message":"API token is invalid. Please check token in Appointo settings."}
{% 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://api-docs.appointo.me/reference/api-reference/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.
