Users Manage organization users, roles, and group/application assignments.
GET /api/v1/usersList organization users Bearer Token ▾
Returns a paginated list of users belonging to the current organization. Supports filtering by search term, role, and status.
Parameters Name Type Required Description searchstring Optional Search term to filter users by name or email.e.g. alice rolestring Optional Filter users by organization role.e.g. admin owneradminmemberviewer
statusstring Optional Filter users by account status.e.g. active pagenumber Optional Page number for pagination (1-indexed).e.g. 1 limitnumber Optional Number of results per page.e.g. 20
Response Fields Name Type Required Description dataUser[] Optional Array of user records for the current page. totalnumber Optional Total number of users matching the query. pagenumber Optional Current page number. limitnumber Optional Number of results per page.
Response Example {
"data": [
{
"id": "usr_01hx9z1q2w3e4r5t6y7u",
"email": "alice@example.com",
"firstName": "Alice",
"lastName": "Nguyen",
"role": "admin",
"status": "active",
"createdAt": "2024-01-15T09:30:00Z"
}
],
"total": 42,
"page": 1,
"limit": 20
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X GET "https://api.sutraid.com/api/v1/users?page=1&limit=20" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>"POST /api/v1/usersCreate user in organization Bearer Token ▾
Creates a new user account within the organization. Optionally assigns the user to groups and applications during creation.
Request Body Name Type Required Description emailstring Required Email address of the new user.e.g. bob@example.com firstNamestring Optional First name of the user.e.g. Bob lastNamestring Optional Last name of the user.e.g. Smith rolestring Optional Organization role to assign to the user.e.g. member owneradminmemberviewer
groupIdsstring[] Optional Array of group UUIDs to assign the user to at creation.e.g. ["grp_01hx9z1q2w3e4r5t6y7u"] applicationIdsstring[] Optional Array of application UUIDs the user should have access to.e.g. ["app_01hx9z1q2w3e4r5t6y7u"] onboardingMethodstring Optional Method used to onboard the user (e.g. magic_link, password).e.g. magic_link temporaryPasswordstring Optional Temporary password for password-based onboarding. User will be prompted to change on first login.e.g. Temp@12345
Response Fields Name Type Required Description idstring Optional Unique identifier of the created user. emailstring Optional Email address of the user. firstNamestring Optional First name. lastNamestring Optional Last name. rolestring Optional Assigned organization role. statusstring Optional Account status. createdAtstring Optional ISO 8601 creation timestamp.
Response Example {
"id": "usr_01hx9z1q2w3e4r5t6y7v",
"email": "bob@example.com",
"firstName": "Bob",
"lastName": "Smith",
"role": "member",
"status": "pending",
"createdAt": "2024-06-01T12:00:00Z"
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X POST "https://api.sutraid.com/api/v1/users" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>" \
-H "Content-Type: application/json" \
-d '{
"email": "bob@example.com",
"firstName": "Bob",
"lastName": "Smith",
"role": "member",
"onboardingMethod": "magic_link"
}'PUT /api/v1/users/:idUpdate user Bearer Token ▾
Updates the profile, role, status, or assignments of an existing user in the organization.
Parameters Name Type Required Description idstring (UUID) Required Unique identifier of the user to update.e.g. usr_01hx9z1q2w3e4r5t6y7u
Request Body Name Type Required Description firstNamestring Optional Updated first name.e.g. Alice lastNamestring Optional Updated last name.e.g. Johnson rolestring Optional New organization role for the user.e.g. admin owneradminmemberviewer
statusstring Optional New account status (e.g. active, suspended).e.g. active groupIdsstring[] Optional Replaces the user's group memberships with this list.e.g. ["grp_01hx9z1q2w3e4r5t6y7u"] applicationIdsstring[] Optional Replaces the user's application assignments with this list.e.g. ["app_01hx9z1q2w3e4r5t6y7u"]
Response Fields Name Type Required Description idstring Optional User identifier. emailstring Optional Email address. firstNamestring Optional Updated first name. lastNamestring Optional Updated last name. rolestring Optional Updated organization role. statusstring Optional Updated account status. updatedAtstring Optional ISO 8601 timestamp of last update.
Response Example {
"id": "usr_01hx9z1q2w3e4r5t6y7u",
"email": "alice@example.com",
"firstName": "Alice",
"lastName": "Johnson",
"role": "admin",
"status": "active",
"updatedAt": "2024-06-01T14:00:00Z"
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X PUT "https://api.sutraid.com/api/v1/users/usr_01hx9z1q2w3e4r5t6y7u" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Alice",
"lastName": "Johnson",
"role": "admin",
"status": "active"
}'DELETE /api/v1/users/:idDelete user Bearer Token ▾
Permanently removes a user from the organization. This action cannot be undone.
Parameters Name Type Required Description idstring (UUID) Required Unique identifier of the user to delete.e.g. usr_01hx9z1q2w3e4r5t6y7u
Response Fields Name Type Required Description messagestring Optional Confirmation message.e.g. User deleted
Response Example {
"message": "User deleted"
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X DELETE "https://api.sutraid.com/api/v1/users/usr_01hx9z1q2w3e4r5t6y7u" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>"PUT /api/v1/users/:id/groupsAssign groups to user Bearer Token ▾
Replaces all group memberships for a user with the provided list of group IDs.
Parameters Name Type Required Description idstring (UUID) Required Unique identifier of the user.e.g. usr_01hx9z1q2w3e4r5t6y7u
Request Body Name Type Required Description groupIdsstring[] Required Array of group UUIDs to assign to the user. Replaces existing group memberships.e.g. ["grp_01hx9z1q2w3e4r5t6y7u", "grp_02hx9z1q2w3e4r5t6y7v"]
Response Fields Name Type Required Description idstring Optional User identifier. groupsGroup[] Optional Updated list of groups the user belongs to.
Response Example {
"id": "usr_01hx9z1q2w3e4r5t6y7u",
"groups": [
{
"id": "grp_01hx9z1q2w3e4r5t6y7u",
"name": "Engineering"
},
{
"id": "grp_02hx9z1q2w3e4r5t6y7v",
"name": "Admins"
}
]
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X PUT "https://api.sutraid.com/api/v1/users/usr_01hx9z1q2w3e4r5t6y7u/groups" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>" \
-H "Content-Type: application/json" \
-d '{
"groupIds": [
"grp_01hx9z1q2w3e4r5t6y7u",
"grp_02hx9z1q2w3e4r5t6y7v"
]
}'PUT /api/v1/users/:id/applicationsAssign applications to user Bearer Token ▾
Replaces all application assignments for a user with the provided list of application IDs.
Parameters Name Type Required Description idstring (UUID) Required Unique identifier of the user.e.g. usr_01hx9z1q2w3e4r5t6y7u
Request Body Name Type Required Description applicationIdsstring[] Required Array of application UUIDs to assign to the user. Replaces existing application assignments.e.g. ["app_01hx9z1q2w3e4r5t6y7u", "app_02hx9z1q2w3e4r5t6y7v"]
Response Fields Name Type Required Description idstring Optional User identifier. applicationsApplication[] Optional Updated list of applications assigned to the user.
Response Example {
"id": "usr_01hx9z1q2w3e4r5t6y7u",
"applications": [
{
"id": "app_01hx9z1q2w3e4r5t6y7u",
"name": "Acme CRM"
},
{
"id": "app_02hx9z1q2w3e4r5t6y7v",
"name": "Internal Dashboard"
}
]
}Code Examples cURL Python Node.js Java Go PHP
Copy curl -X PUT "https://api.sutraid.com/api/v1/users/usr_01hx9z1q2w3e4r5t6y7u/applications" \
-H "Authorization: Bearer <your_token>" \
-H "x-org-id: <your_org_id>" \
-H "Content-Type: application/json" \
-d '{
"applicationIds": [
"app_01hx9z1q2w3e4r5t6y7u",
"app_02hx9z1q2w3e4r5t6y7v"
]
}'