# Bays

## List all agenda bays

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

This endpoint allows you to get the list of your bays. \
The bays 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,
            "branch_id": 1,
            "order": 2,
            "default": 1,
            "name": "TECH 2",
            "tech_id": 0,
            "initials": "SM",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "150.00",
            "diner_name": "",
            "lunch_start": "13:00:00",
            "lunch_end": "14:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        },
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 1",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda bay

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

This endpoint allows you to get one specific bay.&#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,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda bay

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

#### Headers

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

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

```json
{
    "data": [
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "order": 1,
    "default": 0,
    "name": "TECH 4",
    "tech_id": 0,
    "initials": "",
    "bay_type": 1,
    "vehicle_types": "",
    "cost": "0.00",
    "diner_name": "",
    "lunch_start": "12:00:00",
    "lunch_end": "13:00:00",
    "has_dinner": 1,
    "client_can_schedule": 0,
    "out_of_business_hours": 0,
    "disabled": 0
}
```

## Update a bay

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

#### Headers

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

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

```json
{
    "data": [
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "order": 1,
    "default": 0,
    "name": "TECH 4",
    "tech_id": 0,
    "initials": "",
    "bay_type": 1,
    "vehicle_types": "",
    "cost": "0.00",
    "diner_name": "",
    "lunch_start": "12:00:00",
    "lunch_end": "13:00:00",
    "has_dinner": 1,
    "client_can_schedule": 0,
    "out_of_business_hours": 0,
    "disabled": 0
}
```
