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

# Run Single Test

> Run a specific red team test by name.



## OpenAPI

````yaml /api-reference/openapi-developer.json post /api/v1/proxy/redteam/test/{test_name}
openapi: 3.1.0
info:
  title: PromptGuard Developer API
  description: >-
    Public API for developers to integrate PromptGuard security into their
    applications
  version: 1.0.0
servers:
  - url: https://api.promptguard.dev
    description: Production API
  - url: https://staging-api.promptguard.dev
    description: Staging API
  - url: http://localhost:8080
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/proxy/redteam/test/{test_name}:
    post:
      tags:
        - redteam
      summary: Run Single Test
      description: Run a specific red team test by name.
      operationId: run_single_test_api_v1_proxy_redteam_test__test_name__post
      parameters:
        - name: test_name
          in: path
          required: true
          schema:
            type: string
            title: Test Name
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/internal__redteam__router__TestRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal__redteam__router__TestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    internal__redteam__router__TestRequest:
      properties:
        custom_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Prompt
        target_preset:
          type: string
          title: Target Preset
          default: default
      type: object
      title: TestRequest
      description: Request to run a red team test
    internal__redteam__router__TestResponse:
      properties:
        test_name:
          type: string
          title: Test Name
        prompt:
          type: string
          title: Prompt
        decision:
          type: string
          title: Decision
        reason:
          type: string
          title: Reason
        threat_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Threat Type
        confidence:
          type: number
          title: Confidence
        blocked:
          type: boolean
          title: Blocked
        details:
          additionalProperties: true
          type: object
          title: Details
      type: object
      required:
        - test_name
        - prompt
        - decision
        - reason
        - threat_type
        - confidence
        - blocked
        - details
      title: TestResponse
      description: Response from a red team test
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        PromptGuard API key for developer endpoints. Keys start with pg_live_
        and are created in the dashboard.

````