Set a team's scenarios
curl --request PUT \ --url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/teams/{teamID}/scenarios" \ --header "Authorization: Bearer $UNEEQ_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "assigned_scenario_ids": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "7c9e6679-7425-40de-944b-e07fc1f90ae7" ]}'const url = `${process.env.UNEEQ_API_URL}/external/v1/organization/${process.env.UNEEQ_ORG_ID}/teams/{teamID}/scenarios`;const response = await fetch(url, { method: 'PUT', headers: { Authorization: `Bearer ${process.env.UNEEQ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "assigned_scenario_ids": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "7c9e6679-7425-40de-944b-e07fc1f90ae7" ] }),});console.log(response.status, await response.text());Replaces the team’s assigned scenarios with exactly the listed set: listed scenarios not yet assigned are added, assigned scenarios not in the list are removed, and the rest are left alone. Send an empty array to remove every assignment; omitting the field is rejected. Duplicate IDs count once. Every ID must be a live, non-practice scenario of this organization, otherwise nothing changes and the call returns 403. The change is applied atomically, and repeating the same call is a no-op.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.
Example
org_HYPCX67vaupjhdTnID of a live team in the organization. Must be a lowercase hyphenated UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The complete set of scenario IDs the team should have. Must not be null; an empty array removes every assignment.
Example
{ "assigned_scenario_ids": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "7c9e6679-7425-40de-944b-e07fc1f90ae7" ]}Responses
Section titled “Responses”The team’s assignments now match the list.
teamID is not a lowercase UUID; the body is empty, not valid JSON or has a field of the wrong type (message unable to decode request body); or assigned_scenario_ids is missing, null, has more than 500 entries or contains a non-UUID (message invalid request). No error_code.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The Authorization header is missing, or the API key is not valid for this organization. A key check that fails on the server is also reported as 401.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}The team is not in this organization (message team does not belong to the requested organization), or one or more scenario IDs are not live, non-practice scenarios of this organization (message one or more scenarios do not belong to the requested organization). No error_code.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The API key has sent too many requests. Wait for the number of seconds in Retry-After, then retry.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}Headers
Section titled “Headers”Seconds to wait before retrying.
The assignments could not be updated (message unable to update the team's assigned scenarios, no error_code).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}
