We have relocated to Instructure Developer Documentation Portal. 🎉 Please update your bookmarks. This page will automatically redirect after July 1, 2026.
Cohorts API
Manage cohorts, groups of people placed in an account. Cohorts nest into trees up to a configurable depth, 10 by default.
A Cohort object looks like:
// A named group in a Canvas account.
{
// the ID of the cohort
"id": 4002,
// the root account at the top of the account hierarchy the cohort is placed in
"root_account_id": 1,
// the root cohort of this cohort's tree; equal to id when the cohort is itself
// a root
"root_cohort_id": 4000,
// the account the cohort is placed in, a root account or a sub-account
"account_id": 1,
// the cohort one level above this one, or null for a root cohort
"parent_cohort_id": 4000,
// the name of the cohort
"name": "Mercy General Hospital",
// free-text description of the cohort
"description": "Acute care hospitals in the Mercy network.",
// level in the hierarchy; a root cohort is 1
"depth": 2,
// the status of the cohort
"workflow_state": "active",
// the unique SIS identifier within the root account
"sis_source_id": "HS-MERCY-GEN",
// the SIS import that last touched the cohort, if any
"sis_batch_id": 12,
// fields last changed outside SIS; a later SIS import leaves these alone
"stuck_sis_fields": ["name"],
// when the cohort was created
"created_at": "2026-01-15T10:00:00Z",
// when the cohort was last updated
"updated_at": "2026-01-15T10:00:00Z",
// the number of active members; present with include[]=member_count
"member_count": 25,
// the number of active leaders; present with include[]=leader_count
"leader_count": 2,
// the number of active cohorts one level below; present with
// include[]=child_count
"child_count": 3,
// the chain of cohorts from the root down to the parent, root first; present
// with include[]=ancestors. Each ancestor carries the counts also requested in
// include[]
"ancestors": null
}
A CohortTreeNode object looks like:
// A cohort and the subtree beneath it.
{
// the cohort at this node
"cohort": null,
// active direct children, newest first, capped at 100 per node
"children": null,
// true when this node has children that the requested depth cut off; fetch the
// subtree again from this node to see them
"truncated": false,
// true when this node has more than 100 active direct children and children
// holds only the first 100; list with parent_cohort_id set to this node's id
// for the complete set; independent of truncated
"children_truncated": false
}
List cohorts CohortsController#index
GET /api/v1/accounts/:account_id/cohorts
url:GET|/api/v1/accounts/:account_id/cohorts
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| roots | boolean | Only list cohorts with no parent. Can't be combined with parent_cohort_id. | |
| parent_cohort_id | integer | List the direct children of a cohort placed in this account. | |
| search_term | string | Only list cohorts whose name contains this text. Needs at least two characters. | |
| sort | string |
The field to sort by. Defaults to created_at.
Allowed values: |
|
| order | string |
The sort direction. Defaults to desc. Ties break by id ascending.
Allowed values: |
|
| workflow_state[] | string |
Only list cohorts in these states. Defaults to active. "all" lists both
states.
Allowed values: |
|
| include[] | string |
Extra data to compute for each cohort.
Allowed values: |
|
| per_page | integer | The number of cohorts per page. See the pagination section of the API documentation. |
List the cohorts I lead CohortsController#led
GET /api/v1/cohorts
url:GET|/api/v1/cohorts
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| search_term | string | Search all cohorts the caller leads or that sit below an active cohort they lead, at any depth, and list those whose name contains this text, flat rather than top-level only. Needs at least two characters. | |
| sort | string |
The field to sort by. Defaults to created_at.
Allowed values: |
|
| order | string |
The sort direction. Defaults to desc. Ties break by id ascending.
Allowed values: |
|
| workflow_state[] | string |
Only list cohorts in these states. Defaults to active. "all" lists both
states.
Allowed values: |
|
| include[] | string |
Extra data to compute for each cohort.
Allowed values: |
|
| per_page | integer | The number of cohorts per page. See the pagination section of the API documentation. |
Get a cohort CohortsController#show
GET /api/v1/accounts/:account_id/cohorts/:cohort_id
url:GET|/api/v1/accounts/:account_id/cohorts/:cohort_id
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| include[] | string |
Extra data to compute for the cohort. "ancestors" adds the chain of
cohorts from the root down to the parent, root first. Counts requested
alongside "ancestors" are computed for each ancestor too, so one request
tells which ancestors have more children to load.
Allowed values: |
Get cohort permissions CohortsController#permissions
GET /api/v1/accounts/:account_id/cohorts/:cohort_id/permissions
url:GET|/api/v1/accounts/:account_id/cohorts/:cohort_id/permissions
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| permissions[] | string | List of permissions to check against the authenticated user. Defaults to every cohort permission. Permission names are documented in the List assignable permissions endpoint. |
Example Request:
curl https://<canvas>/api/v1/accounts/1/cohorts/4002/permissions \
-H 'Authorization: Bearer <token>' \
-d 'permissions[]=manage_cohorts_edit' \
-d 'permissions[]=manage_cohorts_add_members'
Example Response:
{"manage_cohorts_edit": true, "manage_cohorts_add_members": false}
Get a cohort tree CohortsController#tree
GET /api/v1/accounts/:account_id/cohorts/:cohort_id/tree
url:GET|/api/v1/accounts/:account_id/cohorts/:cohort_id/tree
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| depth | integer | How many levels to return, from 1 to 10. Defaults to 2. |
List member candidates CohortsController#member_candidates
GET /api/v1/accounts/:account_id/cohorts/:cohort_id/member_candidates
url:GET|/api/v1/accounts/:account_id/cohorts/:cohort_id/member_candidates
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| search_term | string | Only list users matching this text. Needs at least two characters. | |
| purpose | string |
What the picked users will be added as. Defaults to members.
Allowed values: |
|
| per_page | integer | The number of users per page. See the pagination section of the API documentation. |
List assignable leader roles CohortsController#assignable_roles
GET /api/v1/accounts/:account_id/cohorts/:cohort_id/assignable_roles
url:GET|/api/v1/accounts/:account_id/cohorts/:cohort_id/assignable_roles
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| per_page | integer | The number of roles per page. See the pagination section of the API documentation. |
Example Response:
[{ "id": 12, "label": "Cohort Leader", "base_role_type": "CohortLeader" }]
Create a cohort CohortsController#create
POST /api/v1/accounts/:account_id/cohorts
url:POST|/api/v1/accounts/:account_id/cohorts
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| cohort[name] | Required | string | The name of the cohort, up to 255 characters. |
| cohort[parent_cohort_id] | Required | integer | The id of the parent cohort, or null to create a root cohort. The key must be present. |
| cohort[description] | string | Free-text description, up to 500 characters. | |
| cohort[sis_source_id] | string | The SIS identifier, up to 255 characters and unique within the root account. Setting it requires the manage_sis permission. |
Update a cohort CohortsController#update
PUT /api/v1/accounts/:account_id/cohorts/:cohort_id
url:PUT|/api/v1/accounts/:account_id/cohorts/:cohort_id
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| cohort[name] | string | The name of the cohort, up to 255 characters. | |
| cohort[description] | string | Free-text description, up to 500 characters. | |
| cohort[sis_source_id] | string | The SIS identifier, up to 255 characters and unique within the root account. Changing it requires the manage_sis permission. | |
| override_sis_stickiness | boolean | Default is true. If false, name and description values that were last changed outside SIS ("sticky" fields, listed in stuck_sis_fields) are left as they are, and the other submitted fields are still applied. |
Delete a cohort CohortsController#destroy
DELETE /api/v1/accounts/:account_id/cohorts/:cohort_id
url:DELETE|/api/v1/accounts/:account_id/cohorts/:cohort_id