Skip to content

Assign programs to a cohort

POST
/cohorts/{id}/programs
curl --request POST \
--url https://api.retorio.com/be/v2/cohorts/b2d7e4a1_55c3_4f28_9e10_7a3d6c4b8f02/programs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "startDate": "2026-12-01T00:00:00.000Z", "endDate": "2027-03-31T23:59:59.000Z", "programExtIds": [ "3c9a7e15_8d42_4b6f_a1e0_5f2d9c8b7a64" ] }'

Assigns one or more programs to this cohort for the given window. Fails the whole call if any of the programs already holds a live assignment in this cohort.

Auth
Access key
Roles
Owner / Admin / Custom
id
required
string

Example

b2d7e4a1_55c3_4f28_9e10_7a3d6c4b8f02
Media typeapplication/json
object
startDate
required

When every assigned program becomes visible to the cohort.

string

Example

2026-12-01T00:00:00.000Z
endDate

When the assigned programs stop accepting new attempts. A coaching user keeps seeing an ended assignment they have attempts in. Omit or send null for no end date.

string
nullable

Example

2027-03-31T23:59:59.000Z
programExtIds
required

Programs to assign, by ext id. A program already holding a live assignment in this cohort fails the whole call. Unassign it first to re-assign with a new period.

Array<string>

Example

[
"3c9a7e15_8d42_4b6f_a1e0_5f2d9c8b7a64"
]

Created

Media typeapplication/json
Array<object>
object
createdAt
required
string format: date-time
extId
required
string
<= 64 characters
startDate
required
string format: date-time
endDate
required
string format: date-time
nullable
order
required
integer
programId
required

The assigned program’s ext id.

string
title
required

The assigned program’s title.

string
scenarioStatusCounts
required
object
unpublished
required
integer
publishing
required
integer
published
required
integer
cohortProgramStatus
required

upcoming before startDate, finished once endDate has passed (never for an open-ended assignment, which has no endDate), active otherwise.

string
Allowed values: upcoming active finished

Example

[
{
"cohortProgramStatus": "upcoming"
}
]

The request body is not valid, a date is not a valid ISO date, startDate is not before endDate, or a program already holds a live assignment in this cohort. Also answered when the request body is not valid JSON.

Media typeapplication/json
Any of:
object
message
required
string
status
required

Canonical error name, e.g. INVALID_ARGUMENT.

string
details
nullable

Example generated

{
"message": "example",
"status": "example",
"details": "example"
}

Not authenticated: the bearer token is missing, malformed, expired or revoked, its sign-in method does not match your organization’s configuration, the user it belongs to was removed, or your organization is deactivated.

Media typeapplication/json
object
message
required
string
status
required

Canonical error name, e.g. INVALID_ARGUMENT.

string
details
nullable

Example generated

{
"message": "example",
"status": "example",
"details": "example"
}

Refused: the token does not belong to an admin, or your organization does not have the coaching product, or the admin’s roles do not grant cohorts:manage.

Media typeapplication/json
Any of:
object
message
required
string
status
required

Canonical error name, e.g. INVALID_ARGUMENT.

string
details
nullable

Example generated

{
"message": "example",
"status": "example",
"details": "example"
}

No cohort with this id in your organization, or a program in programExtIds does not exist in it.

Media typeapplication/json
object
message
required
string
status
required

Canonical error name, e.g. INVALID_ARGUMENT.

string
details
nullable

Example generated

{
"message": "example",
"status": "example",
"details": "example"
}

The request body is larger than 10 MB.

Media typeapplication/json
object
statusCode
required
integer
message
required
string
error
required

The HTTP reason phrase, e.g. Bad Request.

string

Example generated

{
"statusCode": 1,
"message": "example",
"error": "example"
}

The Content-Type charset or the Content-Encoding is one the API cannot decode. Send UTF-8 JSON without a content encoding.

Media typeapplication/json
object
statusCode
required
integer
message
required
string
error
required

The HTTP reason phrase, e.g. Bad Request.

string

Example generated

{
"statusCode": 1,
"message": "example",
"error": "example"
}

Internal Server Error

Media typeapplication/json
object
key
additional properties
nullable

Example generated

{
"additionalProperty": "example"
}

Retorio is GDPR and DSGVO compliant, EU AI Act aligned, ISO 27001 certified, and hosted on Google Cloud with EU data residency. For anything specific to your rollout, ask your Retorio contact.