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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Create a new scenario event

> Create a new scenario event



## OpenAPI

````yaml POST /api/v1/scenario-events
openapi: 3.1.0
info:
  title: LangWatch API
  description: LangWatch openapi spec
  version: 1.0.0
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/v1/scenario-events:
    post:
      description: Create a new scenario event
      operationId: postApiScenarioEvents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_RUN_STARTED
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    metadata:
                      type: object
                      properties:
                        name:
                          type: string
                        description:
                          type: string
                        note:
                          type: string
                        agents:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              role:
                                type: string
                                enum:
                                  - agent
                                  - user
                                  - judge
                            required:
                              - name
                              - role
                        langwatch:
                          type: object
                          properties:
                            targetReferenceId:
                              type: string
                            targetType:
                              type: string
                              enum:
                                - prompt
                                - http
                                - code
                                - workflow
                                - connected
                                - voice
                            targetKey:
                              type: string
                            targetParameters:
                              type: object
                              propertyNames:
                                type: string
                              additionalProperties:
                                anyOf:
                                  - type: string
                                    maxLength: 4096
                                  - type: number
                                  - type: boolean
                            simulationSuiteId:
                              type: string
                            scenarioVersion:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            simulatorModel:
                              type: string
                            judgeModel:
                              type: string
                            resolvedSimulatorModel:
                              type: string
                            resolvedJudgeModel:
                              type: string
                            actorId:
                              type: string
                            actorLabel:
                              type: string
                              enum:
                                - user
                                - api
                                - cli
                            agentInstance:
                              type: object
                              properties:
                                hostname:
                                  type: string
                                label:
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - hostname
                                - label
                            callerKind:
                              type: string
                              enum:
                                - simulated
                                - human
                            caller:
                              type: object
                              properties:
                                voice:
                                  type: string
                                interruptProbability:
                                  type: number
                                effects:
                                  type: string
                              required:
                                - voice
                                - interruptProbability
                                - effects
                            isCutAtLimit:
                              type: boolean
                          required:
                            - targetReferenceId
                            - targetType
                      additionalProperties: {}
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - metadata
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_RUN_FINISHED
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    status:
                      type: string
                      enum:
                        - SUCCESS
                        - ERROR
                        - CANCELLED
                        - IN_PROGRESS
                        - PENDING
                        - FAILED
                        - STALLED
                        - QUEUED
                        - RUNNING
                        - PENDING_EVALUATION
                    results:
                      anyOf:
                        - type: object
                          properties:
                            verdict:
                              type: string
                              enum:
                                - success
                                - failure
                                - inconclusive
                            reasoning:
                              type: string
                            metCriteria:
                              type: array
                              items:
                                type: string
                            unmetCriteria:
                              type: array
                              items:
                                type: string
                            inconclusiveCriteria:
                              type: array
                              items:
                                type: string
                            criteria:
                              type: array
                              items:
                                type: object
                                properties:
                                  criterion:
                                    type: string
                                  requirement:
                                    type: string
                                  status:
                                    type: string
                                    enum:
                                      - passed
                                      - failed
                                      - inconclusive
                                  reasoning:
                                    default: ''
                                    type: string
                                required:
                                  - criterion
                                  - status
                            error:
                              type: string
                            evaluations:
                              type: array
                              items:
                                type: object
                                properties:
                                  evaluatorId:
                                    type: string
                                  name:
                                    type: string
                                  status:
                                    type: string
                                    enum:
                                      - passed
                                      - failed
                                      - scored
                                      - skipped
                                      - error
                                  required:
                                    type: boolean
                                  passed:
                                    type: boolean
                                  score:
                                    type: number
                                  label:
                                    type: string
                                  details:
                                    type: string
                                  cost:
                                    type: object
                                    properties:
                                      currency:
                                        type: string
                                      amount:
                                        type: number
                                    required:
                                      - currency
                                      - amount
                                  inputs:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                required:
                                  - evaluatorId
                                  - name
                                  - status
                                  - required
                          required:
                            - verdict
                            - metCriteria
                            - unmetCriteria
                        - type: 'null'
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - status
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_MESSAGE_SNAPSHOT
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    messages:
                      type: array
                      items:
                        anyOf:
                          - type: object
                            properties:
                              id:
                                type: string
                              trace_id:
                                type: string
                              role:
                                type: string
                                enum:
                                  - developer
                                  - system
                                  - assistant
                                  - user
                                  - tool
                                  - activity
                                  - reasoning
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        metadata: {}
                                      additionalProperties: {}
                                  - type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                              name:
                                type: string
                              encryptedValue:
                                type: string
                              toolCallId:
                                type: string
                              error:
                                type: string
                              activityType:
                                type: string
                              toolCalls:
                                type: array
                                items:
                                  $ref: '#/components/schemas/AgUiToolCall'
                              tool_calls:
                                type: array
                                items:
                                  $ref: '#/components/schemas/AgUiToolCall'
                            required:
                              - id
                              - role
                          - type: object
                            properties:
                              id:
                                type: string
                              trace_id:
                                type: string
                              role:
                                type: string
                              content:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: text
                                        text:
                                          type: string
                                        citations:
                                          anyOf:
                                            - type: array
                                              items: {}
                                            - type: 'null'
                                      required:
                                        - type
                                        - text
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: tool_use
                                        id:
                                          type: string
                                        name:
                                          type: string
                                        input: {}
                                      required:
                                        - type
                                        - id
                                        - name
                                        - input
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: tool_result
                                        tool_use_id:
                                          type: string
                                        content:
                                          anyOf:
                                            - type: string
                                            - type: array
                                              items: {}
                                        is_error:
                                          type: boolean
                                      required:
                                        - type
                                        - tool_use_id
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: thinking
                                        thinking:
                                          type: string
                                        signature:
                                          type: string
                                      required:
                                        - type
                                        - thinking
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: redacted_thinking
                                        data:
                                          type: string
                                      required:
                                        - type
                                        - data
                            required:
                              - content
                          - type: object
                            properties:
                              id:
                                type: string
                              trace_id:
                                type: string
                              role:
                                anyOf:
                                  - type: string
                                    const: system
                                  - type: string
                                    const: developer
                                  - type: string
                                    const: user
                                  - type: string
                                    const: assistant
                                  - type: string
                                    const: function
                                  - type: string
                                    const: tool
                                  - type: string
                                    const: unknown
                              content:
                                anyOf:
                                  - anyOf:
                                      - type: string
                                      - type: array
                                        items:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: text
                                                text:
                                                  type: string
                                                content:
                                                  type: string
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                text:
                                                  type: string
                                              required:
                                                - text
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: image_url
                                                image_url:
                                                  type: object
                                                  properties:
                                                    url:
                                                      type: string
                                                    detail:
                                                      anyOf:
                                                        - type: string
                                                          const: auto
                                                        - type: string
                                                          const: low
                                                        - type: string
                                                          const: high
                                                  required:
                                                    - url
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: tool_call
                                                toolName:
                                                  type: string
                                                toolCallId:
                                                  type: string
                                                args:
                                                  type: string
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: tool_result
                                                toolName:
                                                  type: string
                                                toolCallId:
                                                  type: string
                                                result: {}
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: binary
                                                mimeType:
                                                  type: string
                                                data:
                                                  type: string
                                                url:
                                                  type: string
                                                id:
                                                  type: string
                                                filename:
                                                  type: string
                                              required:
                                                - type
                                                - mimeType
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: input_audio
                                                input_audio:
                                                  type: object
                                                  properties:
                                                    data:
                                                      type: string
                                                    format:
                                                      type: string
                                                    url:
                                                      type: string
                                                    mimeType:
                                                      type: string
                                                    id:
                                                      type: string
                                              required:
                                                - type
                                                - input_audio
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: audio
                                                source:
                                                  type: object
                                                  properties:
                                                    type:
                                                      anyOf:
                                                        - type: string
                                                          const: url
                                                        - type: string
                                                          const: data
                                                    value:
                                                      type: string
                                                    mimeType:
                                                      type: string
                                                  required:
                                                    - type
                                                    - value
                                              required:
                                                - type
                                                - source
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: image
                                                image:
                                                  type: string
                                                mediaType:
                                                  type: string
                                              required:
                                                - type
                                                - image
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: file
                                                mediaType:
                                                  type: string
                                                data:
                                                  type: string
                                                url:
                                                  type: string
                                                filename:
                                                  type: string
                                              required:
                                                - type
                                                - mediaType
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  const: file
                                                file:
                                                  type: object
                                                  properties:
                                                    file_data:
                                                      type: string
                                                    file_id:
                                                      type: string
                                                    filename:
                                                      type: string
                                              required:
                                                - type
                                                - file
                                  - type: 'null'
                              parts:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: text
                                        text:
                                          type: string
                                        content:
                                          type: string
                                      required:
                                        - type
                                    - type: object
                                      properties:
                                        text:
                                          type: string
                                      required:
                                        - text
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: image_url
                                        image_url:
                                          type: object
                                          properties:
                                            url:
                                              type: string
                                            detail:
                                              anyOf:
                                                - type: string
                                                  const: auto
                                                - type: string
                                                  const: low
                                                - type: string
                                                  const: high
                                          required:
                                            - url
                                      required:
                                        - type
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: tool_call
                                        toolName:
                                          type: string
                                        toolCallId:
                                          type: string
                                        args:
                                          type: string
                                      required:
                                        - type
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: tool_result
                                        toolName:
                                          type: string
                                        toolCallId:
                                          type: string
                                        result: {}
                                      required:
                                        - type
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: binary
                                        mimeType:
                                          type: string
                                        data:
                                          type: string
                                        url:
                                          type: string
                                        id:
                                          type: string
                                        filename:
                                          type: string
                                      required:
                                        - type
                                        - mimeType
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: input_audio
                                        input_audio:
                                          type: object
                                          properties:
                                            data:
                                              type: string
                                            format:
                                              type: string
                                            url:
                                              type: string
                                            mimeType:
                                              type: string
                                            id:
                                              type: string
                                      required:
                                        - type
                                        - input_audio
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: audio
                                        source:
                                          type: object
                                          properties:
                                            type:
                                              anyOf:
                                                - type: string
                                                  const: url
                                                - type: string
                                                  const: data
                                            value:
                                              type: string
                                            mimeType:
                                              type: string
                                          required:
                                            - type
                                            - value
                                      required:
                                        - type
                                        - source
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: image
                                        image:
                                          type: string
                                        mediaType:
                                          type: string
                                      required:
                                        - type
                                        - image
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: file
                                        mediaType:
                                          type: string
                                        data:
                                          type: string
                                        url:
                                          type: string
                                        filename:
                                          type: string
                                      required:
                                        - type
                                        - mediaType
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: file
                                        file:
                                          type: object
                                          properties:
                                            file_data:
                                              type: string
                                            file_id:
                                              type: string
                                            filename:
                                              type: string
                                      required:
                                        - type
                                        - file
                              function_call:
                                anyOf:
                                  - type: object
                                    properties:
                                      name:
                                        type: string
                                      arguments:
                                        type: string
                                  - type: 'null'
                              tool_calls:
                                anyOf:
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        type:
                                          type: string
                                        function:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                            arguments:
                                              type: string
                                      required:
                                        - id
                                        - type
                                        - function
                                  - type: 'null'
                              tool_call_id:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type:
                                  - string
                                  - 'null'
                              reasoning_content:
                                type:
                                  - string
                                  - 'null'
                          - type: object
                            properties:
                              id:
                                type: string
                              trace_id:
                                type: string
                              role:
                                type: string
                              content:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: text
                                        text:
                                          type: string
                                      required:
                                        - type
                                        - text
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: input_audio
                                        input_audio:
                                          type: object
                                          properties:
                                            data:
                                              type: string
                                            format:
                                              type: string
                                            url:
                                              type: string
                                            mimeType:
                                              type: string
                                            id:
                                              type: string
                                      required:
                                        - type
                                        - input_audio
                            required:
                              - content
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - messages
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TEXT_MESSAGE_START
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    messageId:
                      type: string
                    role:
                      type: string
                    messageIndex:
                      type: number
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - messageId
                    - role
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TEXT_MESSAGE_END
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    messageId:
                      type: string
                    role:
                      type: string
                    content:
                      type: string
                    message:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    traceId:
                      type: string
                    messageIndex:
                      type: number
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - messageId
                    - role
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TEXT_MESSAGE_CONTENT
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    messageId:
                      type: string
                    delta:
                      type: string
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - messageId
                    - delta
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TOOL_CALL_START
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    toolCallId:
                      type: string
                    toolCallName:
                      type: string
                    parentMessageId:
                      type: string
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - toolCallId
                    - toolCallName
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TOOL_CALL_ARGS
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    toolCallId:
                      type: string
                    delta:
                      type: string
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - toolCallId
                    - delta
                - type: object
                  properties:
                    type:
                      type: string
                      const: SCENARIO_TOOL_CALL_END
                    timestamp:
                      type: number
                    rawEvent: {}
                    batchRunId:
                      type: string
                    scenarioId:
                      type: string
                    scenarioRunId:
                      type: string
                    scenarioSetId:
                      default: default
                      type: string
                    toolCallId:
                      type: string
                  required:
                    - type
                    - timestamp
                    - batchRunId
                    - scenarioId
                    - scenarioRunId
                    - toolCallId
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  url:
                    type:
                      - string
                      - 'null'
                required:
                  - success
                additionalProperties: false
        '400':
          description: Invalid event data
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
      security:
        - project_api_key: []
components:
  schemas:
    AgUiToolCall:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          const: function
        function:
          type: object
          properties:
            name:
              type: string
            arguments:
              type: string
          additionalProperties: {}
        encryptedValue:
          type: string
      additionalProperties: {}
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````

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