# Branches

## List all branches

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

This endpoint allows you to get the list of your branches.\
The branches are returned, sorted by name (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | string | The number of page you wish to see. Default is 1.                        |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

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

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

```
{
    "data": [
        {
            "id": 2,
            "name": "Branch 2",
            "status": 1
        },
        {
            "id": 1,
            "name": "Logiciel Actif Inc",
            "status": 1
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a branch

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

This endpoint allows you to get the details of the resource.

#### Path Parameters

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| id   | string | The ID of the resource to retrieve |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

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

```
{
    "data": {
        "id": 1,
        "name": "Logiciel Actif Inc",
        "status": 1
    },
    "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/resources-1.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.
