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.
Who can use it
Section titled “Who can use it”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.
The team role object
Section titled “The team role object”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. |
Endpoints
Section titled “Endpoints”List roles
Section titled “List roles”Returns every role in the business, A to Z by name, each with the people who hold it.
GET /v1/team-rolesParameters
| 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
403when the token’s person does not have the permission to see team members (view-team-member).
Example request
curl "https://api.onesuite.io/v1/team-roles" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/team-roles", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();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}Get a role
Section titled “Get a role”Returns one role with the people who hold it.
GET /v1/team-roles/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The role’s id. |
Rules
403when the token’s person does not have the permission to see team members (view-team-member).404when the role does not exist in this business.
Example request
curl "https://api.onesuite.io/v1/team-roles/cmh0x7t2b0001v5m3ds4k8n6d" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/team-roles/cmh0x7t2b0001v5m3ds4k8n6d", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();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" }}Create a role
Section titled “Create a role”Creates a role and, optionally, gives it to people. Answers 201 with the new role.
POST /v1/team-rolesParameters
| 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
403when the token’s person does not have the permission to edit team members (edit-team-member).400when the name is empty or longer than 100 characters, or the colour is not a hex value#RRGGBB.400naming anymemberIdsthat are not team members of this business.409“A role with that name already exists” when another role has the same name.
Example request
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"]}'const response = await fetch("https://api.onesuite.io/v1/team-roles", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "QA", badgeColor: "#F5C26B", memberIds: [ "cmh2k8w1q000as6l0cq2h8v1g", ], }),});const data = await response.json();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" }}Update a role
Section titled “Update a role”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/:idParameters
| 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
403when 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.400when the name is empty or longer than 100 characters, or the colour is not a hex value#RRGGBB.400naming anymemberIdsthat are not team members of this business.409“A role with that name already exists” when another role has the new name.404when the role does not exist in this business.
Example request
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"]}'const response = await fetch("https://api.onesuite.io/v1/team-roles/cmh0x7t2b0001v5m3ds4k8n6d", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Product designer", memberIds: [ "cmh2k8w1q0004s6l0an4x7d2e", ], }),});const data = await response.json();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" }}Delete a role
Section titled “Delete a role”Deletes a role. The people who held it lose the label and nothing else; their access does not change.
DELETE /v1/team-roles/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The role’s id. |
Rules
403when the token’s person does not have the permission to edit team members (edit-team-member).404when the role does not exist in this business.
Example request
curl "https://api.onesuite.io/v1/team-roles/cmh0x7t2b0003v5m3dv7p2q1e" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/team-roles/cmh0x7t2b0003v5m3dv7p2q1e", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "Role deleted"}