Bulk update cost centers

Updates a list of cost centers in a single request. You can archive or unarchive them, and set their usage, approval limits, parent cost center, technical custom field values (custom_information), and cost object type (type) when that feature is enabled for your organization. Every value is applied to all cost centers in id_list. Provide at least one of archive, type, usage, approval_limit, auto_approval_limit, parent_id or custom_information. id_list accepts at most 100 IDs; larger lists are rejected with 400. Validation is per cost center and all-or-nothing: if any listed cost center fails, nothing is changed and the 400 response names the offending cost center ID. Listed cost centers are updated even when archived, so this endpoint can also un-archive them. Cost centers that already hold every requested value are skipped; the response returns the number of cost centers actually changed. Writes take a flat object plus company_id; responses return custom_information as a list grouped per company, [{company_id, fields}], where boolean values are returned as the strings "true"/"false".

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
boolean

Set to 'true' to archive the cost centers, or 'false' to unarchive them. Required (present and of type boolean) when cost object types are not enabled for your organization; when they are enabled it may be omitted to leave archive state unchanged.

id_list
array of integers
required
length ≤ 100

The IDs of the cost centers to update (at most 100). Archived cost centers are updated too.

id_list*
string | null

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. If any listed cost center is Yokoy-sourced and type is set, the request fails with 400 (all-or-nothing).

usage
array of strings | null

Usage to set on every listed cost center: any of 'travel', 'expenses', 'invoices'. Omit or null to leave unchanged.

usage
Allowed:
number | null
≥ 0

Approval limit to set on every listed cost center. Omit to leave unchanged; pass null or "" to clear. Only valid when usage includes 'expenses' or 'invoices' on each cost center (submitted in this request or already persisted).

number | null
≥ 0

Auto-approval limit to set on every listed cost center. Omit to leave unchanged; pass null or "" to clear. Only valid when usage includes 'expenses' or 'invoices' on each cost center (submitted in this request or already persisted).

integer | null

The ID of the parent cost center to set on every listed cost center. Omit to leave unchanged; pass null or "" to clear. Returns 400 for travel-only accounts unless the cost center hierarchies feature is enabled, including when null.

custom_information
object | null

Technical custom field values keyed by field name, applied to every listed cost center. Omit to leave unchanged; a null or "" value clears that key. Booleans are written as true/false. Usage must include 'expenses' or 'invoices' on every listed cost center (submitted or persisted), and every key must be an existing technical custom field for the target company. Writes take a flat object plus company_id; responses return custom_information as a list grouped per company, [{company_id, fields}], where boolean values are returned as the strings "true"/"false".

integer | null

The company the custom_information values apply to. Required with custom_information when a listed cost center is scoped to several companies; must be one of each listed cost center's companies.

Headers
string
required

Your Perk API key

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json