Users API Overview
Programmatically manage your users
The Users API allows you to invite and manage the users in your organization who need access to the DoiT Platform. Using the API for user invitations, updates, and deletes, rather than the DoiT console, eliminates manual effort, supports programmatic onboarding, and enables users to join the DoiT platform faster.
The List Roles and List Organizations methods enable you to identify the roleId and organizationId assigned to your users.
Required PermissionsUsers Manager
Operations
- GET /users/v1/list: Lists all users.
- POST /users/v1/invite: Invites a user.
- PATCH /users/v1/{id}: Updates a user.
- DELETE /users/v1/{id}: Deletes a user.
Examples
YOUR_API_KEYReplace "YOUR_API_KEY" with your actual API key as explained at Get Started
List all users
The List users method lists all users in your organization who can access the DoiT Platform.
Sample request:
curl --location \
--request GET 'https://api.doit.com/iam/v1/users' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--data-raw ''Sample response body:
{
"rowCount": 95,
"users": [
{
"id": "1abcd2G1881KQH4674x5",
"email": "[email protected]",
"roleId": "e66fNltAJjdtpHwaXb6I",
"status": "active"
},
{
"id": "28zy123457ZXKTFDbeYR",
"email": "[email protected]",
"displayName": "Alice Who",
"firstName": "Alice",
"lastName": "Who",
"language": "en",
"roleId": "59w2TJPTCa3XPsJ3KITY",
"status": "active"
},
{
"id": "user_003_mno345pqr678",
"displayName": "Bob Jones",
"firstName": "Robert",
"lastName": "Jones",
"email": "[email protected]",
"jobFunction": "Sales / Marketing",
"phone": "+44",
"phoneExtension": "236542515243",
"roleId": "2Bk5RQnMCxnk9wmOskMi",
"organizationId": "org_12345_example_main",
"status": "invited"
},
...]
}Response body fields
| Property | Description |
|---|---|
| id | stringThe unique ID of the user. |
| displayName | stringThe user's display name. |
| firstName | stringThe user's first name. |
| lastName | stringThe user's last name. |
stringThe user's email address. | |
| jobFunction | stringOne of the following job functions:
|
| phone | stringThe country code for the user's phone number. |
| phoneExtension | stringThe landline or mobile number for the user. |
| language | stringThe user's language preference.
|
| roleId | stringThe ID of the role assigned to the user. |
| organizationId | stringThe unique ID of the organization the user belongs to. |
| status | stringThe status of the user account. Possible values: active, invited, disabled. |
Update a user
The Update a user method updates a single user in your organization. The request only needs to contain the parameters that you want to update for the user. At least one parameter must be provided.
Sample request:
curl --location \
--request PATCH 'https://api.doit.com/iam/v1/users/{id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--data-raw '
{
"firstName": "John",
"lastName": "Doe",
"jobFunction": "Data engineer/Data Analysts",
"phone": "+44",
"phoneExtension": "2071234567",
"language": "en",
"roleId": "0Zi3OPnKAvli7ukMqiKg"
}
'Sample response body:
{
"message": "2qX2mzJXAPqsjF5P1LEY user was updated",
"user": {
"userId": "2qX2mzJXAPqsjF5P1LEY",
"displayName": "John Doe",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"jobFunction": "Data engineer/Data Analysts",
"phone": "+44",
"phoneExtension": "07452988658",
"language": "en",
"roleId": "GjM9ZwIyGeuXfBraOl47",
"organizationId": "Kp9fA2L0lVYGUZn5oEyU"
}
} Response body fields
| Property | Description |
|---|---|
| userID | stringThe unique ID for the user. |
| displayName | stringThe name displayed in the DoiT Platform. |
| firstName | stringThe user's first name. |
| lastName | stringThe user's last name. |
stringThe user's email address. | |
| jobFunction | stringOne of the following job functions:
|
| phone | stringThe country code for the user's phone number. |
| phoneExtension | stringThe landline or mobile number for the user. |
| language | stringThe user's language preference. Allowed values:
|
| roleId | stringThe ID of the role assigned to the user. |
| organizationId | stringThe unique ID of the organization the user belongs to. |