How do I manage company users via the API?
Company admins can list users, change their department or role, disable or enable them, and remove them from the company through the API. To do this in the web app instead, see How do I add, remove or change users?.
Before you start
Every request needs these headers. The token must belong to an admin of the company.
Authorization: JWT {adminToken}
x-namespace: /companies/{companyId}
Content-Type: application/json
See API authentication for how to get a token.
List all users
GET https://app.verified.eu/api/companies/{companyId}
The users are listed under result.employees[]. Each user's employee ID there is what you use in the requests below.
Change a user
| Action | Request | Body |
|---|---|---|
| Change department | PUT /api/companies/{companyId}/employees/{employeeId}/department | {"department": "Sales"} |
| Change role | PUT /api/companies/{companyId}/employees/{employeeId}/role | {"role": "regular"} admin, privileged or regular |
| Disable user | PUT /api/companies/{companyId}/employees/{employeeId}/status/disabled | {} |
| Enable user | PUT /api/companies/{companyId}/employees/{employeeId}/status/enabled | {} |
| Remove user | DELETE /api/companies/{companyId}/employees/{employeeId} | none |
All paths start with https://app.verified.eu. For what each role can do, see Which user levels and permissions are there?.
If a user may need access again later, disable them instead of removing them.