Python
import requests
url = "https://app.langwatch.ai/api/scenario-events"
payload = {
"type": "<string>",
"timestamp": 123,
"batchRunId": "<string>",
"scenarioId": "<string>",
"scenarioRunId": "<string>",
"metadata": {
"name": "<string>",
"description": "<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({
type: '<string>',
timestamp: 123,
batchRunId: '<string>',
scenarioId: '<string>',
scenarioRunId: '<string>',
metadata: {name: '<string>', description: '<string>'}
})
};
fetch('https://app.langwatch.ai/api/scenario-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/scenario-events \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"type": "<string>",
"timestamp": 123,
"batchRunId": "<string>",
"scenarioId": "<string>",
"scenarioRunId": "<string>",
"metadata": {
"name": "<string>",
"description": "<string>"
}
}
'{
"success": true,
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Scenario Events
Create a new scenario event
Create a new scenario event
POST
/
api
/
scenario-events
Python
import requests
url = "https://app.langwatch.ai/api/scenario-events"
payload = {
"type": "<string>",
"timestamp": 123,
"batchRunId": "<string>",
"scenarioId": "<string>",
"scenarioRunId": "<string>",
"metadata": {
"name": "<string>",
"description": "<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({
type: '<string>',
timestamp: 123,
batchRunId: '<string>',
scenarioId: '<string>',
scenarioRunId: '<string>',
metadata: {name: '<string>', description: '<string>'}
})
};
fetch('https://app.langwatch.ai/api/scenario-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/scenario-events \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"type": "<string>",
"timestamp": 123,
"batchRunId": "<string>",
"scenarioId": "<string>",
"scenarioRunId": "<string>",
"metadata": {
"name": "<string>",
"description": "<string>"
}
}
'{
"success": true,
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}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.
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
Was this page helpful?
⌘I