---
title: "Edit Department"
method: POST
path: "/api/departments/edit/{id}"
tags: ["Departments"]
---

# Edit Department

`POST /api/departments/edit/{id}`

## Request

- Base URL: `https://app.timetastic.co.uk` (the document declares no server; this is the origin it was published from)
- URL: `https://app.timetastic.co.uk/api/departments/edit/{id}`
- Auth: none declared

As with the user edit endpoint - pass only the fields you want to update and we'll only update those.
            
A rejection returns an `ErrorStatus` and an `ErrorMessage`. `NotPermitted` means the department does not
exist or belongs to another organisation, or you are not allowed to edit it. `NothingToDo` means the
request produced no change. `InvalidValue` and `Failed` mean a supplied value was rejected — check
`ErrorMessage`.
            
Model validation fails before any of that, and returns a different 400 body: an object keyed by
field name, each holding an array of messages. Check for `ErrorStatus` to tell the two apart.

## Path parameters

- `id` integer, required

## Request body

- TimetasticCoreModelsApiModelsUpdateDepartmentApiModel
  - `name` string, nullable: The Department name
  - `managerId` integer, nullable: The userId of the Manager for this department
  - `maxOff` integer, nullable: The maximum number of users that can be absent in this department at once. Set to 0 to disable Maximum absent and have no limit.

## Response `200`

The department was updated.

## Other responses

- `400`: The department could not be updated.
- `401`: The request was not authenticated — the API token is missing or invalid.

---

[API](https://skmtc.dev/timetastic/apis/timetastic-api.md) · [All operations](https://skmtc.dev/timetastic/apis/timetastic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/timetastic/apis/timetastic-api/revisions/709ccb0412c3?raw)
