> 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/api-v1-reference/departments/create-a-department.md).

# Create a Department

Create a department (shop) in SameSystem.

For the manager's email, please use the 'manager\_email' attribute. If you do not provide the manager's email, the manager's email will be set to the email of the API user.

If the API user has access to multiple clients, the department will be created in the source client.

```json
{"openapi":"3.0.0","info":{"title":"SameSystem API V1","version":"1.1.3"},"servers":[{"url":"https://api.samesystem.com/api/v1/","description":""}],"paths":{"/{clientToken}/departments/create":{"post":{"tags":["Departments"],"summary":"Create a Department","description":"Create a department (shop) in SameSystem.\n\nFor the manager's email, please use the 'manager_email' attribute. If you do not provide the manager's email, the manager's email will be set to the email of the API user.\n\nIf the API user has access to multiple clients, the department will be created in the source client.","operationId":"post-clientToken-departments-create","parameters":[{"name":"clientToken","in":"path","description":"Token in a form of \"c\\<clientId\\>\".","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentCreateInput"}}}},"responses":{"200":{"description":"Successfull","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","default":"ok"},"description":{"type":"string","default":"Department has been successfully created"},"department_id":{"type":"number","description":"Internal identifier for the new department"}}}}}},"412":{"description":"Precondition Failed","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","default":"fail"},"message":{"type":"string"},"errors":{"type":"object","properties":{"base":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"components":{"schemas":{"DepartmentCreateInput":{"title":"DepartmentCreateInput","required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the department"},"email":{"type":"string","description":"Email to the department"},"manager_email":{"type":"string","description":"Email to the manager"},"phone":{"type":"string","description":"Phone number to the department"},"dpt_nr":{"type":"string","description":"Department number"},"abbr":{"type":"string","description":"Abbreviated department name"},"salary_dpt_nr":{"type":"string","description":"Salary department number"},"salary_dpt_nr2":{"type":"string","description":"Salary department number (MLE)"},"address":{"type":"string","description":"Address"},"fax":{"type":"string","description":"Fax number"},"postal_code":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City"},"cost_center":{"type":"string","description":"Cust center of the department"},"custom_id":{"type":"string","description":"Custom id/external department id."},"template_id":{"type":"string","description":"Template id for regional templates. Contact SameSystem for a list of valid ids."}},"description":"Used to create new 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/api-v1-reference/departments/create-a-department.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.
