LangWatch Prompts API

The Prompts API from LangWatch — 8 operation(s) for prompts.

Documentation

Specifications

OpenAPI Specification

langwatch-prompts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: LangWatch Agents Prompts API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
- url: https://app.langwatch.ai
security:
- project_api_key: []
tags:
- name: Prompts
paths:
  /api/prompts:
    get:
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  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
                    tags:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          versionId:
                            type: string
                        required:
                        - name
                        - versionId
                      default: []
                  required:
                  - id
                  - handle
                  - scope
                  - name
                  - updatedAt
                  - projectId
                  - organizationId
                  - versionId
                  - version
                  - createdAt
                  - prompt
                  - messages
                  - inputs
                  - outputs
                  - model
                  - tags
        '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
        '422':
          description: Unprocessable Entity
          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
      operationId: getApiPrompts
      parameters: []
      description: Get all prompts for a project
      tags:
      - Prompts
    post:
      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
                  tags:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        versionId:
                          type: string
                      required:
                      - name
                      - versionId
                    default: []
                required:
                - id
                - handle
                - scope
                - name
                - updatedAt
                - projectId
                - organizationId
                - versionId
                - version
                - createdAt
                - prompt
                - messages
                - inputs
                - outputs
                - model
                - tags
        '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
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
                - message
        '422':
          description: Unprocessable Entity
          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
      operationId: postApiPrompts
      parameters: []
      description: Create a new prompt with default initial version
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                handle:
                  type: string
                  pattern: ^[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$
                scope:
                  type: string
                  enum:
                  - ORGANIZATION
                  - PROJECT
                  default: PROJECT
                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'
                tags:
                  type: array
                  items:
                    type: string
                    minLength: 1
              required:
              - handle
              additionalProperties: false
      tags:
      - Prompts
  /api/prompts/tags:
    get:
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    createdAt:
                      type: string
                  required:
                  - id
                  - name
                  - createdAt
        '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
        '422':
          description: Unprocessable Entity
          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
      operationId: getApiPromptsTags
      parameters: []
      description: List all prompt tag definitions for the organization
      tags:
      - Prompts
    post:
      responses:
        '201':
          description: Tag created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  createdAt:
                    type: string
                required:
                - id
                - name
                - createdAt
        '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
    

# --- truncated at 32 KB (135 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/langwatch/refs/heads/main/openapi/langwatch-prompts-api-openapi.yml