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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Sync/upsert a prompt with local content

> Sync/upsert a prompt with local content



## OpenAPI

````yaml POST /api/v1/prompts/{id}/sync
openapi: 3.1.0
info:
  title: LangWatch API
  description: LangWatch openapi spec
  version: 1.0.0
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/v1/prompts/{id}/sync:
    post:
      description: Sync/upsert a prompt with local content
      operationId: postApiPromptsByIdSync
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                configData:
                  type: object
                  properties:
                    prompt:
                      type: string
                    messages:
                      default: []
                      type: array
                      items:
                        type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - user
                              - assistant
                              - system
                          content:
                            type: string
                        required:
                          - role
                          - content
                    inputs:
                      default: []
                      type: array
                      items:
                        type: object
                        properties:
                          identifier:
                            type: string
                            minLength: 1
                          type:
                            type: string
                            enum:
                              - str
                              - float
                              - bool
                              - image
                              - file
                              - list
                              - list[str]
                              - list[float]
                              - list[int]
                              - list[bool]
                              - dict
                              - chat_messages
                        required:
                          - identifier
                          - type
                    outputs:
                      minItems: 1
                      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: {}
                        required:
                          - identifier
                          - type
                    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
                              propertyNames:
                                type: string
                              additionalProperties:
                                type: array
                                items: {}
                            columnTypes:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                      - string
                                      - boolean
                                      - number
                                      - date
                                      - list
                                      - json
                                      - spans
                                      - rag_contexts
                                      - chat_messages
                                      - annotations
                                      - evaluations
                                      - image
                                      - file
                                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
                                  propertyNames:
                                    type: string
                                  additionalProperties:
                                    type: array
                                    items: {}
                                columnTypes:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      name:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                          - string
                                          - boolean
                                          - number
                                          - date
                                          - list
                                          - json
                                          - spans
                                          - rag_contexts
                                          - chat_messages
                                          - annotations
                                          - evaluations
                                          - image
                                          - file
                                    required:
                                      - name
                                      - type
                              required:
                                - records
                                - columnTypes
                      required:
                        - type
                    response_format:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - json_schema
                        json_schema:
                          anyOf:
                            - type: object
                              properties:
                                name:
                                  type: string
                                schema:
                                  type: object
                                  properties: {}
                                  additionalProperties: {}
                              required:
                                - name
                                - schema
                            - type: 'null'
                      required:
                        - type
                        - json_schema
                  required:
                    - prompt
                    - outputs
                    - model
                parameters:
                  type: object
                  propertyNames:
                    type: string
                  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:
                          - PROJECT
                          - ORGANIZATION
                      name:
                        type: string
                      updatedAt:
                        type: string
                        format: date-time
                      projectId:
                        type: string
                      organizationId:
                        type: string
                      versionId:
                        type: string
                      authorId:
                        type:
                          - string
                          - 'null'
                      version:
                        type: number
                      createdAt:
                        type: string
                        format: date-time
                      commitMessage:
                        type:
                          - string
                          - 'null'
                      prompt:
                        type: string
                      messages:
                        default: []
                        type: array
                        items:
                          type: object
                          properties:
                            role:
                              type: string
                              enum:
                                - user
                                - assistant
                                - system
                            content:
                              type: string
                          required:
                            - role
                            - content
                          additionalProperties: false
                      inputs:
                        default: []
                        type: array
                        items:
                          type: object
                          properties:
                            identifier:
                              type: string
                              minLength: 1
                            type:
                              type: string
                              enum:
                                - str
                                - float
                                - bool
                                - image
                                - file
                                - list
                                - list[str]
                                - list[float]
                                - list[int]
                                - list[bool]
                                - dict
                                - chat_messages
                          required:
                            - identifier
                            - type
                          additionalProperties: false
                      outputs:
                        minItems: 1
                        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: {}
                          required:
                            - identifier
                            - type
                          additionalProperties: false
                      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
                                propertyNames:
                                  type: string
                                additionalProperties:
                                  type: array
                                  items: {}
                              columnTypes:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    type:
                                      type: string
                                      enum:
                                        - string
                                        - boolean
                                        - number
                                        - date
                                        - list
                                        - json
                                        - spans
                                        - rag_contexts
                                        - chat_messages
                                        - annotations
                                        - evaluations
                                        - image
                                        - file
                                  required:
                                    - name
                                    - type
                                  additionalProperties: false
                            required:
                              - records
                              - columnTypes
                            additionalProperties: false
                        additionalProperties: false
                      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
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: array
                                      items: {}
                                  columnTypes:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                            - string
                                            - boolean
                                            - number
                                            - date
                                            - list
                                            - json
                                            - spans
                                            - rag_contexts
                                            - chat_messages
                                            - annotations
                                            - evaluations
                                            - image
                                            - file
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                required:
                                  - records
                                  - columnTypes
                                additionalProperties: false
                            additionalProperties: false
                        required:
                          - type
                        additionalProperties: false
                      responseFormat:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - json_schema
                          json_schema:
                            anyOf:
                              - type: object
                                properties:
                                  name:
                                    type: string
                                  schema:
                                    type: object
                                    properties: {}
                                    additionalProperties: {}
                                required:
                                  - name
                                  - schema
                                additionalProperties: false
                              - type: 'null'
                        required:
                          - type
                          - json_schema
                        additionalProperties: false
                      tags:
                        default: []
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            versionId:
                              type: string
                          required:
                            - name
                            - versionId
                          additionalProperties: false
                      parameters:
                        default: {}
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/JsonValue'
                    required:
                      - id
                      - handle
                      - scope
                      - name
                      - updatedAt
                      - projectId
                      - organizationId
                      - versionId
                      - version
                      - createdAt
                      - prompt
                      - messages
                      - inputs
                      - outputs
                      - model
                      - tags
                      - parameters
                    additionalProperties: false
                  conflictInfo:
                    type: object
                    properties:
                      localVersion:
                        type: number
                      remoteVersion:
                        type: number
                      differences:
                        type: array
                        items:
                          type: string
                      remoteConfigData:
                        type: object
                        properties:
                          prompt:
                            type: string
                          messages:
                            default: []
                            type: array
                            items:
                              type: object
                              properties:
                                role:
                                  type: string
                                  enum:
                                    - user
                                    - assistant
                                    - system
                                content:
                                  type: string
                              required:
                                - role
                                - content
                              additionalProperties: false
                          inputs:
                            default: []
                            type: array
                            items:
                              type: object
                              properties:
                                identifier:
                                  type: string
                                  minLength: 1
                                type:
                                  type: string
                                  enum:
                                    - str
                                    - float
                                    - bool
                                    - image
                                    - file
                                    - list
                                    - list[str]
                                    - list[float]
                                    - list[int]
                                    - list[bool]
                                    - dict
                                    - chat_messages
                              required:
                                - identifier
                                - type
                              additionalProperties: false
                          outputs:
                            minItems: 1
                            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: {}
                              required:
                                - identifier
                                - type
                              additionalProperties: false
                          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
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: array
                                      items: {}
                                  columnTypes:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                            - string
                                            - boolean
                                            - number
                                            - date
                                            - list
                                            - json
                                            - spans
                                            - rag_contexts
                                            - chat_messages
                                            - annotations
                                            - evaluations
                                            - image
                                            - file
                                      required:
                                        - name
                                        - type
                                      additionalProperties: false
                                required:
                                  - records
                                  - columnTypes
                                additionalProperties: false
                            additionalProperties: false
                          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
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: array
                                          items: {}
                                      columnTypes:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                            name:
                                              type: string
                                            type:
                                              type: string
                                              enum:
                                                - string
                                                - boolean
                                                - number
                                                - date
                                                - list
                                                - json
                                                - spans
                                                - rag_contexts
                                                - chat_messages
                                                - annotations
                                                - evaluations
                                                - image
                                                - file
                                          required:
                                            - name
                                            - type
                                          additionalProperties: false
                                    required:
                                      - records
                                      - columnTypes
                                    additionalProperties: false
                                additionalProperties: false
                            required:
                              - type
                            additionalProperties: false
                          response_format:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - json_schema
                              json_schema:
                                anyOf:
                                  - type: object
                                    properties:
                                      name:
                                        type: string
                                      schema:
                                        type: object
                                        properties: {}
                                        additionalProperties: {}
                                    required:
                                      - name
                                      - schema
                                    additionalProperties: false
                                  - type: 'null'
                            required:
                              - type
                              - json_schema
                            additionalProperties: false
                        required:
                          - prompt
                          - messages
                          - inputs
                          - outputs
                          - model
                        additionalProperties: false
                      remoteParameters:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - localVersion
                      - remoteVersion
                      - differences
                      - remoteConfigData
                    additionalProperties: false
                required:
                  - action
                additionalProperties: false
        '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
      security:
        - project_api_key: []
components:
  schemas:
    JsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
  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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.