import requests
url = "https://app.langwatch.ai/api/prompts/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"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": {}
}
}
}Get prompt
Get a specific prompt by slug, with optional shorthand syntax for tags and versions. Pass a bare slug like “pizza-prompt” to get the latest version, “pizza-prompt:production” to resolve a tagged version, or “pizza-prompt:2” to fetch version 2. Alternatively, use the tag or version query parameters with a bare slug.
import requests
url = "https://app.langwatch.ai/api/prompts/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"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": {}
}
}
}Authorizations
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
Prompt slug or shorthand. Supports three formats: (1) bare slug — "pizza-prompt" returns the latest version; (2) slug:tag — "pizza-prompt:production" returns the version pointed to by that tag; (3) slug:version — "pizza-prompt:2" returns that specific version number. "slug:latest" is equivalent to the bare slug. Cannot be combined with the tag or version query parameters.
Query Parameters
Specific version number to retrieve. Cannot be used when the id path already contains a shorthand suffix.
x >= 0Fetch the version pointed to by this tag (e.g., "production", "staging"). Cannot be used when the id path already contains a shorthand suffix.
Response
Success
ORGANIZATION, PROJECT Show child attributes
Show child attributes
Show child attributes
Show child attributes
1Show child attributes
Show child attributes
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?