Python
import requests
url = "https://app.langwatch.ai/api/prompts/{id}/versions/{versionId}/restore"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(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": [],
"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": {
"json_schema": {
"name": "<string>",
"schema": {}
}
}
}Prompts
Restore a prompt to a previous version
Restore a prompt to a previous version. Creates a new version with the same config data as the specified version.
POST
/
api
/
prompts
/
{id}
/
versions
/
{versionId}
/
restore
Python
import requests
url = "https://app.langwatch.ai/api/prompts/{id}/versions/{versionId}/restore"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(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": [],
"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": {
"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.
Response
Success
Available options:
ORGANIZATION, PROJECT Show child attributes
Show child attributes
Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Minimum string length:
1Show 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?
⌘I