# Departments

## List all departments

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

This endpoint allows you to get the list of your departments. .

#### Headers

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

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

<pre class="language-json"><code class="lang-json"><strong>{
</strong><strong>    "data": [
</strong>        {
            "id": 3,
            "branch_id": 1,
            "name": "Pneus",
            "categories": "15",
            "use_default": 0,
            "system_id": 999999
        },
        {
            "id": 2,
            "branch_id": 1,
            "name": "Mécanique",
            "categories": null,
            "use_default": 0,
            "system_id": 999999
        },
        {
            "id": 1,
            "branch_id": 1,
            "name": "Comptoir",
            "categories": null,
            "use_default": 1,
            "system_id": 999999
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 500,
        "total": 3
    },
    "success": true
}
</code></pre>

{% endtab %}
{% endtabs %}

## Retrieve a specific department

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

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

#### Path Parameters

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| id   | integer | The ID of the department to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<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,
            "name": "Mécanique",
            "categories": null,
            "use_default": 0,
            "system_id": 999999
        }
    ],
    "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/sales/departments.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.
