Subscribe a webhook
curl --request POST \
--url http://localhost:5001/api/v1/webhook/subscribe \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'import requests
url = "http://localhost:5001/api/v1/webhook/subscribe"
payload = { "url": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('http://localhost:5001/api/v1/webhook/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Webhook
Subscribe webhook (self-hosted)
Subscribe an endpoint to supported events from this Presenton instance.
POST
/
api
/
v1
/
webhook
/
subscribe
Subscribe a webhook
curl --request POST \
--url http://localhost:5001/api/v1/webhook/subscribe \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>"
}
'import requests
url = "http://localhost:5001/api/v1/webhook/subscribe"
payload = { "url": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('http://localhost:5001/api/v1/webhook/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Response
Successful Response
Was this page helpful?