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

# Update prompt

> Update a prompt



## OpenAPI

````yaml PUT /api/prompts/{id}
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - api_key: []
paths:
  /api/prompts/{id}:
    put:
      description: Update a prompt
      operationId: putApiPromptsById
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                temperature:
                  type: number
                maxTokens:
                  type: number
                commitMessage:
                  type: string
                authorId:
                  type: string
                prompt:
                  type: string
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                          - system
                      content:
                        type: string
                    required:
                      - role
                      - content
                inputs:
                  type: array
                  items:
                    type: object
                    properties:
                      identifier:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - str
                          - float
                          - bool
                          - image
                          - list
                          - list[str]
                          - list[float]
                          - list[int]
                          - list[bool]
                          - dict
                          - chat_messages
                    required:
                      - identifier
                      - type
                outputs:
                  type: array
                  items:
                    type: object
                    properties:
                      identifier:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - str
                          - float
                          - bool
                          - json_schema
                      json_schema:
                        type: object
                        properties:
                          type:
                            type: string
                            minLength: 1
                        required:
                          - type
                        additionalProperties: true
                    required:
                      - identifier
                      - type
                schemaVersion:
                  type: string
                  enum:
                    - '1.0'
                scope:
                  type: string
                  enum:
                    - ORGANIZATION
                    - PROJECT
                handle:
                  type: string
                  pattern: ^[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$
              required:
                - commitMessage
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  handle:
                    type:
                      - string
                      - 'null'
                  scope:
                    type: string
                    enum:
                      - ORGANIZATION
                      - PROJECT
                  name:
                    type: string
                  updatedAt:
                    type: string
                  projectId:
                    type: string
                  organizationId:
                    type: string
                  versionId:
                    type: string
                  authorId:
                    type:
                      - string
                      - 'null'
                  version:
                    type: number
                  createdAt:
                    type: string
                  commitMessage:
                    type:
                      - string
                      - 'null'
                  prompt:
                    type: string
                  messages:
                    type: array
                    items:
                      type: object
                      properties:
                        role:
                          type: string
                          enum:
                            - user
                            - assistant
                            - system
                        content:
                          type: string
                      required:
                        - role
                        - content
                    default: []
                  inputs:
                    type: array
                    items:
                      type: object
                      properties:
                        identifier:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - str
                            - float
                            - bool
                            - image
                            - list
                            - list[str]
                            - list[float]
                            - list[int]
                            - list[bool]
                            - dict
                            - chat_messages
                      required:
                        - identifier
                        - type
                    default: []
                  outputs:
                    type: array
                    items:
                      type: object
                      properties:
                        identifier:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - str
                            - float
                            - bool
                            - json_schema
                        json_schema:
                          type: object
                          properties:
                            type:
                              type: string
                              minLength: 1
                          required:
                            - type
                          additionalProperties: true
                      required:
                        - identifier
                        - type
                    minItems: 1
                  model:
                    type: string
                    minLength: 1
                  temperature:
                    type: number
                  maxTokens:
                    type: number
                  demonstrations:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      inline:
                        type: object
                        properties:
                          records:
                            type: object
                            additionalProperties:
                              type: array
                              items: {}
                          columnTypes:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                type:
                                  anyOf:
                                    - type: string
                                      const: string
                                    - type: string
                                      const: boolean
                                    - type: string
                                      const: number
                                    - type: string
                                      const: date
                                    - type: string
                                      const: list
                                    - type: string
                                      const: json
                                    - type: string
                                      const: spans
                                    - type: string
                                      const: rag_contexts
                                    - type: string
                                      const: chat_messages
                                    - type: string
                                      const: annotations
                                    - type: string
                                      const: evaluations
                                    - type: string
                                      const: image
                              required:
                                - name
                                - type
                        required:
                          - records
                          - columnTypes
                  promptingTechnique:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - few_shot
                          - in_context
                          - chain_of_thought
                      demonstrations:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          inline:
                            type: object
                            properties:
                              records:
                                type: object
                                additionalProperties:
                                  type: array
                                  items: {}
                              columnTypes:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    type:
                                      anyOf:
                                        - type: string
                                          const: string
                                        - type: string
                                          const: boolean
                                        - type: string
                                          const: number
                                        - type: string
                                          const: date
                                        - type: string
                                          const: list
                                        - type: string
                                          const: json
                                        - type: string
                                          const: spans
                                        - type: string
                                          const: rag_contexts
                                        - type: string
                                          const: chat_messages
                                        - type: string
                                          const: annotations
                                        - type: string
                                          const: evaluations
                                        - type: string
                                          const: image
                                  required:
                                    - name
                                    - type
                            required:
                              - records
                              - columnTypes
                    required:
                      - type
                  responseFormat:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - json_schema
                      json_schema:
                        type:
                          - object
                          - 'null'
                        properties:
                          name:
                            type: string
                          schema:
                            type: object
                            additionalProperties: true
                        required:
                          - name
                          - schema
                    required:
                      - type
                      - json_schema
                required:
                  - id
                  - handle
                  - scope
                  - name
                  - updatedAt
                  - projectId
                  - organizationId
                  - versionId
                  - version
                  - createdAt
                  - prompt
                  - messages
                  - inputs
                  - outputs
                  - model
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
        '422':
          description: Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Auth-Token

````