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

# Set Targets

> Sets which answer engines and coding agents run a topic's prompts on schedule, the same way the prompt editor does. The list replaces the topic's targets: targets you leave out stop running. Every prompt in the topic is set to exactly these platforms; you can still narrow one prompt afterwards with `platform_ids`. Name coding agents with IDs from `GET /v2/agents`, and list a harness more than once to run it on several models. To pick agents for a single run without changing the schedule, pass `agent` to `POST /v2/prompts/runs` instead.



## OpenAPI

````yaml /openapi.json put /v2/prompts/targets
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
tags:
  - name: Status
    description: Check API availability and validate the calling API key.
  - name: Visibility
    description: >-
      Measure visibility, citations, competitors, and prompt performance across
      answer platforms.
  - name: Prompts
    description: Manage tracked prompts and topics, and inspect their stored runs.
  - name: Opportunities
    description: Review ranked opportunities computed from prompt visibility results.
  - name: Tasks
    description: Manage the persisted action queue and task lifecycle.
  - name: Site Audits
    description: Review website audit results and page-level findings.
  - name: Agent Analytics
    description: >-
      See which coding agents, AI bots, and people visit your tracked sites,
      which pages they read, which pages return errors, and where the visits
      come from.
  - name: Evals
    description: Define eval tasks, judges, subjects, and saved configurations.
  - name: Eval Templates
    description: >-
      Select reusable judges, targets, schedules, metadata, and runtime settings
      with `POST /v2/eval-templates`, then copy only those settings into
      prompt-specific evals with `POST /v2/evals/batch`. Templates never contain
      prompts and remain independent from evals created from them.
  - name: Eval Runs
    description: Start eval runs and inspect their lifecycle state.
  - name: Eval Results
    description: Review completed eval outcomes and diagnostic details.
  - name: Agent Preference
    description: >-
      Compare your company head-to-head with a tracked competitor. Create a
      comparison with `POST /v2/agent-preference/evals`, run it with `POST
      /v2/eval-runs`, then read which company agents recommended.
  - name: Agents
    description: List runnable coding-agent harness and model combinations.
  - name: Repositories
    description: Manage reusable Git repository workspaces.
  - name: Environments
    description: List reusable runtime environments without exposing secret values.
  - name: MCP Servers
    description: List reusable MCP server integrations without exposing credentials.
  - name: CLIs
    description: List reusable command-line interfaces without exposing setup commands.
  - name: Skills
    description: List reusable skills available to workflows and evals.
paths:
  /v2/prompts/targets:
    put:
      tags:
        - Prompts
      summary: Set Targets
      description: >-
        Sets which answer engines and coding agents run a topic's prompts on
        schedule, the same way the prompt editor does. The list replaces the
        topic's targets: targets you leave out stop running. Every prompt in the
        topic is set to exactly these platforms; you can still narrow one prompt
        afterwards with `platform_ids`. Name coding agents with IDs from `GET
        /v2/agents`, and list a harness more than once to run it on several
        models. To pick agents for a single run without changing the schedule,
        pass `agent` to `POST /v2/prompts/runs` instead.
      operationId: v2_prompt_targets_set
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetV2PromptTargetsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetV2PromptTargetsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LightsageApiKeyAuth: []
components:
  schemas:
    SetV2PromptTargetsRequest:
      properties:
        topic_id:
          type: string
          title: Topic Id
          description: Prompt topic ID from `GET /v2/prompts/topics`.
        targets:
          items:
            $ref: '#/components/schemas/V2PromptTargetInput'
          type: array
          maxItems: 50
          minItems: 1
          title: Targets
          description: >-
            The complete set of answer engines and coding agents for the topic.
            Targets you leave out stop running. List an agent harness more than
            once to run it on several models.
      additionalProperties: false
      type: object
      required:
        - topic_id
        - targets
      title: SetV2PromptTargetsRequest
      examples:
        - targets:
            - answer_engine: chatgpt
            - answer_engine: perplexity
            - agent: claude-code:claude-opus-5-5
            - agent: codex:gpt-6-1-sol
          topic_id: 6f1c2a9e-3b7d-4e2a-9c51-0d8e4f7a2b13
    SetV2PromptTargetsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/V2PromptTarget'
          type: array
          title: Data
        count:
          type: integer
          title: Count
        updated_prompt_count:
          type: integer
          title: Updated Prompt Count
          description: Prompts in the topic whose platforms were set to match the targets.
      type: object
      required:
        - count
        - updated_prompt_count
      title: SetV2PromptTargetsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    V2PromptTargetInput:
      properties:
        answer_engine:
          anyOf:
            - type: string
              enum:
                - chatgpt
                - google-ai-overviews
                - google-ai-mode
                - gemini-search
                - perplexity
                - claude
                - microsoft-copilot
            - type: 'null'
          title: Answer Engine
          description: >-
            Answer engine to run the topic's prompts on. Set this or `agent`,
            not both.
        agent:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Agent
          description: >-
            Runnable agent from `GET /v2/agents`, a coding-agent harness and
            model such as `claude-code:claude-opus-5-5`. Set this or
            `answer_engine`, not both.
        frequency:
          type: string
          enum:
            - daily
            - every_other_day
            - weekly
            - manual
          title: Frequency
          description: >-
            How often this target runs on schedule. `manual` keeps it for runs
            you start yourself. Frequencies other than `daily` require custom
            prompt scheduling on the organization.
          default: daily
      additionalProperties: false
      type: object
      title: V2PromptTargetInput
    V2PromptTarget:
      properties:
        id:
          type: string
          title: Id
        topic:
          anyOf:
            - $ref: '#/components/schemas/V2PromptRunTopic'
            - type: 'null'
          description: Topic the target runs for. Null means it runs for every topic.
        kind:
          type: string
          enum:
            - answer_engine
            - coding_agent
          title: Kind
        answer_engine:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer Engine
          description: Answer engine identifier for answer-engine targets.
        agent:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent
          description: Agent ID from `GET /v2/agents` for coding-agent targets.
        name:
          type: string
          title: Name
          description: Human-readable answer engine or agent name.
        frequency:
          type: string
          enum:
            - daily
            - every_other_day
            - weekly
            - manual
          title: Frequency
          description: >-
            How often this target runs on schedule. `manual` keeps it for runs
            you start yourself. Frequencies other than `daily` require custom
            prompt scheduling on the organization.
        next_run_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Run At
        last_run_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run At
      type: object
      required:
        - id
        - kind
        - name
        - frequency
      title: V2PromptTarget
    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
    V2PromptRunTopic:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: V2PromptRunTopic
  securitySchemes:
    LightsageApiKeyAuth:
      type: apiKey
      in: header
      name: X-Lightsage-Api-Key

````

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