import requests
url = "https://app.langwatch.ai/api/webhooks/v1/endpoints"
payload = {
"url": "<string>",
"enabled_events": ["<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({url: '<string>', enabled_events: ['<string>']})
};
fetch('https://app.langwatch.ai/api/webhooks/v1/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/webhooks/v1/endpoints \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"url": "<string>",
"enabled_events": [
"<string>"
]
}
'{
"data": {
"id": "<string>",
"url": "<string>",
"enabled_events": [
"<string>"
],
"disabled_reason": "<string>",
"disabled_at": "<string>",
"failing_since": "<string>",
"last_success_at": "<string>",
"last_failure_at": "<string>",
"max_batch_size": 123,
"max_batch_delay_ms": 123,
"max_in_flight": 123,
"created_at": "<string>",
"updated_at": "<string>",
"secret": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Create a webhook endpoint
Create a webhook endpoint. The signing secret is returned ONCE in this response and never again; roll it to get a new one. Send Idempotency-Key to make a retry safe: a replay returns the original response including its secret, which is the only way to recover a secret whose response was lost in transit.
import requests
url = "https://app.langwatch.ai/api/webhooks/v1/endpoints"
payload = {
"url": "<string>",
"enabled_events": ["<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({url: '<string>', enabled_events: ['<string>']})
};
fetch('https://app.langwatch.ai/api/webhooks/v1/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/webhooks/v1/endpoints \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"url": "<string>",
"enabled_events": [
"<string>"
]
}
'{
"data": {
"id": "<string>",
"url": "<string>",
"enabled_events": [
"<string>"
],
"disabled_reason": "<string>",
"disabled_at": "<string>",
"failing_since": "<string>",
"last_success_at": "<string>",
"last_failure_at": "<string>",
"max_batch_size": 123,
"max_batch_delay_ms": 123,
"max_in_flight": 123,
"created_at": "<string>",
"updated_at": "<string>",
"secret": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<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.
Headers
A caller-chosen key, 8 to 255 characters, that makes this create safe to retry. The first request to use a key runs normally and its response is stored for 24 hours. A later request with the same key and the same body is not executed again: it returns the stored response, marked with X-Idempotent-Replay: true. The same key with a different body is refused 409 idempotency_error, as is a retry sent while the original is still running. Only successful responses are stored, so a create that failed can simply be retried with the same key.
8 - 255Body
Response
The endpoint, with the signing secret this body alone carries
Show child attributes
Show child attributes
Was this page helpful?