---
updatedAt: 2025-12-09T10:21:27.000Z
---

Fetch the complete documentation index at: https://workable.readme.io/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# /departments/:id/merge

Merges an existing department with a target one in your account. Required scope: `w_departments`. Accessible with all token types.

## Request

An example of the request body:

```json
{
    "target_department_id": "3ff4d64b",
    "force": false
}
```

## Results

Calling the `POST /departments/:id/merge` endpoint will merge the given department with the target department and will return the full `department` object that is referring to the target department. If resources are affected by this merge, the endpoint will return a 409 error along with a list of those affected resources. To bypass this restriction, the client can set the `force` parameter to `true`

```json
{
    "id": "3ff4d64b",
    "name": "HR",
    "parent_id": null,
    "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/{id}/merge": {
      "post": {
        "summary": "/departments/:id/merge",
        "description": "Merges an existing department with a target one in your account. Required scope: `w_departments`. Accessible with all token types.",
        "operationId": "departments-merge",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "description": "The account subdomain",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "id",
            "in": "path",
            "description": "The department id that you want to merge with a target department",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target_department_id"
                ],
                "properties": {
                  "target_department_id": {
                    "type": "string",
                    "description": "The target department identifier that we want the given department id to be merged with"
                  },
                  "force": {
                    "type": "boolean",
                    "description": "When false then first will make a check to see if there are any affected resources with this action and then will return error with the affected resources, if any were found. When true then will bypass those affected resources and will proceed to the merge anyway"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "target_department_id": "3ff4d64b",
                    "force": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"3ff4d64b\",\n    \"name\": \"HR\",\n    \"parent_id\": null,\n    \"sample\": false\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "3ff4d64b"
                    },
                    "name": {
                      "type": "string",
                      "example": "HR"
                    },
                    "parent_id": {
                      "type": "string"
                    },
                    "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": ""
                  }
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"affected_resources\": [\n    \"collaboration_rules\"\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "affected_resources": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "collaboration_rules"
                      }
                    }
                  }
                }
              }
            }
          },
          "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
}
```