dots.v2.genAi.scenario_library.byLibrary_scenario_uuid().scenarios.get()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.genAi.scenario_library.byLibrary_scenario_uuid(library_scenario_uuid).scenarios.get(requestConfiguration?: RequestConfiguration<ScenariosRequestBuilderGetQueryParameters>): Promise<undefined | ApiListScenariosOutput>

Description

To list the scenarios inside a Common Scenario & Goal Library entry without creating a team-owned scenario set, send a GET request to /v2/gen-ai/scenario_library/{library_scenario_uuid}/scenarios.

Parameters

Path Parameters

library_scenario_uuid string required

Example: "123e4567-e89b-12d3-a456-426614174000"

UUID of the library entry to read.

Query Parameters

page integer optional

Example: 1

Page number.

perPage integer optional

Example: 1

Items per page.

search string optional

Example: example string

Free-text search across name, description, and user_persona
(case-insensitive substring match). Empty means no search.

sortBy string optional

Field to sort by. Defaults to original file order when unspecified.

- SCENARIO_SORT_FIELD_FILE_ORDER: Preserve original file order. Default.
- SCENARIO_SORT_FIELD_NAME: Sort by scenario name (case-insensitive). Empty names sort last.
- SCENARIO_SORT_FIELD_DESCRIPTION: Sort by scenario description (case-insensitive).

One of: SCENARIO_SORT_FIELD_UNSPECIFIED, SCENARIO_SORT_FIELD_FILE_ORDER, SCENARIO_SORT_FIELD_NAME, SCENARIO_SORT_FIELD_DESCRIPTION

Default: SCENARIO_SORT_FIELD_UNSPECIFIED

sortDirection string optional

Sort direction. Defaults to ascending when unspecified.

One of: SORT_DIRECTION_UNSPECIFIED, SORT_DIRECTION_ASC, SORT_DIRECTION_DESC

Default: SORT_DIRECTION_UNSPECIFIED

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.genAi.scenario_library
    .byLibrary_scenario_uuid("\"123e4567-e89b-12d3-a456-426614174000\"").scenarios.get();

Pagination

This method returns paginated results. The response includes a links.pages object with URLs for navigating between pages. To retrieve the next page, parse the next URL and pass the page query parameter:

let response = await client.v2.genAi.scenario_library
    .byLibrary_scenario_uuid("\"123e4567-e89b-12d3-a456-426614174000\"").scenarios.get();
let pages = response?.links?.pages;

while (pages && "next" in pages && typeof pages.next === "string") {
    const page = Number(new URL(pages.next).searchParams.get("page"));
    response = await client.v2.genAi.scenario_library
        .byLibrary_scenario_uuid("\"123e4567-e89b-12d3-a456-426614174000\"").scenarios.get({
        queryParameters: {
            page,
        },
    });
    pages = response?.links?.pages;
}

Response Example

Show Response Example
{
  "available_sort_by": [
    "SCENARIO_SORT_FIELD_UNSPECIFIED"
  ],
  "available_sort_directions": [
    "SORT_DIRECTION_UNSPECIFIED"
  ],
  "links": {
    "pages": {
      "first": "example string",
      "last": "example string",
      "next": "example string",
      "previous": "example string"
    }
  },
  "meta": {
    "page": 123,
    "pages": 123,
    "total": 123
  },
  "scenarios": [
    {
      "description": "example string",
      "exploration_budget": 123,
      "max_turns": 123,
      "name": "example name",
      "scenario_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "stopping_criteria": [
        "example string"
      ],
      "user_persona": "example string"
    }
  ]
}

More Information

See /v2/gen-ai/scenario_library/{library_scenario_uuid}/scenarios in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.