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

# Create Detection

> Create a new detection request.

This endpoint accepts a detection request and starts processing it
asynchronously. The response includes the detection ID which can be
used to poll for results via GET /detections/{id}.

Note: This endpoint does not require authentication to support
the Execution Flow test input feature.



## OpenAPI

````yaml /openapi/api.json post /v1/detections
openapi: 3.1.0
info:
  title: Vijil Console API (Combined)
  description: Combined OpenAPI specification for all vijil-console microservices.
  version: 0.1.0
servers: []
security: []
tags:
  - name: Teams
    description: Authentication, users, and team management
  - name: Agent Environment
    description: Agent, persona, policy, and harness management
  - name: Diamond
    description: Evaluation management and report retrieval
  - name: Dome
    description: Protection, guardrails, and telemetry
  - name: Red Team
    description: Red team campaigns
paths:
  /v1/detections:
    post:
      tags:
        - Dome
        - detections
      summary: Create Detection
      description: |-
        Create a new detection request.

        This endpoint accepts a detection request and starts processing it
        asynchronously. The response includes the detection ID which can be
        used to poll for results via GET /detections/{id}.

        Note: This endpoint does not require authentication to support
        the Execution Flow test input feature.
      operationId: create_detection_v1_detections_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectionRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DetectionRequest:
      properties:
        id:
          type: string
          title: Id
        detector_id:
          type: string
          title: Detector Id
        detector_params:
          $ref: '#/components/schemas/DetectionParams'
        detector_inputs:
          items:
            $ref: '#/components/schemas/DetectionInput'
          type: array
          title: Detector Inputs
      type: object
      required:
        - id
        - detector_id
        - detector_inputs
      title: DetectionRequest
      description: Request model for creating a detection.
    DetectionResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
        detector_inputs:
          items:
            $ref: '#/components/schemas/DetectionInput'
          type: array
          title: Detector Inputs
        detector_outputs:
          items:
            $ref: '#/components/schemas/DetectionOutput'
          type: array
          title: Detector Outputs
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
      type: object
      required:
        - id
        - status
      title: DetectionResponse
      description: Response model for a detection.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DetectionParams:
      properties:
        api_key_proxy:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key Proxy
        hub:
          anyOf:
            - type: string
            - type: 'null'
          title: Hub
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
      type: object
      title: DetectionParams
      description: Parameters for a detection request.
    DetectionInput:
      properties:
        response:
          anyOf:
            - type: string
            - type: 'null'
          title: Response
        question:
          anyOf:
            - type: string
            - type: 'null'
          title: Question
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        dome_detection_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Dome Detection Method
      type: object
      title: DetectionInput
      description: Input for a detection request.
    DetectionOutput:
      properties:
        score:
          type: number
          title: Score
          default: 0
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      title: DetectionOutput
      description: Output from a detection.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````