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.
Sync/upsert a prompt with local content
Sync/upsert a prompt with local content
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
Body (application/json)
This sends a live request to app.langwatch.ai.
Request and response examples
request.py
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/prompts/<id>/sync"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = { "configData": {},}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/prompts/<id>/sync";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ "configData": {} }),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/prompts/<id>/sync' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"configData":{}}'Call the LangWatch API from this project.Request: POST https://app.langwatch.ai/api/v1/prompts/<id>/syncReference: https://langwatch.ai/docs/api-reference/prompts/action-sync.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{ "configData": {}}```Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Sync result
application/json · Generated from schema
{ "action": "created", "prompt": { "id": "string", "handle": "string", "scope": "PROJECT", "name": "string", "updatedAt": "2026-01-01T00:00:00Z", "projectId": "string", "organizationId": "string", "versionId": "string", "authorId": "string", "version": 0, "createdAt": "2026-01-01T00:00:00Z", "commitMessage": "string", "prompt": "string", "messages": [], "inputs": [], "outputs": [ { "identifier": "string", "type": "str", "json_schema": { "type": "string" } } ], "model": "string", "temperature": 0, "maxTokens": 0, "demonstrations": { "id": "string", "name": "string", "inline": { "records": {}, "columnTypes": [ { "id": null, "name": null, "type": null } ] } }, "promptingTechnique": { "type": "few_shot", "demonstrations": { "id": "string", "name": "string", "inline": { "records": {}, "columnTypes": [ null ] } } }, "responseFormat": { "type": "json_schema", "json_schema": { "name": "string", "schema": {} } }, "tags": [], "parameters": {} }, "conflictInfo": { "localVersion": 0, "remoteVersion": 0, "differences": [ "string" ], "remoteConfigData": { "prompt": "string", "messages": [], "inputs": [], "outputs": [ { "identifier": "string", "type": "str", "json_schema": { "type": null } } ], "model": "string", "temperature": 0, "max_tokens": 0, "top_p": 0, "frequency_penalty": 0, "presence_penalty": 0, "seed": 0, "top_k": 0, "min_p": 0, "repetition_penalty": 0, "reasoning": "string", "reasoning_effort": "string", "thinkingLevel": "string", "effort": "string", "verbosity": "string", "demonstrations": { "id": "string", "name": "string", "inline": { "records": {}, "columnTypes": [ null ] } }, "prompting_technique": { "type": "few_shot", "demonstrations": { "id": "string", "name": "string", "inline": { "records": null, "columnTypes": null } } }, "response_format": { "type": "json_schema", "json_schema": { "name": null, "schema": null } } }, "remoteParameters": {} }}Bad Request
application/json · Generated from schema
{ "error": "string", "message": "string"}Unauthorized
application/json · Generated from schema
{ "error": "string", "message": "string"}Unprocessable Entity
application/json · Generated from schema
{ "error": "string", "message": "string"}Internal Server Error
application/json · Generated from schema
{ "error": "string", "message": "string"}Path parameters
idstringrequiredRequest body
application/json · Required
configDataobjectrequiredparametersobjectlocalVersionnumberMinimum 0
commitMessagestringResponses
200Sync result
application/json
actionstringrequiredOne of
"created""updated""conflict""up_to_date"promptobjectconflictInfoobject400Bad Request
application/json
errorstringrequiredmessagestring401Unauthorized
application/json
errorstringrequiredmessagestring422Unprocessable Entity
application/json
errorstringrequiredmessagestring500Internal Server Error
application/json
errorstringrequiredmessagestring