> ## 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 Campaign

> Create a new red team campaign.

Launches a K8s Job to run the selected tool against the target agent.
Returns immediately with a pending status; poll via GET for updates.



## OpenAPI

````yaml /openapi/api.json post /v1/campaigns
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/campaigns:
    post:
      tags:
        - Red Team
        - redteam
      summary: Create Campaign
      description: |-
        Create a new red team campaign.

        Launches a K8s Job to run the selected tool against the target agent.
        Returns immediately with a pending status; poll via GET for updates.
      operationId: create_campaign_v1_campaigns_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCampaignResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateCampaignRequest:
      properties:
        team_id:
          type: string
          format: uuid
          title: Team Id
          description: Team that owns this campaign
        tool:
          $ref: '#/components/schemas/RedteamTool'
          description: Red team tool to use
        agent_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Agent Url
          description: Target agent endpoint URL
        agent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Agent Id
          description: Agent ID from Agent Registry (resolves URL)
        agent_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Api Key
          description: API key for the target agent
        agent_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Model Name
          description: Model name if agent is an LLM gateway
        purpose:
          type: string
          minLength: 1
          title: Purpose
          description: Agent purpose description (for context-aware attacks)
        categories:
          items:
            $ref: '#/components/schemas/AttackCategory'
          type: array
          minItems: 1
          title: Categories
          description: Attack categories to test
        custom_plugins:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Custom Plugins
          description: Custom plugin/probe names (for CUSTOM category)
        strategies:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Strategies
          description: Evaluation strategies (tool-specific)
        num_tests:
          type: integer
          maximum: 100
          minimum: 1
          title: Num Tests
          description: Number of test cases per category
          default: 25
        provider_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Provider Config
          description: Provider-specific configuration
      type: object
      required:
        - team_id
        - tool
        - purpose
        - categories
      title: CreateCampaignRequest
      description: Request body for creating a red team campaign.
    CreateCampaignResponse:
      properties:
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
        status:
          type: string
          title: Status
      type: object
      required:
        - campaign_id
        - status
      title: CreateCampaignResponse
      description: Response after creating a campaign.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RedteamTool:
      type: string
      enum:
        - diamond_security
        - promptfoo
        - garak
        - pyrit
        - unknown
      title: RedteamTool
      description: Supported red team tools.
    AttackCategory:
      type: string
      enum:
        - injection
        - jailbreak
        - harmful
        - pii
        - toxicity
        - hallucination
        - overreliance
        - custom
      title: AttackCategory
      description: |-
        Abstract attack categories (tool-agnostic).

        Each adapter maps these to tool-native plugin/probe/strategy names.
        Use CUSTOM with custom_plugins for tool-native passthrough.
    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

````