Skip to content

Docs / API objects

Roles

List and change your teams. The Harvest API calls a team a role.

View as Markdown

A role here is a team. A team gives its people access to the team's projects.

List roles

GET/api/v2/roles
Scope
reports:read

Differs from Harvest

Roles are the app's teams. A member is refused (403).

Query parameters

Query parameters of List roles
NameTypeDescription
updated_sincedatetimeOptionaldatetimeOnly records changed at or after this ISO 8601 date-time. A value that is not a date-time is refused with 400.
pageintegerOptionalintegerThe page to return, from 1. Default 1. A page past the end returns no records.
per_pageintegerOptionalintegerRecords 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)"
Response200
{
  "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"
  }
}

Retrieve a role

GET/api/v2/roles/{role_id}
Scope
reports:read

Differs from Harvest

Returns

Status 200 with a role object.

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)"
Response200
{
  "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/roles
Scope
people:write

Differs from Harvest

Creates a team. A team gives its people access to the team's projects.

Body, as JSON or form fields

Body fields of Create a role
NameTypeDescription
namestringRequiredstringThe team's name, up to 60 characters.
user_idsinteger[]Optionalinteger[]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"}'
Response201
{
  "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}
Scope
people:write

Differs from Harvest

Body, as JSON or form fields

Body fields of Update a role
NameTypeDescription
namestringOptionalstringThe team's name.
user_idsinteger[]Optionalinteger[]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)"
Response200
{
  "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}
Scope
people:write

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)"
Response 200

No body.

The role object

Fields of the role object
FieldTypeDescription
idintegerintegerThe role's id.
namestringstringThe team's name.
user_idsinteger[]integer[]The ids of the team's people.
created_atdatetimedatetimeWhen the record was created.
updated_atdatetimedatetimeWhen the record was last changed.