> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corepillar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview scenarios

> Step 3: drafts up to 3 sample scenarios for the synthesized agent with the same generator the Cost Calculator uses, on the platform's key. Nothing is stored. Returns `202` when some scenarios failed to generate.

**Auth:** session. **Permission:** `run_agents` or `manage_agents`.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/synthetic/scenarios
openapi: 3.1.0
info:
  title: CorePillar API
  version: 1.0.0
  description: >-
    REST API for AgentHub and ModelHub. Ingestion endpoints authenticate with a
    project tracing key; all other endpoints use the signed-in user's browser
    session.
servers:
  - url: https://pillarforge.corepillar.ai/api/v1
    description: AgentHub
security: []
tags:
  - name: Ingestion
    description: 'Send traces with a tracing key: JSON ingest and OpenTelemetry (OTLP).'
  - name: Traces
    description: Read traces and spans.
  - name: Evaluations
    description: Evaluate traces with evaluator collections.
  - name: Evaluators
    description: Built-in and custom evaluators.
  - name: Evaluator collections
    description: Ordered groups of evaluators.
  - name: Organizations
    description: Organizations you belong to.
  - name: Members
    description: Organization members, invites and roles.
  - name: Projects
    description: Projects inside an organization.
  - name: SSO
    description: Okta SSO configuration.
  - name: Tracing keys
    description: Create, list and revoke project tracing keys.
  - name: Cost calculator
    description: Estimate, generate and execute scenario runs.
  - name: Synthetic
    description: Synthetic agent and data setup from source material.
  - name: Chat
    description: ModelHub chat. Served at https://modelhub.corepillar.ai/api/v1.
  - name: Auth
    description: Sign-in helpers.
  - name: E2E
    description: Internal end-to-end encryption key directory.
paths:
  /projects/{projectId}/synthetic/scenarios:
    post:
      tags:
        - Synthetic
      summary: Preview scenarios
      description: >-
        Step 3: drafts up to 3 sample scenarios for the synthesized agent with
        the same generator the Cost Calculator uses, on the platform's key.
        Nothing is stored. Returns `202` when some scenarios failed to generate.


        **Auth:** session. **Permission:** `run_agents` or `manage_agents`.
      operationId: syntheticScenarios
      parameters:
        - name: projectId
          in: path
          required: true
          description: Project id.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent
              properties:
                agent:
                  $ref: '#/components/schemas/SyntheticAgentSpec'
                dataset:
                  anyOf:
                    - $ref: '#/components/schemas/SyntheticDataset'
                    - type: 'null'
                  default: null
                count:
                  type: integer
                  minimum: 1
                  maximum: 3
                  default: 3
      responses:
        '200':
          description: Scenarios.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      scenarios:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            category:
                              type: string
                            goal_description:
                              type: string
                            turns:
                              type: array
                              items:
                                type: object
                                properties:
                                  role:
                                    type: string
                                  content:
                                    type: string
                      failures:
                        type: integer
                      usage:
                        type: object
                        description: Estimated, not billed, usage.
                        properties:
                          model:
                            type: string
                          input_tokens:
                            type: integer
                          output_tokens:
                            type: integer
                          cost_usd:
                            type: number
        '202':
          description: Some scenarios failed to generate; same body as `200`.
        '400':
          description: Validation failed. `error.code` is `VALIDATION_ERROR`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Not signed in (`UNAUTHORIZED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: >-
            Not a member of the organization, or missing the required permission
            (`FORBIDDEN`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Project not found or not visible to you (`PROJECT_NOT_FOUND`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '413':
          description: Body or file too large (`VALIDATION_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '415':
          description: '`Content-Type` isn''t `application/json` (`VALIDATION_ERROR`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Unexpected server error (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '502':
          description: The model couldn't draft scenarios (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          description: >-
            Scenario preview isn't configured on this deployment
            (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - session: []
components:
  schemas:
    SyntheticAgentSpec:
      type: object
      required:
        - name
        - system_prompt
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        system_prompt:
          type: string
          minLength: 1
          maxLength: 20000
        tone:
          type: string
          maxLength: 500
          default: ''
        skills:
          type: array
          maxItems: 12
          items:
            type: string
            maxLength: 600
          default: []
        memory:
          type: array
          maxItems: 12
          items:
            type: string
            maxLength: 900
          default: []
        tools:
          type: array
          maxItems: 10
          default: []
          items:
            type: object
            required:
              - name
              - kind
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 160
              kind:
                type: string
                enum:
                  - tool
                  - connector
    SyntheticDataset:
      type: object
      description: A synthetic system of record, as returned by the synthesize step.
      properties:
        system_label:
          type: string
          maxLength: 120
          default: Synthetic system of record
        entities:
          type: array
          maxItems: 6
          default: []
          items:
            type: object
            required:
              - name
              - fields
            properties:
              name:
                type: string
                maxLength: 80
              description:
                type: string
                maxLength: 400
              fields:
                type: array
                minItems: 1
                maxItems: 20
                items:
                  type: object
                  required:
                    - name
                    - type
                  properties:
                    name:
                      type: string
                      maxLength: 80
                    type:
                      type: string
                      enum:
                        - id
                        - person_name
                        - email
                        - phone
                        - date
                        - enum
                        - number
                        - currency
                        - text
                        - reference
                    description:
                      type: string
                      maxLength: 300
              rows:
                type: array
                maxItems: 40
                items:
                  type: object
                  additionalProperties:
                    type:
                      - string
                      - number
              links_to:
                type:
                  - string
                  - 'null'
                maxLength: 80
              link_field:
                type:
                  - string
                  - 'null'
                maxLength: 80
        rollups:
          type: array
          maxItems: 30
          items:
            type: object
            additionalProperties: true
          default: []
        row_count:
          type: integer
          minimum: 0
          default: 0
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not on `message`.
              examples:
                - VALIDATION_ERROR
            message:
              type: string
              description: Human-readable description. May change.
            details:
              type: object
              additionalProperties: true
              description: Extra context; often empty.
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: session
      description: >-
        The session cookie set when you sign in to AgentHub or ModelHub in a
        browser. The cookie name shown here is illustrative. There are no API
        tokens for these endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.