SutraID|Developer Docs
QuickstartAPI ReferenceDashboard

Groups

Manage user groups, membership, and application assignments.

GET/api/v1/groupsList organization groupsBearer Token

Returns a paginated list of groups belonging to the current organization. Supports filtering by search term.

Parameters

NameTypeRequiredDescription
searchstringOptionalSearch term to filter groups by name.e.g. engineering
pagenumberOptionalPage number for pagination (1-indexed).e.g. 1
limitnumberOptionalNumber of results per page.e.g. 20

Response Fields

NameTypeRequiredDescription
dataGroup[]OptionalArray of group records for the current page.
totalnumberOptionalTotal number of groups matching the query.
pagenumberOptionalCurrent page number.
limitnumberOptionalNumber of results per page.

Response Example

{
  "data": [
    {
      "id": "grp_01hx9z1q2w3e4r5t6y7u",
      "name": "Engineering",
      "description": "Core engineering team",
      "memberCount": 12,
      "createdAt": "2024-01-10T08:00:00Z"
    }
  ],
  "total": 8,
  "page": 1,
  "limit": 20
}

Code Examples

curl -X GET "https://api.sutraid.com/api/v1/groups?page=1&limit=20" \
  -H "Authorization: Bearer <your_token>" \
  -H "x-org-id: <your_org_id>"
POST/api/v1/groupsCreate groupBearer Token

Creates a new group within the organization. Groups can be used to manage bulk access to applications.

Request Body

NameTypeRequiredDescription
namestringRequiredName of the group. Maximum 100 characters.e.g. Engineering
descriptionstringOptionalOptional description of the group. Maximum 500 characters.e.g. Core engineering team with access to all developer tooling.

Response Fields

NameTypeRequiredDescription
idstringOptionalUnique identifier of the created group.
namestringOptionalName of the group.
descriptionstringOptionalDescription of the group.
memberCountnumberOptionalNumber of members in the group.
createdAtstringOptionalISO 8601 creation timestamp.

Response Example

{
  "id": "grp_01hx9z1q2w3e4r5t6y7u",
  "name": "Engineering",
  "description": "Core engineering team with access to all developer tooling.",
  "memberCount": 0,
  "createdAt": "2024-06-01T12:00:00Z"
}

Code Examples

curl -X POST "https://api.sutraid.com/api/v1/groups" \
  -H "Authorization: Bearer <your_token>" \
  -H "x-org-id: <your_org_id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Engineering",
    "description": "Core engineering team with access to all developer tooling."
  }'
PUT/api/v1/groups/:idUpdate groupBearer Token

Updates the name or description of an existing group.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the group to update.e.g. grp_01hx9z1q2w3e4r5t6y7u

Request Body

NameTypeRequiredDescription
namestringOptionalUpdated group name. Maximum 100 characters.e.g. Platform Engineering
descriptionstringOptionalUpdated group description. Maximum 500 characters.e.g. Platform and infrastructure team.

Response Fields

NameTypeRequiredDescription
idstringOptionalGroup identifier.
namestringOptionalUpdated group name.
descriptionstringOptionalUpdated group description.
updatedAtstringOptionalISO 8601 timestamp of last update.

Response Example

{
  "id": "grp_01hx9z1q2w3e4r5t6y7u",
  "name": "Platform Engineering",
  "description": "Platform and infrastructure team.",
  "updatedAt": "2024-06-01T15:00:00Z"
}

Code Examples

curl -X PUT "https://api.sutraid.com/api/v1/groups/grp_01hx9z1q2w3e4r5t6y7u" \
  -H "Authorization: Bearer <your_token>" \
  -H "x-org-id: <your_org_id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform Engineering",
    "description": "Platform and infrastructure team."
  }'
DELETE/api/v1/groups/:idDelete groupBearer Token

Permanently deletes a group from the organization. All user memberships and application assignments for this group are also removed.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the group to delete.e.g. grp_01hx9z1q2w3e4r5t6y7u

Response Fields

NameTypeRequiredDescription
messagestringOptionalConfirmation message.e.g. Group deleted

Response Example

{
  "message": "Group deleted"
}

Code Examples

curl -X DELETE "https://api.sutraid.com/api/v1/groups/grp_01hx9z1q2w3e4r5t6y7u" \
  -H "Authorization: Bearer <your_token>" \
  -H "x-org-id: <your_org_id>"
PUT/api/v1/groups/:id/usersSet group membersBearer Token

Replaces the entire set of members for a group with the provided list of user IDs. Any users not in the list will be removed from the group.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the group.e.g. grp_01hx9z1q2w3e4r5t6y7u

Request Body

NameTypeRequiredDescription
userIdsstring[]RequiredArray of user UUIDs to set as group members. Replaces the existing membership list entirely.e.g. ["usr_01hx9z1q2w3e4r5t6y7u", "usr_02hx9z1q2w3e4r5t6y7v"]

Response Fields

NameTypeRequiredDescription
idstringOptionalGroup identifier.
usersUser[]OptionalUpdated list of users in the group.

Response Example

{
  "id": "grp_01hx9z1q2w3e4r5t6y7u",
  "users": [
    {
      "id": "usr_01hx9z1q2w3e4r5t6y7u",
      "email": "alice@example.com",
      "firstName": "Alice",
      "lastName": "Nguyen"
    },
    {
      "id": "usr_02hx9z1q2w3e4r5t6y7v",
      "email": "bob@example.com",
      "firstName": "Bob",
      "lastName": "Smith"
    }
  ]
}

Code Examples

curl -X PUT "https://api.sutraid.com/api/v1/groups/grp_01hx9z1q2w3e4r5t6y7u/users" \
  -H "Authorization: Bearer <your_token>" \
  -H "x-org-id: <your_org_id>" \
  -H "Content-Type: application/json" \
  -d '{
    "userIds": [
      "usr_01hx9z1q2w3e4r5t6y7u",
      "usr_02hx9z1q2w3e4r5t6y7v"
    ]
  }'
PUT/api/v1/groups/:id/applicationsSet group applicationsBearer Token

Replaces all application assignments for a group with the provided list of application IDs. All members of the group will inherit access to the specified applications.

Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the group.e.g. grp_01hx9z1q2w3e4r5t6y7u

Request Body

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

Response Fields

NameTypeRequiredDescription
idstringOptionalGroup identifier.
applicationsApplication[]OptionalUpdated list of applications assigned to the group.

Response Example

{
  "id": "grp_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/groups/grp_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"
    ]
  }'