openapi: 3.1.0 info: title: LangWatch Agents Scenario Events API version: 1.0.0 description: LangWatch openapi spec servers: - url: https://app.langwatch.ai security: - project_api_key: [] tags: - name: Scenario Events paths: /api/scenario-events: post: responses: '201': description: Event created successfully content: application/json: schema: type: object properties: success: type: boolean url: type: - string - 'null' required: - success '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 operationId: postApiScenario-events parameters: [] description: Create a new scenario event requestBody: 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: type: string default: default metadata: type: object properties: name: type: string description: type: string langwatch: type: object properties: targetReferenceId: type: string targetType: type: string enum: - prompt - http - code - workflow simulationSuiteId: type: string required: - targetReferenceId - targetType additionalProperties: true 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: type: string default: default status: type: string enum: - SUCCESS - ERROR - CANCELLED - IN_PROGRESS - PENDING - FAILED - STALLED - QUEUED - RUNNING results: type: - object - 'null' properties: verdict: type: string enum: - success - failure - inconclusive reasoning: type: string metCriteria: type: array items: type: string unmetCriteria: type: array items: type: string error: type: string required: - verdict - metCriteria - unmetCriteria required: - type - timestamp - batchRunId - scenarioId - scenarioRunId - status - type: object properties: type: type: string const: SCENARIO_MESSAGE_SNAPSHOT timestamp: type: number rawEvent: {} messages: type: array items: allOf: - anyOf: - oneOf: - type: object properties: id: type: string role: type: string const: developer content: type: string name: type: string encryptedValue: type: string required: - id - role - content - type: object properties: id: type: string role: type: string const: system content: type: string name: type: string encryptedValue: type: string required: - id - role - content - type: object properties: id: type: string role: type: string const: assistant content: type: string name: type: string encryptedValue: type: string toolCalls: type: array items: type: object properties: id: type: string type: type: string const: function function: type: object properties: name: type: string arguments: type: string required: - name - arguments encryptedValue: type: string required: - id - type - function required: - id - role - type: object properties: id: type: string role: type: string const: user content: anyOf: - type: string - type: array items: oneOf: - type: object properties: type: type: string const: text text: type: string required: - type - text - type: object properties: type: type: string const: image source: oneOf: - type: object properties: type: type: string const: data value: type: string mimeType: type: string required: - type - value - mimeType - type: object properties: type: type: string const: url value: type: string mimeType: type: string required: - type - value metadata: {} required: - type - source - type: object properties: type: type: string const: audio source: oneOf: - type: object properties: type: type: string const: data value: type: string mimeType: type: string required: - type - value - mimeType - type: object properties: type: type: string const: url value: type: string mimeType: type: string required: - type - value metadata: {} required: - type - source - type: object properties: type: type: string const: video source: oneOf: - type: object properties: type: type: string const: data value: type: string mimeType: type: string required: - type - value - mimeType - type: object properties: type: type: string const: url value: type: string mimeType: type: string required: - type - value metadata: {} required: - type - source - type: object properties: type: type: string const: document source: oneOf: - type: object properties: type: type: string const: data value: type: string mimeType: type: string required: - type - value - mimeType - type: object properties: type: type: string const: url value: type: string mimeType: type: string required: - type - value metadata: {} required: - type - source - type: object properties: type: type: string const: binary mimeType: type: string id: type: string url: type: string data: type: string filename: type: string required: - type - mimeType name: type: string encryptedValue: type: string required: - id - role - content - type: object properties: id: type: string content: type: string role: type: string const: tool toolCallId: type: string error: type: string encryptedValue: type: string required: - id - content - role - toolCallId - type: object properties: id: type: string role: type: string const: activity activityType: type: string content: type: object additionalProperties: {} required: - id - role - activityType - content - type: object properties: id: type: string role: type: string const: reasoning content: type: string encryptedValue: type: string required: - id - role - content - type: object properties: role: anyOf: - type: string const: system - type: string const: user - type: string const: assistant - type: string const: function - type: string const: tool - type: string const: unknown content: anyOf: - type: string - type: array items: anyOf: - type: object properties: type: type: string const: text text: type: string required: - type - type: object properties: type: type: string const: text 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: 'null' parts: type: array items: anyOf: - type: object properties: type: type: string const: text text: type: string required: - type - type: object properties: type: type: string const: text 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 function_call: type: - object - 'null' properties: name: type: string arguments: type: string tool_calls: type: - array - 'null' items: type: object properties: id: type: string type: type: string function: type: object properties: name: type: string arguments: type: string required: - id - type - function 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 batchRunId: type: string scenarioId: type: string scenarioRunId: type: string scenarioSetId: type: string default: default required: - type - timestamp - messages - batchRunId - scenarioId - scenarioRunId - 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: type: string default: default 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: type: string default: default messageId: type: string role: type: string content: type: string message: type: object 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: type: string default: default 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: type: string default: default 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: type: string default: default 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: type: string default: default toolCallId: type: string required: - type - timestamp - batchRunId - scenarioId - scenarioRunId - toolCallId tags: - Scenario Events delete: responses: '200': description: Events deleted successfully content: application/json: schema: type: object properties: success: type: boolean url: type: - string - 'null' required: - success '400': description: Bad Request content: application/json: schema: type: object properties: error: type: string message: 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 operationId: deleteApiScenario-events parameters: [] description: Delete all events tags: - Scenario Events components: 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.' admin_api_key: type: http scheme: bearer description: 'Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.'