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

# Scenario from a report

> A bug report becomes a scenario: the conversation turns are kept and the assertions suggested from the turns and the words of the description, which is read and never stored.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/scenarios/from-report
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/scenarios/from-report:
    post:
      tags:
        - turns
      summary: Scenario from a report
      description: >-
        A bug report becomes a scenario: `conversation_id` or `turn_ids`, with
        an optional name and description. The turns are kept, and the assertions
        are suggested by rule from the turns and from the words of the
        description, which is read and never stored.


        **Authentication.** Source key with the `replay` scope, or a Console
        person token with the `integration`, `security` role (or admin). It
        answers only in a space with the `turns` feature on (the `features`
        document); in a space without it, 404.
      operationId: scenario_from_report_v1_scenarios_from_report_post
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 256
            minLength: 1
            title: Idempotency-Key
            type: string
          description: >-
            Required. Kept 24 hours with the hash of the body: a retry with the
            same key returns the first answer, and the same key with a different
            body returns 409 `conflict`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScenarioFromReport'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Scenario'
          description: The scenario, with the suggested assertions.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ScenarioFromReport:
      additionalProperties: false
      description: >-
        A bug report becomes a scenario: its turns are kept and assertions
        suggested by rule, from the turns

        and from words of the description. The description is read, never
        stored.
      properties:
        conversation_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Conversation Id
        description:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          title: Description
        name:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Name
        turn_ids:
          items:
            pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
            type: string
          maxItems: 50
          title: Turn Ids
          type: array
      title: ScenarioFromReport
      type: object
    Scenario:
      additionalProperties: false
      properties:
        assertions:
          items:
            $ref: '#/components/schemas/ReplayAssertion'
          title: Assertions
          type: array
        created_at:
          format: date-time
          title: Created At
          type: string
        name:
          title: Name
          type: string
        origin:
          enum:
            - manual
            - report
          title: Origin
          type: string
        scenario_id:
          maxLength: 512
          minLength: 1
          title: Scenario Id
          type: string
        status:
          enum:
            - active
            - retired
          title: Status
          type: string
        turn_ids:
          items:
            pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
            type: string
          title: Turn Ids
          type: array
        updated_at:
          format: date-time
          title: Updated At
          type: string
        version:
          description: Grows with every change of the name, the assertions or the status.
          title: Version
          type: integer
      required:
        - scenario_id
        - name
        - origin
        - turn_ids
        - assertions
        - status
        - version
        - created_at
        - updated_at
      title: Scenario
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    ReplayAssertion:
      additionalProperties: false
      description: >-
        A structural check on the replayed turn's record, evaluated by the
        runner. The replay spec fixes each

        kind's `args` and how it is evaluated; a kind the runner cannot evaluate
        yields `not_checked`.
      properties:
        args:
          additionalProperties: true
          maxProperties: 20
          propertyNames:
            maxLength: 256
            minLength: 1
          title: Args
          type: object
        id:
          pattern: ^[a-z0-9][a-z0-9_.-]{0,63}$
          title: Id
          type: string
        kind:
          enum:
            - tool_called
            - tool_not_called
            - hard_respected
            - no_denial_with_results
            - claims_traced
            - claims_match_state
            - no_promise_without_action
            - expected_in_topk
            - handoff_when
            - effect_once
            - budget
            - lexicon
            - tools_offered_match
          title: Kind
          type: string
        suggested:
          default: false
          description: Suggested by rule from the recorded turn.
          title: Suggested
          type: boolean
        turn_id:
          anyOf:
            - pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
              type: string
            - type: 'null'
          description: The one turn of the scenario it applies to; every turn when absent.
          title: Turn Id
      required:
        - id
        - kind
      title: ReplayAssertion
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````