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

# Create Prompt

> Create a new prompt version.

First write for a given ``promptId`` is version 1. Subsequent POSTs
with the same ``promptId`` allocate the next version. The whole
SELECT MAX + INSERT runs under ``_reload_mutex`` so concurrent
admin POSTs serialize.



## OpenAPI

````yaml /standalone/openapi.json post /admin/api/v1/prompts
openapi: 3.1.0
info:
  title: Idun Agent Engine Server
  description: A production-ready server for conversational AI agents
  version: 0.6.1
servers: []
security: []
tags:
  - name: Runtime
    description: >-
      Public agent run endpoints, engine operations, and chat-channel webhooks.
      SSE streaming via the AG-UI protocol.
  - name: Agent Configuration
    description: >-
      Singleton admin endpoints for the agent, prompts, memory, guardrails, and
      onboarding wizard.
  - name: Auth & SSO
    description: >-
      Login, sessions, password change, SSO config, and the public SSO discovery
      endpoint.
  - name: Integrations & Tools
    description: MCP server registry and external integration credentials.
  - name: Observability
    description: Tracing/logging provider configuration.
  - name: Traces
    description: >-
      Trace and span storage admin endpoints — list, detail, delete, and
      pipeline-health for the standalone trace store.
  - name: Dashboard
    description: >-
      Operator dashboard widgets — KPIs, time-series, top errors, and
      configuration summary.
paths:
  /admin/api/v1/prompts:
    post:
      tags:
        - Agent Configuration
      summary: Create Prompt
      description: |-
        Create a new prompt version.

        First write for a given ``promptId`` is version 1. Subsequent POSTs
        with the same ``promptId`` allocate the next version. The whole
        SELECT MAX + INSERT runs under ``_reload_mutex`` so concurrent
        admin POSTs serialize.
      operationId: create_prompt_admin_api_v1_prompts_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StandalonePromptCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/StandaloneMutationResponse_StandalonePromptRead_
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StandalonePromptCreate:
      properties:
        promptId:
          type: string
          title: Promptid
        content:
          type: string
          title: Content
        tags:
          items:
            type: string
          type: array
          title: Tags
      type: object
      required:
        - promptId
        - content
      title: StandalonePromptCreate
      description: |-
        Body for POST /admin/api/v1/prompts.

        Creating a prompt with an existing ``prompt_id`` creates a new
        version at the DB layer (Phase 4+); the schema does not enforce
        uniqueness.
    StandaloneMutationResponse_StandalonePromptRead_:
      properties:
        data:
          $ref: '#/components/schemas/StandalonePromptRead'
        reload:
          $ref: '#/components/schemas/StandaloneReloadResult'
      type: object
      required:
        - data
        - reload
      title: StandaloneMutationResponse[StandalonePromptRead]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandalonePromptRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        promptId:
          type: string
          title: Promptid
        version:
          type: integer
          title: Version
        content:
          type: string
          title: Content
        tags:
          items:
            type: string
          type: array
          title: Tags
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - id
        - promptId
        - version
        - content
        - tags
        - createdAt
        - updatedAt
      title: StandalonePromptRead
      description: GET response and the data payload of POST/PATCH/DELETE responses.
    StandaloneReloadResult:
      properties:
        status:
          $ref: '#/components/schemas/StandaloneReloadStatus'
        message:
          type: string
          title: Message
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - status
        - message
      title: StandaloneReloadResult
      description: |-
        Reload outcome attached to every admin mutation response.

        ``reloaded`` means DB committed and runtime now uses the new config.
        ``restart_required`` means DB committed and process restart is needed.
        ``reload_failed`` means DB rolled back and runtime is unchanged.
    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
    StandaloneReloadStatus:
      type: string
      enum:
        - reloaded
        - restart_required
        - reload_failed
      title: StandaloneReloadStatus
      description: Outcome of a reload triggered by an admin mutation.

````