POST
/api/public/v1/employees/{employeeId}/deactivate

Deactivate an employee

Takes somebody off the company. Their scope grants go with them in the same transaction — a deactivated employee who kept their grants would still be able to act if they were ever reactivated by accident. The owner cannot be deactivated: there would be nobody left holding every scope. Bringing somebody back is a re-invitation, not an undo.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

employees:write

Path Parameters

NameTypeRequiredDescription
employeeIdstringRequiredEmployee ID.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/employees/{employeeId}/deactivate" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Employee deactivated!",
  "content": {
    "employeeId": "emp_44f1"
  }
}
400Example response
json
{
  "message": "Cannot deactivate the company owner"
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Employees → Directory
/employee/directory
  1. Open the ⋯ menu on an employee → Remove from company.