create prompts.md
Create Prompts
Creates prompts in a batch. Each item is validated independently, so the response can contain both created prompts and individual errors.
OpenAPI
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:
post:
tags:
- Prompts
summary: Create Prompts
description: Creates prompts in a batch. Each item is validated independently, so the response can contain both created prompts and individual errors.
operationId: v2_prompts_create
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateV2PromptsRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/V2PromptBatchResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- LightsageApiKeyAuth: []
components:
schemas:
CreateV2PromptsRequest:
properties:
prompts:
items:
$ref: '#/components/schemas/CreateV2PromptRequest'
type: array
maxItems: 100
minItems: 1
title: Prompts
type: object
required:
- prompts
title: CreateV2PromptsRequest
V2PromptBatchResponse:
properties:
created:
items:
$ref: '#/components/schemas/V2PromptResponse'
type: array
title: Created
count:
type: integer
title: Count
errors:
items:
$ref: '#/components/schemas/PromptBatchError'
type: array
title: Errors
type: object
required:
- created
- count
title: V2PromptBatchResponse
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
CreateV2PromptRequest:
properties:
topic_id:
type: string
title: Topic Id
description: Prompt topic ID from `GET /v2/prompts/topics`.
text:
type: string
minLength: 1
title: Text
platform_ids:
items:
type: string
type: array
title: Platform Ids
description: Answer-platform IDs from the prompt configuration. Omit to attach none.
run_settings:
anyOf:
- $ref: '#/components/schemas/V2PromptRunSettingsInput'
- type: 'null'
description: Run settings that apply to coding-agent runs of this prompt. Omitted fields keep their current or default values.
additionalProperties: false
type: object
required:
- topic_id
- text
title: CreateV2PromptRequest
V2PromptResponse:
properties:
id:
type: string
title: Id
topic_id:
type: string
title: Topic Id
text:
type: string
title: Text
is_branded:
type: boolean
title: Is Branded
description: Whether the prompt text names your own brand. Detected when the prompt is created, and can be set explicitly.
default: false
language_id:
anyOf:
- type: string
- type: 'null'
title: Language Id
region_id:
anyOf:
- type: string
- type: 'null'
title: Region Id
status:
type: string
enum:
- active
- inactive
- archived
title: Status
description: The prompt lifecycle status. Only `active` prompts run on schedule.
topic:
anyOf:
- $ref: '#/components/schemas/PublicPromptTopic'
- type: 'null'
platforms:
items:
$ref: '#/components/schemas/PublicPromptPlatform'
type: array
title: Platforms
tags:
items:
$ref: '#/components/schemas/PublicPromptTag'
type: array
title: Tags
created_at:
anyOf:
- type: string
- type: 'null'
title: Created At
updated_at:
anyOf:
- type: string
- type: 'null'
title: Updated At
run_settings:
$ref: '#/components/schemas/V2PromptRunSettings'
description: Run settings that apply to coding-agent runs of this prompt.
type: object
required:
- id
- topic_id
- text
- status
title: V2PromptResponse
PromptBatchError:
properties:
index:
type: integer
title: Index
description: Zero-based index into the submitted `prompts` array.
text:
type: string
title: Text
error:
type: string
title: Error
type: object
required:
- index
- text
- error
title: PromptBatchError
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
V2PromptRunSettingsInput:
properties:
search_grounding:
anyOf:
- $ref: '#/components/schemas/SearchGroundingMode'
- type: 'null'
description: Web access for coding-agent runs of this prompt. `disabled` blocks web access in the agent sandbox, `enabled` requires the agent to retrieve from the web, and `default` leaves the choice to the agent. Answer engines are not affected. An eval-run target that sets `search_grounding` overrides this setting.
web_search_instruction:
anyOf:
- type: string
enum:
- omit
- append
- both
- type: 'null'
title: Web Search Instruction
description: Whether coding-agent runs append "Use web search." to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.
additionalProperties: false
type: object
title: V2PromptRunSettingsInput
PublicPromptTopic:
properties:
id:
type: string
title: Id
name:
type: string
title: Name
created_at:
anyOf:
- type: string
- type: 'null'
title: Created At
updated_at:
anyOf:
- type: string
- type: 'null'
title: Updated At
type: object
required:
- id
- name
title: PublicPromptTopic
PublicPromptPlatform:
properties:
id:
type: string
title: Id
name:
type: string
title: Name
type: object
required:
- id
- name
title: PublicPromptPlatform
PublicPromptTag:
properties:
id:
type: string
title: Id
name:
type: string
title: Name
created_at:
anyOf:
- type: string
- type: 'null'
title: Created At
updated_at:
anyOf:
- type: string
- type: 'null'
title: Updated At
type: object
required:
- id
- name
title: PublicPromptTag
V2PromptRunSettings:
properties:
search_grounding:
$ref: '#/components/schemas/SearchGroundingMode'
description: Web access for coding-agent runs of this prompt. `disabled` blocks web access in the agent sandbox, `enabled` requires the agent to retrieve from the web, and `default` leaves the choice to the agent. Answer engines are not affected. An eval-run target that sets `search_grounding` overrides this setting.
default: default
web_search_instruction:
type: string
enum:
- omit
- append
- both
title: Web Search Instruction
description: Whether coding-agent runs append "Use web search." to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.
default: omit
type: object
title: V2PromptRunSettings
SearchGroundingMode:
type: string
enum:
- disabled
- enabled
- default
title: SearchGroundingMode
description: Requested web-retrieval behavior for an eval run.
securitySchemes:
LightsageApiKeyAuth:
type: apiKey
in: header
name: X-Lightsage-Api-Key