> 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/departments.md).

# Departments

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

A department record represents a logical department or shop. There will always be one department per client, but often multiple departments exist.

You will be able to fetch data from departments, but also to create and update departments from the API.&#x20;

The record can be uniquely identified by:

<table><thead><tr><th valign="top">Field:</th><th valign="top">Description:</th></tr></thead><tbody><tr><td valign="top">id</td><td valign="top"> Internal ID number in SameSystem.</td></tr><tr><td valign="top">customId</td><td valign="top">External ID number created outside of SameSystem ex. an HR system. Will be null if not set.</td></tr></tbody></table>

The department record contains mainly static or slowly changing department-specific attributes like department number, salary department number (for certain payroll systems), manager, address and phone number.

Characteristics:

* Created once.
* At least one department must be present.
* Multiple departments can be created.

{% hint style="info" %}
**Notice:**\
Normally you need the internal id of the department to update it.&#x20;

If you add the query parameter `?use_custom_id=1`, you can use a custom id (external department id) to update the department.
{% endhint %}

### Fetch departments

You will need department information if you want to create/modify users as the `id` or `customId` is used when users are created.

You might also need the ids to fetch data regarding planned schedule, actual schedule, or fetch time registrations. ClientToken (ctx\_token) can also be fetched from the departments endpoint and used to update sales data.

Department numbers and department names can be changed by an administrator, and we therefore recommend fetching department data frequently.

### Template ID from a region

It is possible to add a template id from a region when you create or update a department. This is mainly for departments on the Germany market.

When the department is created, the tax information from the template will be transferred to the department automatically. Contact <integrations@samesystem.com> if you need the list of available template ids to add to the departments.


---

# 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/departments.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.
