---
title: "Set users to a cost center"
method: PUT
path: "/cost_centers/{id}/users"
tags: ["Cost centers"]
---

# Set users to a cost center

`PUT /cost_centers/{id}/users`

## Request

- Base URL: `https://api.perk.com`
- URL: `https://api.perk.com/cost_centers/{id}/users`
- Auth: none declared. Required headers: `Authorization`

Replaces all users assigned to the cost center with the provided list. Any users not in the list are removed from the cost center

## Path parameters

- `id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `user_ids` integer[]: The IDs of the users to assign to the cost center

## Response `200`

Returns '200 OK' and the updated cost center resource with the new user list

- object
  - `id` string: The unique ID of the cost center
  - `name` string: The name of the cost center
  - `type` string, nullable: Cost object type name, or null if unset. Available only when cost object types are enabled for your organization on request. Omitted from the response when the feature is not enabled.
  - `archived` boolean: Indicates whether the cost center is archived
  - `approver_id` integer: The ID of the approver user, or 'null' if not set
  - `approver` object: Approver user details, or 'null' if not set
  - `delegate_id` integer: The ID of the delegate user, or 'null' if not set
  - `delegate` object: Delegate user details, or 'null' if not set
  - `delegate_expiry` string: The expiry date for the delegate in YYYY-MM-DD format, or 'null' if not set
  - `all_companies` boolean: If 'true', the cost center applies to all companies in the account
  - `companies` integer[]: The IDs of companies assigned to this cost center
  - `users` object[]: The users assigned to this cost center
    - `id` integer: The unique ID of the user
    - `first_name` string: The user's first name
    - `last_name` string: The user's last name
    - `email` string: The user's email address
    - `phone` string: The user's phone number, or 'null' if not set
    - `profile_picture` string: The URL of the user's profile picture, or 'null' if not set
  - `count_users` integer: The number of users assigned to this cost center
  - `erp_code` string: Identifier used to associate this cost center with a corresponding record in an external ERP system
  - `owner_ids` integer[]: IDs of additional travel approvers
  - `owners` object[]: Additional travel approver user details (id, first_name, last_name, email)
    - `id` integer: The unique ID of the additional approver
    - `first_name` string: The additional approver's first name
    - `last_name` string: The additional approver's last name
    - `email` string: The additional approver's email address

## Other responses

- `400`: Returns '400 Bad Request' when one or more user IDs are invalid.

---

[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)
