v1

latestOpenAPI 3.1.02026-07-2420077.8 KB
Cost centers

Update cost center

Updates a cost center. You can update the name, archive status, approver, delegate, and delegate expiry. Passing 'null' for 'approver_id', 'delegate_id', or 'delegate_expiry' does not clear those fields; they remain unchanged

patch/cost_centers/{id}

Path parameters

idstring required

The unique ID of the cost center

Headers

Authorizationstring required

Your Perk API key

Request body

namestring

The new name for the cost center

archiveboolean

Set to 'true' to archive the cost center, or 'false' to unarchive it

approver_idinteger

The ID of the user to set as approver. The user must belong to one of the cost center's companies. Passing 'null' does not clear the field

delegate_idinteger

The ID of the user to set as delegate. The delegate must belong to one of the cost center's companies. Passing 'null' does not clear the field

delegate_expirystring

The expiry date for the delegate in YYYY-MM-DD format. Passing 'null' does not clear the field

erp_codestring

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

Example request

{
  "name": "Finance",
  "approver_id": 123,
  "delegate_id": 456,
  "delegate_expiry": "2025-12-31",
  "erp_code": "CC-4210"
}

Response

Returns '200 OK' and the updated cost center resource.

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

delegate_idinteger

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

delegate_expirystring

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

usersobject[]

The users 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": "Finance",
  "approver_id": 123,
  "approver": {
    "id": 123,
    "first_name": "Alex",
    "last_name": "Chen",
    "email": "alex.chen@company.com"
  },
  "delegate_id": 456,
  "delegate": {
    "id": 456,
    "first_name": "Jordan",
    "last_name": "Smith",
    "email": "jordan.smith@company.com"
  },
  "delegate_expiry": "2025-12-31",
  "count_users": 1,
  "erp_code": "CC-4210"
}