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

# Add a version

> Content is versioned, so updating a prompt appends a version rather than overwriting one. Earlier versions stay readable.



## OpenAPI

````yaml /openapi.json post /v1/prompts.update
openapi: 3.1.0
info:
  title: Anpord API
  version: 1.0.0
  description: >-
    Prompt management. Every endpoint takes a JSON body over POST and
    authenticates with a bearer API key.
servers:
  - description: Production
    url: https://api.anpord.com
security: []
tags:
  - name: Prompts
    description: >-
      Read and write prompts. Content is versioned, so writes append rather than
      overwrite, and channels decide which version callers receive.
paths:
  /v1/prompts.update:
    post:
      tags:
        - Prompts
      summary: Add a version
      description: >-
        Content is versioned, so updating a prompt appends a version rather than
        overwriting one. Earlier versions stay readable.
      operationId: prompts.update
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePromptRequest'
        required: true
      responses:
        '200':
          description: A prompt, with its version history when `includeVersions` is set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/HttpApiDecodeError'
                  - $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
      security:
        - bearer: []
components:
  schemas:
    UpdatePromptRequest:
      type: object
      required:
        - content
        - id
      properties:
        config:
          type: object
          required: []
          properties: {}
          additionalProperties:
            $id: /schemas/unknown
            title: unknown
        content:
          type: string
          description: a string at least 1 character(s) long
          title: minLength(1)
          minLength: 1
        id:
          type: string
          description: a string matching the pattern ^[a-z0-9][a-z0-9/_-]*$
          title: maxLength(255)
          minLength: 1
          maxLength: 255
          pattern: ^[a-z0-9][a-z0-9/_-]*$
        message:
          type: string
          description: a string at most 500 character(s) long
          title: maxLength(500)
          maxLength: 500
      additionalProperties: false
      description: Add a version to a prompt. The new version becomes the latest.
    Prompt:
      type: object
      required:
        - channel
        - config
        - content
        - createdAt
        - id
        - message
        - name
        - version
      properties:
        channel:
          anyOf:
            - type: string
              description: >-
                Addresses a version. `latest` is derived from the highest
                version rather than stored, so it cannot drift from the version
                table.
              title: maxLength(36)
              minLength: 1
              maxLength: 36
              pattern: ^[a-z0-9][a-z0-9_-]*$
            - type: 'null'
        config:
          type: object
          required: []
          properties: {}
          additionalProperties:
            $id: /schemas/unknown
            title: unknown
        content:
          type: string
        createdAt:
          $ref: '#/components/schemas/Instant'
        id:
          type: string
          description: a string matching the pattern ^[a-z0-9][a-z0-9/_-]*$
          title: maxLength(255)
          minLength: 1
          maxLength: 255
          pattern: ^[a-z0-9][a-z0-9/_-]*$
        message:
          anyOf:
            - type: string
              description: a string at most 500 character(s) long
              title: maxLength(500)
              maxLength: 500
            - type: 'null'
        name:
          type: string
          description: a string at most 255 character(s) long
          title: maxLength(255)
          minLength: 1
          maxLength: 255
        version:
          $ref: '#/components/schemas/Int'
          description: a positive number
          title: positive
          exclusiveMinimum: 0
        versions:
          type: array
          items:
            $ref: '#/components/schemas/Version'
      additionalProperties: false
      description: A prompt, with its version history when `includeVersions` is set.
    HttpApiDecodeError:
      type: object
      required:
        - issues
        - message
        - _tag
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/Issue'
        message:
          type: string
        _tag:
          type: string
          enum:
            - HttpApiDecodeError
      additionalProperties: false
      description: The request did not match the expected schema
    BadRequest:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - BadRequest
      additionalProperties: false
    Unauthorized:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Unauthorized
      additionalProperties: false
    NotFound:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - NotFound
      additionalProperties: false
    Conflict:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Conflict
      additionalProperties: false
    Instant:
      type: string
      description: An ISO-8601 timestamp in UTC.
    Int:
      type: integer
      description: an integer
      title: int
    Version:
      type: object
      required:
        - createdAt
        - message
        - version
      properties:
        createdAt:
          $ref: '#/components/schemas/Instant'
        message:
          anyOf:
            - type: string
              description: a string at most 500 character(s) long
              title: maxLength(500)
              maxLength: 500
            - type: 'null'
        version:
          $ref: '#/components/schemas/Int'
          description: a positive number
          title: positive
          exclusiveMinimum: 0
      additionalProperties: false
      description: One entry in a prompt's history.
    Issue:
      type: object
      required:
        - _tag
        - path
        - message
      properties:
        _tag:
          type: string
          enum:
            - Pointer
            - Unexpected
            - Missing
            - Composite
            - Refinement
            - Transformation
            - Type
            - Forbidden
          description: The tag identifying the type of parse issue
        path:
          type: array
          items:
            $ref: '#/components/schemas/PropertyKey'
          description: The path to the property where the issue occurred
        message:
          type: string
          description: A descriptive message explaining the issue
      additionalProperties: false
      description: >-
        Represents an error encountered while parsing a value to match the
        schema
    PropertyKey:
      anyOf:
        - type: string
        - type: number
        - type: object
          required:
            - _tag
            - key
          properties:
            _tag:
              type: string
              enum:
                - symbol
            key:
              type: string
          additionalProperties: false
          description: an object to be decoded into a globally shared symbol
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````