---
title: "Bulk update cost centers"
method: PATCH
path: "/cost_centers/bulk_update"
tags: ["Cost centers"]
---

# Bulk update cost centers

`PATCH /cost_centers/bulk_update`

## Request

- Base URL: `https://api.perk.com`
- URL: `https://api.perk.com/cost_centers/bulk_update`
- Auth: none declared. Required headers: `Authorization`

Updates a list of cost centers in a single request. You can archive or unarchive them and/or set their cost object type (`type`) when that feature is enabled for your organization. Returns the number of cost centers updated. When cost object types are enabled, provide at least one of `archive` or a non-null `type`. When the feature is not enabled, `archive` remains required.

## Headers

- `Authorization` string, required

## Request body

- object
  - `archive` boolean: Set to 'true' to archive the cost centers, or 'false' to unarchive them. Omit to leave archive state unchanged. Required when cost object types are not enabled for your organization.
  - `id_list` integer[], required: The IDs of the cost centers to update
  - `type` string, nullable: Cost object type name to set on all cost centers in `id_list`. Available only when cost object types are enabled for your organization on request. Non-empty string (max 256 characters). If a type with that name already exists (case-insensitive), it is assigned; otherwise it is created. Omit or null leaves types unchanged. When the feature is enabled, provide at least one of `archive` or a non-null `type`. If any listed cost center is Yokoy-sourced and `type` is set, the request fails with 400 (all-or-nothing).

## Response `200`

Returns '200 OK' and the number of cost centers updated.

- object
  - `updated_count` integer: The number of cost centers successfully updated

## Other responses

- `400`: Returns '400 Bad Request' when the request body is invalid (for example missing id_list, neither archive nor type when types are enabled, blank/overlong type, or setting type when any listed cost center is Yokoy-sourced).

---

[API](https://skmtc.dev/perk/apis/cost-centers-api.md) - [All operations](https://skmtc.dev/perk/apis/cost-centers-api/llms.txt) - [OpenAPI document](https://skmtc.dev/perk/apis/cost-centers-api/revisions/5b6beec99973?raw)
