Reorder a cohort’s assigned programs
const url = 'https://api.retorio.com/be/v2/cohorts/b2d7e4a1_55c3_4f28_9e10_7a3d6c4b8f02/programs/order';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"extId":"e90f3b7c_1a26_44d5_b8c1_0d94e7f25a63","order":0}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.retorio.com/be/v2/cohorts/b2d7e4a1_55c3_4f28_9e10_7a3d6c4b8f02/programs/order \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "extId": "e90f3b7c_1a26_44d5_b8c1_0d94e7f25a63", "order": 0 } ]'Sets the display order of this cohort’s assignments. Send exactly one entry per assignment, with order values covering 0 to n - 1. An unknown or repeated ext id, a different number of entries than assignments, or order values that are not exactly 0 to n - 1 (a gap or a repeat) fails the whole call.
Authentication
Section titled “Authentication”- Auth
- Access key
- Roles
- Owner / Admin / Custom
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
b2d7e4a1_55c3_4f28_9e10_7a3d6c4b8f02Request Bodyrequired
Section titled “Request Bodyrequired”Every assignment currently in the cohort, once each, with its new order (0 to n - 1). An unknown or repeated ext id, a wrong number of entries, or order values that are not exactly 0 to n - 1 (a gap or a repeat) fail the whole call.
object
The cohort-program assignment ext id.
Example
e90f3b7c_1a26_44d5_b8c1_0d94e7f25a63Example
0Responses
Section titled “Responses”Updated
The request body is not valid, an ext id is not one of this cohort’s assignments, the number of entries differs from the number of assignments, or the order values are not exactly 0 to n - 1. Also answered when the request body is not valid JSON.
object
Canonical error name, e.g. INVALID_ARGUMENT.
object
The HTTP reason phrase, e.g. Bad Request.
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.
object
Canonical error name, e.g. INVALID_ARGUMENT.
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.
object
Canonical error name, e.g. INVALID_ARGUMENT.
object
object
The HTTP reason phrase, e.g. Bad Request.
Example generated
{ "message": "example", "status": "example", "details": "example"}No cohort with this id in your organization.
object
Canonical error name, e.g. INVALID_ARGUMENT.
Example generated
{ "message": "example", "status": "example", "details": "example"}The request body is larger than 10 MB.
object
The HTTP reason phrase, e.g. Bad Request.
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.
object
The HTTP reason phrase, e.g. Bad Request.
Example generated
{ "statusCode": 1, "message": "example", "error": "example"}Internal Server Error
object
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.