> For the complete documentation index, see [llms.txt](https://docs.samesystem.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samesystem.dev/business-guides/organization-structure/districts.md).

# Districts

{% hint style="info" %}
Only available in API v2.
{% endhint %}

Department groups are used building a more complex department hierarchy and assign permissions to departments regarding approval of absence etc.

### Scenario 1

In this scenario, one manager exists in each department and will be able to approve absence from employees in the department they manage. An area manager will also be able to approve absence if a manager in one department is absent, since the area manager is member of a group with access to these departments.+

The manager in department A will not be able to approve anything from department B and vice versa.

<figure><img src="https://2670147116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRlKDeTWSTdLA0zl6vlB2%2Fuploads%2FOKZYJtYUQiZUvX7ryrw3%2Fimage.png?alt=media&amp;token=5350cb66-ec6a-4bc6-9230-44fc9aa93edb" alt=""><figcaption></figcaption></figure>

Example of request body to cover this scenario:

```json
{
  "data": {
    "attributes": {
      "name": "District Group A",
      "groupType": "Dc",
      "managerId": 775152,
      "departmentIds": [
        33465,
        33542
      ]
    }
  }
}
```

### Scenario 2

In this scenario, the manager A belongs to another department but will be able to approve absence in the department. Manager B that also belongs to another department will be able to approve absence if manager A is absent.

<figure><img src="https://2670147116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRlKDeTWSTdLA0zl6vlB2%2Fuploads%2F3Blke0STQRa2lNnOvAHg%2Fimage.png?alt=media&amp;token=d36eef40-1d24-490d-87d0-43c901e55fc4" alt=""><figcaption></figcaption></figure>

You will need two district groups to handle schenario 2. Example of the two request body calls to cover this scenario using endpoint `POST /api/v2/{clientToken}/groups`:

Call 1:

```json
{
  "data": {
    "attributes": {
      "name": "District Group A",
      "groupType": "Dc",
      "managerId": 1001,
      "departmentIds": [
        33333
      ]
    }
  }
}
```

Call 2:

```json
{
  "data": {
    "attributes": {
      "name": "District Group B",
      "groupType": "Dc",
      "managerId": 2002,
      "departmentIds": [
        33333
      ]
    }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samesystem.dev/business-guides/organization-structure/districts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
