Skip to main content
POST
/
api
/
prompts
/
{id}
/
sync
Python
import requests

url = "https://app.langwatch.ai/api/prompts/{id}/sync"

payload = { "configData": {
        "prompt": "<string>",
        "outputs": [{ "identifier": "<string>" }],
        "model": "<string>",
        "messages": [],
        "inputs": [],
        "temperature": 123,
        "max_tokens": 123,
        "top_p": 123,
        "frequency_penalty": 123,
        "presence_penalty": 123,
        "seed": 123,
        "top_k": 123,
        "min_p": 123,
        "repetition_penalty": 123,
        "reasoning": "<string>",
        "reasoning_effort": "<string>",
        "thinkingLevel": "<string>",
        "effort": "<string>",
        "verbosity": "<string>",
        "demonstrations": {
            "id": "<string>",
            "name": "<string>"
        }
    } }
headers = {
    "X-Auth-Token": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    configData: {
      prompt: '<string>',
      outputs: [{identifier: '<string>'}],
      model: '<string>',
      messages: [],
      inputs: [],
      temperature: 123,
      max_tokens: 123,
      top_p: 123,
      frequency_penalty: 123,
      presence_penalty: 123,
      seed: 123,
      top_k: 123,
      min_p: 123,
      repetition_penalty: 123,
      reasoning: '<string>',
      reasoning_effort: '<string>',
      thinkingLevel: '<string>',
      effort: '<string>',
      verbosity: '<string>',
      demonstrations: {id: '<string>', name: '<string>'}
    }
  })
};

fetch('https://app.langwatch.ai/api/prompts/{id}/sync', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
curl --request POST \
  --url https://app.langwatch.ai/api/prompts/{id}/sync \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Token: <api-key>' \
  --data '
{
  "configData": {
    "prompt": "<string>",
    "outputs": [
      {
        "identifier": "<string>"
      }
    ],
    "model": "<string>",
    "messages": [],
    "inputs": [],
    "temperature": 123,
    "max_tokens": 123,
    "top_p": 123,
    "frequency_penalty": 123,
    "presence_penalty": 123,
    "seed": 123,
    "top_k": 123,
    "min_p": 123,
    "repetition_penalty": 123,
    "reasoning": "<string>",
    "reasoning_effort": "<string>",
    "thinkingLevel": "<string>",
    "effort": "<string>",
    "verbosity": "<string>",
    "demonstrations": {
      "id": "<string>",
      "name": "<string>"
    }
  }
}
'
{
  "prompt": {
    "id": "<string>",
    "handle": "<string>",
    "name": "<string>",
    "updatedAt": "<string>",
    "projectId": "<string>",
    "organizationId": "<string>",
    "versionId": "<string>",
    "version": 123,
    "createdAt": "<string>",
    "prompt": "<string>",
    "messages": [],
    "inputs": [],
    "outputs": [
      {
        "identifier": "<string>",
        "json_schema": {
          "type": "<string>"
        }
      }
    ],
    "model": "<string>",
    "tags": [],
    "parameters": {},
    "authorId": "<string>",
    "commitMessage": "<string>",
    "temperature": 123,
    "maxTokens": 123,
    "demonstrations": {
      "id": "<string>",
      "name": "<string>",
      "inline": {
        "records": {},
        "columnTypes": [
          {
            "name": "<string>",
            "type": "<string>",
            "id": "<string>"
          }
        ]
      }
    },
    "promptingTechnique": {
      "demonstrations": {
        "id": "<string>",
        "name": "<string>",
        "inline": {
          "records": {},
          "columnTypes": [
            {
              "name": "<string>",
              "type": "<string>",
              "id": "<string>"
            }
          ]
        }
      }
    },
    "responseFormat": {
      "type": "json_schema",
      "json_schema": {
        "name": "<string>",
        "schema": {}
      }
    }
  },
  "conflictInfo": {
    "localVersion": 123,
    "remoteVersion": 123,
    "differences": [
      "<string>"
    ],
    "remoteConfigData": {
      "prompt": "<string>",
      "messages": [],
      "inputs": [],
      "outputs": [
        {
          "identifier": "<string>",
          "json_schema": {
            "type": "<string>"
          }
        }
      ],
      "model": "<string>",
      "temperature": 123,
      "max_tokens": 123,
      "top_p": 123,
      "frequency_penalty": 123,
      "presence_penalty": 123,
      "seed": 123,
      "top_k": 123,
      "min_p": 123,
      "repetition_penalty": 123,
      "reasoning": "<string>",
      "reasoning_effort": "<string>",
      "thinkingLevel": "<string>",
      "effort": "<string>",
      "verbosity": "<string>",
      "demonstrations": {
        "id": "<string>",
        "name": "<string>",
        "inline": {
          "records": {},
          "columnTypes": [
            {
              "name": "<string>",
              "type": "<string>",
              "id": "<string>"
            }
          ]
        }
      },
      "prompting_technique": {
        "demonstrations": {
          "id": "<string>",
          "name": "<string>",
          "inline": {
            "records": {},
            "columnTypes": [
              {
                "name": "<string>",
                "type": "<string>",
                "id": "<string>"
              }
            ]
          }
        }
      },
      "response_format": {
        "type": "json_schema",
        "json_schema": {
          "name": "<string>",
          "schema": {}
        }
      }
    },
    "remoteConfig": {}
  }
}
{
  "error": "<string>",
  "message": "<string>"
}
{
  "error": "<string>",
  "message": "<string>"
}
{
  "error": "<string>",
  "message": "<string>"
}
{
  "error": "<string>",
  "message": "<string>"
}

Authorizations

X-Auth-Token
string
header
required

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.

Path Parameters

id
string
required

Body

application/json
configData
object
required
parameters
object
localVersion
number
Required range: x >= 0
commitMessage
string

Response

Sync result

action
enum<string>
required
Available options:
created,
updated,
conflict,
up_to_date
prompt
object
conflictInfo
object