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

# Set access configuration for a cost center

`PUT /cost_centers/{id}/access`

## Request

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

Updates the access configuration (access_type, user_ids, group_ids) for the cost center.

## Path parameters

- `id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `access_type` 'all' | 'specificUsers' | 'specificUsersOrUserGroups', required: The access type for the cost center. 'all' grants access to all users; 'specificUsers' restricts access to the listed 'user_ids'; 'specificUsersOrUserGroups' restricts access to the listed 'user_ids' and/or 'group_ids'.
  - `group_ids` string[]: The IDs of the user groups granted access to the cost center. Each group must exist within the account and be active. Must be empty when 'all' or 'specificUsers' 'access_type' is used. At least one of 'user_ids' or 'group_ids' is required when 'specificUsersOrUserGroups' is used.
  - `user_ids` integer[]: The IDs of the users granted access to the cost center. Must be positive integers. Must be empty when 'access_type' is 'all'. Required when 'access_type' is 'specificUsers' is used. At least one of 'user_ids' or 'group_ids' is required when 'specificUsersOrUserGroups' is used.

## Response `200`

Returns '200 OK' and the updated cost center resource with the new access configuration.

- object
  - `access_type` 'all' | 'specificUsers' | 'specificUsersOrUserGroups': The current access type for the cost center
  - `approver` object: Approver user details, or 'null' if not set
  - `approver_id` integer: The ID of the approver user, or 'null' if not set
  - `archived` boolean: Indicates whether the cost center is archived
  - `count_groups` integer: The number of user groups granted access to this cost center
  - `count_users` integer: The number of users assigned to this cost center
  - `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
  - `delegate_id` integer: The ID of the delegate user, or 'null' if not set
  - `erp_code` string: Identifier used to associate this cost center with a corresponding record in an external ERP system
  - `groups` object[]: The user groups granted access to this cost center
    - `id` string: The unique ID of the user group
    - `name` string: The name of the user group
  - `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.
  - `users` object[]: The users assigned to this cost center
    - `email` string: The user's email address
    - `first_name` string: The user's first name
    - `id` integer: The unique ID of the user
    - `last_name` string: The user's last name
    - `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
  - `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 the request body is 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)
