---
updatedAt: 2025-06-10T22:14:47.000Z
agentTools:
  projectIndex: https://workable.readme.io/llms.txt
---

# /departments

Updates an existing department in your account. Required scope: `w_departments`. Accessible with all token types.

## Request

An example of the request body:

```json
{
    "id": "3ff4d641",
    "name": "New Commercial name",
    "parent_id": "3ff4d64b"
}
```

### Rename a department

In order to rename an existing department, the full body should be sent by changing only the name.

### Change parent of the department

In order to change the department's parent, then the new provided id it should be in the `parent_id`field. In cases that the `parent_id` is `null` then the department become a root department.

## Results

Calling the `PUT /departments` endpoint will update the given department and return it. An example of the response follows:

```json
{
    "id": "3ff4d641",
    "name": "New Commercial name",
    "parent_id": "3ff4d64b",
    "sample": false
}
```

Each `department` will have the following keys:

| key        | type      | description                                                                                |
| :--------- | :-------- | :----------------------------------------------------------------------------------------- |
| id         | `string`  | The department identifier                                                                  |
| name       | `string`  | The name of the department                                                                 |
| parent\_id | `string`  | The department identifier of the parent department or null if it is a top level department |
| sample     | `boolean` | Indicates whether the department is a sample created department                            |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "account-root",
    "version": "3.16.2"
  },
  "servers": [
    {
      "url": "https://{subdomain}.workable.com/spi/v3",
      "variables": {
        "subdomain": {
          "default": "subdomain"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "",
        "x-default": "Bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/departments": {
      "put": {
        "summary": "/departments",
        "description": "Updates an existing department in your account. Required scope: `w_departments`. Accessible with all token types.",
        "operationId": "departments-put",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "description": "The account subdomain",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "parent_id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The department identifier"
                  },
                  "name": {
                    "type": "string",
                    "description": "The name of the new department"
                  },
                  "parent_id": {
                    "type": "string",
                    "description": "The department identifier of the parent department if it is a top level department"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "id": "3ff4d641",
                    "name": "New Commercial name",
                    "parent_id": "3ff4d64b"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"3ff4d641\",\n    \"name\": \"New Commercial name\",\n    \"parent_id\": \"3ff4d64b\",\n    \"sample\": false\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "3ff4d641"
                    },
                    "name": {
                      "type": "string",
                      "example": "New Commercial name"
                    },
                    "parent_id": {
                      "type": "string",
                      "example": "3ff4d64b"
                    },
                    "sample": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": ""
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": ""
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```