Docs / API objects
Roles
List and change your teams. The Harvest API calls a team a role.
A role here is a team. A team gives its people access to the team's projects.
List roles
GET
/ api/ v2/ rolesDiffers from Harvest
Roles are the app's teams. A member is refused (403).
Query parameters
| Name | Type | Description |
|---|---|---|
updated_sincedatetimeOptional | datetime | Only records changed at or after this ISO 8601 date-time. A value that is not a date-time is refused with 400. |
pageintegerOptional | integer | The page to return, from 1. Default 1. A page past the end returns no records. |
per_pageintegerOptional | integer | Records per page, 1 to 2000. Default 2000. Another value is refused with 400. |
Returns
Status 200 with a page of role objects under roles, and the pagination fields.
curl "https://t.momentic.studio/api/v2/roles" \
-H "Authorization: Bearer $TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (admin@example.com)"const response = await fetch("https://t.momentic.studio/api/v2/roles", {
headers: {
"Authorization": `Bearer ${process.env.TOKEN}`,
"Harvest-Account-Id": process.env.ACCOUNT_ID,
"User-Agent": "MyApp (admin@example.com)",
},
});
const data = await response.json();import os
import requests
response = requests.get(
"https://t.momentic.studio/api/v2/roles",
headers={
"Authorization": f"Bearer {os.environ['TOKEN']}",
"Harvest-Account-Id": os.environ["ACCOUNT_ID"],
"User-Agent": "MyApp (admin@example.com)",
},
)
data = response.json(){
"roles": [
{
"id": 7001,
"name": "Design",
"user_ids": [
1001
],
"created_at": "2026-01-05T15:00:00Z",
"updated_at": "2026-01-05T15:00:00Z"
}
],
"per_page": 2000,
"total_pages": 1,
"total_entries": 1,
"next_page": null,
"previous_page": null,
"page": 1,
"links": {
"first": "https://t.momentic.studio/api/v2/roles?page=1&per_page=2000&ref=first",
"next": null,
"previous": null,
"last": "https://t.momentic.studio/api/v2/roles?page=1&per_page=2000&ref=last"
}
}curl "https://t.momentic.studio/api/v2/roles/7001" \
-H "Authorization: Bearer $TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (admin@example.com)"const response = await fetch("https://t.momentic.studio/api/v2/roles/7001", {
headers: {
"Authorization": `Bearer ${process.env.TOKEN}`,
"Harvest-Account-Id": process.env.ACCOUNT_ID,
"User-Agent": "MyApp (admin@example.com)",
},
});
const data = await response.json();import os
import requests
response = requests.get(
"https://t.momentic.studio/api/v2/roles/7001",
headers={
"Authorization": f"Bearer {os.environ['TOKEN']}",
"Harvest-Account-Id": os.environ["ACCOUNT_ID"],
"User-Agent": "MyApp (admin@example.com)",
},
)
data = response.json(){
"id": 7001,
"name": "Design",
"user_ids": [
1001
],
"created_at": "2026-01-05T15:00:00Z",
"updated_at": "2026-01-05T15:00:00Z"
}Create a role
POST
/ api/ v2/ rolesDiffers from Harvest
Creates a team. A team gives its people access to the team's projects.
Body, as JSON or form fields
| Name | Type | Description |
|---|---|---|
namestringRequired | string | The team's name, up to 60 characters. |
user_idsinteger[]Optional | integer[] | Its people. |
Returns
Status 201 with a role object.
curl -X POST "https://t.momentic.studio/api/v2/roles" \
-H "Authorization: Bearer $TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (admin@example.com)" \
-H "Content-Type: application/json" \
-d '{"name":"Example Client"}'const response = await fetch("https://t.momentic.studio/api/v2/roles", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TOKEN}`,
"Harvest-Account-Id": process.env.ACCOUNT_ID,
"User-Agent": "MyApp (admin@example.com)",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Example Client",
}),
});
const data = await response.json();import os
import requests
response = requests.post(
"https://t.momentic.studio/api/v2/roles",
headers={
"Authorization": f"Bearer {os.environ['TOKEN']}",
"Harvest-Account-Id": os.environ["ACCOUNT_ID"],
"User-Agent": "MyApp (admin@example.com)",
},
json={
"name": "Example Client",
},
)
data = response.json(){
"id": 7001,
"name": "Design",
"user_ids": [
1001
],
"created_at": "2026-01-05T15:00:00Z",
"updated_at": "2026-01-05T15:00:00Z"
}Update a role
PATCH
/ api/ v2/ roles/ {role_id}Differs from Harvest
Body, as JSON or form fields
| Name | Type | Description |
|---|---|---|
namestringOptional | string | The team's name. |
user_idsinteger[]Optional | integer[] | Its people; replaces the list. |
Returns
Status 200 with a role object.
curl -X PATCH "https://t.momentic.studio/api/v2/roles/7001" \
-H "Authorization: Bearer $TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (admin@example.com)"const response = await fetch("https://t.momentic.studio/api/v2/roles/7001", {
method: "PATCH",
headers: {
"Authorization": `Bearer ${process.env.TOKEN}`,
"Harvest-Account-Id": process.env.ACCOUNT_ID,
"User-Agent": "MyApp (admin@example.com)",
},
});
const data = await response.json();import os
import requests
response = requests.patch(
"https://t.momentic.studio/api/v2/roles/7001",
headers={
"Authorization": f"Bearer {os.environ['TOKEN']}",
"Harvest-Account-Id": os.environ["ACCOUNT_ID"],
"User-Agent": "MyApp (admin@example.com)",
},
)
data = response.json(){
"id": 7001,
"name": "Design",
"user_ids": [
1001
],
"created_at": "2026-01-05T15:00:00Z",
"updated_at": "2026-01-05T15:00:00Z"
}Delete a role
DELETE
/ api/ v2/ roles/ {role_id}Differs from Harvest
Archives the team, which removes the access it gave. The team's history stays.
Returns
Status 200. No body.
curl -X DELETE "https://t.momentic.studio/api/v2/roles/7001" \
-H "Authorization: Bearer $TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp (admin@example.com)"const response = await fetch("https://t.momentic.studio/api/v2/roles/7001", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${process.env.TOKEN}`,
"Harvest-Account-Id": process.env.ACCOUNT_ID,
"User-Agent": "MyApp (admin@example.com)",
},
});
console.log(response.status);import os
import requests
response = requests.delete(
"https://t.momentic.studio/api/v2/roles/7001",
headers={
"Authorization": f"Bearer {os.environ['TOKEN']}",
"Harvest-Account-Id": os.environ["ACCOUNT_ID"],
"User-Agent": "MyApp (admin@example.com)",
},
)
print(response.status_code)No body.
The role object
| Field | Type | Description |
|---|---|---|
idinteger | integer | The role's id. |
namestring | string | The team's name. |
user_idsinteger[] | integer[] | The ids of the team's people. |
created_atdatetime | datetime | When the record was created. |
updated_atdatetime | datetime | When the record was last changed. |