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

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

payload = {
    "handle": "<string>",
    "model": "<string>",
    "temperature": 123,
    "maxTokens": 123,
    "commitMessage": "<string>",
    "authorId": "<string>",
    "prompt": "<string>",
    "messages": [
        {
            "role": "user",
            "content": "<string>"
        }
    ],
    "inputs": [
        {
            "identifier": "<string>",
            "type": "str"
        }
    ],
    "outputs": [
        {
            "identifier": "<string>",
            "type": "str",
            "json_schema": { "type": "<string>" }
        }
    ],
    "schemaVersion": "1.0",
    "scope": "ORGANIZATION"
}
headers = {
    "X-Auth-Token": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.json())
{
  "id": "<string>",
  "handle": "<string>",
  "scope": "ORGANIZATION",
  "name": "<string>",
  "updatedAt": "<string>",
  "projectId": "<string>",
  "organizationId": "<string>",
  "versionId": "<string>",
  "authorId": "<string>",
  "version": 123,
  "createdAt": "<string>",
  "commitMessage": "<string>",
  "prompt": "<string>",
  "messages": [],
  "inputs": [
    {
      "identifier": "<string>",
      "type": "str"
    }
  ],
  "outputs": [
    {
      "identifier": "<string>",
      "type": "str",
      "json_schema": {
        "type": "<string>"
      }
    }
  ],
  "model": "<string>",
  "temperature": 123,
  "maxTokens": 123,
  "demonstrations": {
    "id": "<string>",
    "name": "<string>",
    "inline": {
      "records": {},
      "columnTypes": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    }
  },
  "promptingTechnique": {
    "type": "few_shot",
    "demonstrations": {
      "id": "<string>",
      "name": "<string>",
      "inline": {
        "records": {},
        "columnTypes": [
          {
            "name": "<string>",
            "type": "<string>"
          }
        ]
      }
    }
  },
  "responseFormat": {
    "type": "json_schema",
    "json_schema": {
      "name": "<string>",
      "schema": {}
    }
  }
}

Authorizations

X-Auth-Token
string
header
required

Path Parameters

id
string
required

Body

application/json
handle
string
model
string
temperature
number
maxTokens
number
commitMessage
string
authorId
string
prompt
string
messages
object[]
inputs
object[]
outputs
object[]
schemaVersion
enum<string>
Available options:
1.0
scope
enum<string>
Available options:
ORGANIZATION,
PROJECT

Response

Success

id
string
required
handle
string | null
required
scope
enum<string>
required
Available options:
ORGANIZATION,
PROJECT
name
string
required
updatedAt
string
required
projectId
string
required
organizationId
string
required
versionId
string
required
version
number
required
createdAt
string
required
prompt
string
required
messages
object[]
required
inputs
object[]
required
Minimum length: 1
outputs
object[]
required
Minimum length: 1
model
string
required
Minimum length: 1
authorId
string | null
commitMessage
string | null
temperature
number
maxTokens
number
demonstrations
object
promptingTechnique
object
responseFormat
object
⌘I