SutraID|Developer Docs
QuickstartAPI ReferenceDashboard

Users

Manage organization users, roles, and group/application assignments.

GET/api/v1/usersList organization usersBearer Token

Returns a paginated list of users belonging to the current organization. Supports filtering by search term, role, and status.

Parameters

NameTypeRequiredDescription
searchstringOptionalSearch term to filter users by name or email.e.g. alice
rolestringOptionalFilter users by organization role.e.g. admin
owneradminmemberviewer
statusstringOptionalFilter users by account status.e.g. active
pagenumberOptionalPage number for pagination (1-indexed).e.g. 1
limitnumberOptionalNumber of results per page.e.g. 20

Response Fields

NameTypeRequiredDescription
dataUser[]OptionalArray of user records for the current page.
totalnumberOptionalTotal number of users matching the query.
pagenumberOptionalCurrent page number.
limitnumberOptionalNumber 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 -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 organizationBearer Token

Creates a new user account within the organization. Optionally assigns the user to groups and applications during creation.

Request Body

NameTypeRequiredDescription
emailstringRequiredEmail address of the new user.e.g. bob@example.com
firstNamestringOptionalFirst name of the user.e.g. Bob
lastNamestringOptionalLast name of the user.e.g. Smith
rolestringOptionalOrganization role to assign to the user.e.g. member
owneradminmemberviewer
groupIdsstring[]OptionalArray of group UUIDs to assign the user to at creation.e.g. ["grp_01hx9z1q2w3e4r5t6y7u"]
applicationIdsstring[]OptionalArray of application UUIDs the user should have access to.e.g. ["app_01hx9z1q2w3e4r5t6y7u"]
onboardingMethodstringOptionalMethod used to onboard the user (e.g. magic_link, password).e.g. magic_link
temporaryPasswordstringOptionalTemporary password for password-based onboarding. User will be prompted to change on first login.e.g. Temp@12345

Response Fields

NameTypeRequiredDescription
idstringOptionalUnique identifier of the created user.
emailstringOptionalEmail address of the user.
firstNamestringOptionalFirst name.
lastNamestringOptionalLast name.
rolestringOptionalAssigned organization role.
statusstringOptionalAccount status.
createdAtstringOptionalISO 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 -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 userBearer Token

Updates the profile, role, status, or assignments of an existing user in the organization.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the user to update.e.g. usr_01hx9z1q2w3e4r5t6y7u

Request Body

NameTypeRequiredDescription
firstNamestringOptionalUpdated first name.e.g. Alice
lastNamestringOptionalUpdated last name.e.g. Johnson
rolestringOptionalNew organization role for the user.e.g. admin
owneradminmemberviewer
statusstringOptionalNew account status (e.g. active, suspended).e.g. active
groupIdsstring[]OptionalReplaces the user's group memberships with this list.e.g. ["grp_01hx9z1q2w3e4r5t6y7u"]
applicationIdsstring[]OptionalReplaces the user's application assignments with this list.e.g. ["app_01hx9z1q2w3e4r5t6y7u"]

Response Fields

NameTypeRequiredDescription
idstringOptionalUser identifier.
emailstringOptionalEmail address.
firstNamestringOptionalUpdated first name.
lastNamestringOptionalUpdated last name.
rolestringOptionalUpdated organization role.
statusstringOptionalUpdated account status.
updatedAtstringOptionalISO 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 -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 userBearer Token

Permanently removes a user from the organization. This action cannot be undone.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the user to delete.e.g. usr_01hx9z1q2w3e4r5t6y7u

Response Fields

NameTypeRequiredDescription
messagestringOptionalConfirmation message.e.g. User deleted

Response Example

{
  "message": "User deleted"
}

Code Examples

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 userBearer Token

Replaces all group memberships for a user with the provided list of group IDs.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the user.e.g. usr_01hx9z1q2w3e4r5t6y7u

Request Body

NameTypeRequiredDescription
groupIdsstring[]RequiredArray of group UUIDs to assign to the user. Replaces existing group memberships.e.g. ["grp_01hx9z1q2w3e4r5t6y7u", "grp_02hx9z1q2w3e4r5t6y7v"]

Response Fields

NameTypeRequiredDescription
idstringOptionalUser identifier.
groupsGroup[]OptionalUpdated 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 -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 userBearer Token

Replaces all application assignments for a user with the provided list of application IDs.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the user.e.g. usr_01hx9z1q2w3e4r5t6y7u

Request Body

NameTypeRequiredDescription
applicationIdsstring[]RequiredArray of application UUIDs to assign to the user. Replaces existing application assignments.e.g. ["app_01hx9z1q2w3e4r5t6y7u", "app_02hx9z1q2w3e4r5t6y7v"]

Response Fields

NameTypeRequiredDescription
idstringOptionalUser identifier.
applicationsApplication[]OptionalUpdated 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 -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"
    ]
  }'