Skip to content

Roles

Roles are descriptive labels for people, such as Designer, Senior or QA. They group people in the Team section and in reports, and grant no access: what a person may do is set by their permission profile.

Reading roles needs the permission to see team members (view-team-member), which the Admin, Manager, Member, Accounting and People Admin profiles have by default; so by default members, managers and administrators can all read them. Creating, renaming, recolouring and deleting roles, and changing who holds them, needs the permission to edit team members (edit-team-member), which administrators have by default. Giving or taking away a role never changes anyone’s access.

A descriptive label held by people on the team.

Field Type Description
id string The role’s id. Read only.
name string Role name, up to 100 characters, unique in the business.
badgeColor string The badge colour as a hex value #RRGGBB, such as #97E3AF, or an empty string when the role has no colour.
memberCount integer How many people hold the role. Read only.
members array of object Everyone who holds the role, each { id, name }, where id is the team member id.
createdAt datetime When the role was created. Read only.
updatedAt datetime When the role was last renamed, recoloured or had its people changed. Read only.

Returns every role in the business, A to Z by name, each with the people who hold it.

GET /v1/team-roles

Parameters

Parameter In Type Required Description
page query integer No Page number, from 1. Default 1.
limit query integer No Records per page. Default 20, at most 1000.
search query string No Only roles whose name contains this text.
sortField query string No name (default) or createdAt.
sortOrder query string No asc (default) or desc.
updatedSince query datetime No Only roles changed at or after this moment. Records deleted since then are not reported.

Rules

  • 403 when the token’s person does not have the permission to see team members (view-team-member).

Example request

Terminal window
curl "https://api.onesuite.io/v1/team-roles" \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"data": [
{
"id": "cmh0x7t2b0001v5m3ds4k8n6d",
"name": "Designer",
"badgeColor": "#97E3AF",
"memberCount": 2,
"members": [
{
"id": "cmh2k8w1q0004s6l0an4x7d2e",
"name": "Ana Ortega"
},
{
"id": "cmh2k8w1q0007s6l0bn9r3c5f",
"name": "Ben Adeyemi"
}
],
"createdAt": "2026-02-10T11:00:00.000Z",
"updatedAt": "2026-10-01T09:30:12.774Z"
},
{
"id": "cmh0x7t2b0003v5m3dv7p2q1e",
"name": "Developer",
"badgeColor": "",
"memberCount": 1,
"members": [
{
"id": "cmh2k8w1q000as6l0cq2h8v1g",
"name": "Chen Wu"
}
],
"createdAt": "2026-02-10T11:00:05.000Z",
"updatedAt": "2026-02-10T11:00:05.000Z"
}
],
"totalCount": 2,
"page": 1,
"limit": 20
}

Returns one role with the people who hold it.

GET /v1/team-roles/:id

Parameters

Parameter In Type Required Description
id path string Yes The role’s id.

Rules

  • 403 when the token’s person does not have the permission to see team members (view-team-member).
  • 404 when the role does not exist in this business.

Example request

Terminal window
curl "https://api.onesuite.io/v1/team-roles/cmh0x7t2b0001v5m3ds4k8n6d" \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"data": {
"id": "cmh0x7t2b0001v5m3ds4k8n6d",
"name": "Designer",
"badgeColor": "#97E3AF",
"memberCount": 2,
"members": [
{
"id": "cmh2k8w1q0004s6l0an4x7d2e",
"name": "Ana Ortega"
},
{
"id": "cmh2k8w1q0007s6l0bn9r3c5f",
"name": "Ben Adeyemi"
}
],
"createdAt": "2026-02-10T11:00:00.000Z",
"updatedAt": "2026-10-01T09:30:12.774Z"
}
}

Creates a role and, optionally, gives it to people. Answers 201 with the new role.

POST /v1/team-roles

Parameters

Parameter In Type Required Description
name body string Yes The role’s name, 1 to 100 characters after trimming spaces, unique in the business.
badgeColor body string No Hex colour #RRGGBB, or an empty string for no colour. Default #97E3AF.
memberIds body array of string No Team member ids of the people who should hold the role.

Rules

  • 403 when the token’s person does not have the permission to edit team members (edit-team-member).
  • 400 when the name is empty or longer than 100 characters, or the colour is not a hex value #RRGGBB.
  • 400 naming any memberIds that are not team members of this business.
  • 409 “A role with that name already exists” when another role has the same name.

Example request

Terminal window
curl "https://api.onesuite.io/v1/team-roles" \
-X POST \
-H "X-API-Key: $ONESUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"QA","badgeColor":"#F5C26B","memberIds":["cmh2k8w1q000as6l0cq2h8v1g"]}'

Example response — status 201

{
"data": {
"id": "cmh7f7x4j0001e2t0ro3r4s5t",
"name": "QA",
"badgeColor": "#F5C26B",
"memberCount": 1,
"members": [
{
"id": "cmh2k8w1q000as6l0cq2h8v1g",
"name": "Chen Wu"
}
],
"createdAt": "2026-11-20T11:02:00.330Z",
"updatedAt": "2026-11-20T11:02:00.330Z"
}
}

Renames or recolours a role, or changes who holds it. Send only the fields to change. memberIds replaces the whole set of people; an empty list leaves nobody holding the role.

PATCH /v1/team-roles/:id

Parameters

Parameter In Type Required Description
id path string Yes The role’s id.
name body string No New name, 1 to 100 characters after trimming spaces, unique in the business.
badgeColor body string No New colour as #RRGGBB, or an empty string for no colour.
memberIds body array of string No Team member ids of everyone who should hold the role.

Rules

  • 403 when the token’s person does not have the permission to edit team members (edit-team-member).
  • 400 “Nothing to update” when no field is sent.
  • 400 when the name is empty or longer than 100 characters, or the colour is not a hex value #RRGGBB.
  • 400 naming any memberIds that are not team members of this business.
  • 409 “A role with that name already exists” when another role has the new name.
  • 404 when the role does not exist in this business.

Example request

Terminal window
curl "https://api.onesuite.io/v1/team-roles/cmh0x7t2b0001v5m3ds4k8n6d" \
-X PATCH \
-H "X-API-Key: $ONESUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Product designer","memberIds":["cmh2k8w1q0004s6l0an4x7d2e"]}'

Example response — status 200

{
"data": {
"id": "cmh0x7t2b0001v5m3ds4k8n6d",
"name": "Product designer",
"badgeColor": "#97E3AF",
"memberCount": 1,
"members": [
{
"id": "cmh2k8w1q0004s6l0an4x7d2e",
"name": "Ana Ortega"
}
],
"createdAt": "2026-02-10T11:00:00.000Z",
"updatedAt": "2026-11-20T11:05:44.120Z"
}
}

Deletes a role. The people who held it lose the label and nothing else; their access does not change.

DELETE /v1/team-roles/:id

Parameters

Parameter In Type Required Description
id path string Yes The role’s id.

Rules

  • 403 when the token’s person does not have the permission to edit team members (edit-team-member).
  • 404 when the role does not exist in this business.

Example request

Terminal window
curl "https://api.onesuite.io/v1/team-roles/cmh0x7t2b0003v5m3dv7p2q1e" \
-X DELETE \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"message": "Role deleted"
}