> ## 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.

# Sync/upsert a prompt with local content

> Sync/upsert a prompt with local content



## OpenAPI

````yaml POST /api/prompts/{id}/sync
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/prompts/{id}/sync:
    post:
      description: Sync/upsert a prompt with local content
      operationId: postApiPromptsByIdSync
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                configData:
                  type: object
                  properties:
                    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
                    max_tokens:
                      type: number
                    top_p:
                      type: number
                    frequency_penalty:
                      type: number
                    presence_penalty:
                      type: number
                    seed:
                      type: number
                    top_k:
                      type: number
                    min_p:
                      type: number
                    repetition_penalty:
                      type: number
                    reasoning:
                      type: string
                    reasoning_effort:
                      type: string
                    thinkingLevel:
                      type: string
                    effort:
                      type: string
                    verbosity:
                      type: string
                    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
                    prompting_technique:
                      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
                    response_format:
                      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:
                    - prompt
                    - outputs
                    - model
                parameters:
                  type: object
                  additionalProperties: {}
                localVersion:
                  type: number
                  minimum: 0
                commitMessage:
                  type: string
              required:
                - configData
      responses:
        '200':
          description: Sync result
          content:
            application/json:
              schema:
                type: object
                properties:
                  action:
                    type: string
                    enum:
                      - created
                      - updated
                      - conflict
                      - up_to_date
                  prompt:
                    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: []
                      parameters:
                        type: object
                        additionalProperties: {}
                        default: {}
                    required:
                      - id
                      - handle
                      - scope
                      - name
                      - updatedAt
                      - projectId
                      - organizationId
                      - versionId
                      - version
                      - createdAt
                      - prompt
                      - messages
                      - inputs
                      - outputs
                      - model
                      - tags
                      - parameters
                  conflictInfo:
                    type: object
                    properties:
                      localVersion:
                        type: number
                      remoteVersion:
                        type: number
                      differences:
                        type: array
                        items:
                          type: string
                      remoteConfigData:
                        type: object
                        properties:
                          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
                          max_tokens:
                            type: number
                          top_p:
                            type: number
                          frequency_penalty:
                            type: number
                          presence_penalty:
                            type: number
                          seed:
                            type: number
                          top_k:
                            type: number
                          min_p:
                            type: number
                          repetition_penalty:
                            type: number
                          reasoning:
                            type: string
                          reasoning_effort:
                            type: string
                          thinkingLevel:
                            type: string
                          effort:
                            type: string
                          verbosity:
                            type: string
                          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
                          prompting_technique:
                            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
                          response_format:
                            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:
                          - prompt
                          - messages
                          - inputs
                          - outputs
                          - model
                      remoteConfig:
                        type: object
                        additionalProperties: {}
                    required:
                      - localVersion
                      - remoteVersion
                      - differences
                      - remoteConfigData
                required:
                  - action
        '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
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````