v1

latestOpenAPI 3.1.02026-07-2420077.8 KB
Cost centers

Set users to a cost center

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

put/cost_centers/{id}/users

Path parameters

idstring required

The unique ID of the cost center

Headers

Authorizationstring required

Your Perk API key

Request body

user_idsinteger[]

The IDs of the users to assign to the cost center

Example request

{
  "user_ids": [
    42,
    43,
    44
  ]
}

Response

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

idstring

The unique ID of the cost center

namestring

The name of the cost center

archivedboolean

Indicates whether the cost center is archived

approver_idinteger

The ID of the approver user, or 'null' if not set

approverobject

Approver user details, or 'null' if not set

delegate_idinteger

The ID of the delegate user, or 'null' if not set

delegateobject

Delegate user details, or 'null' if not set

delegate_expirystring

The expiry date for the delegate in YYYY-MM-DD format, or 'null' if not set

all_companiesboolean

If 'true', the cost center applies to all companies in the account

companiesobject[]

The list of companies assigned to this cost center

count_usersinteger

The number of users assigned to this cost center

erp_codestring

Identifier used to associate this cost center with a corresponding record in an external ERP system

Example response

{
  "id": "1",
  "name": "Marketing",
  "all_companies": true,
  "users": [
    {
      "id": 42,
      "first_name": "Alex",
      "last_name": "Chen",
      "email": "alex.chen@company.com"
    }
  ],
  "count_users": 3,
  "erp_code": "CC-4210"
}