Create a webhook endpoint
curl --request POST \
--url https://api.capibo.work/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://ml.example.com/hooks/capibo",
"events": [
"video.accepted",
"export.ready"
]
}
'import requests
url = "https://api.capibo.work/v1/webhooks"
payload = {
"url": "https://ml.example.com/hooks/capibo",
"events": ["video.accepted", "export.ready"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://ml.example.com/hooks/capibo',
events: ['video.accepted', 'export.ready']
})
};
fetch('https://api.capibo.work/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "wh_3kd92m",
"url": "https://ml.example.com/hooks/capibo",
"events": [
"video.accepted"
],
"created_at": "2023-11-07T05:31:56Z",
"secret": "whsec_9f2c4e7a1b..."
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "tasks[0].videos must be at least 1.",
"param": "tasks[0].videos"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key."
}
}Webhooks
Create a webhook endpoint
The response includes the signing secret. It’s only returned once, so store it.
POST
/
webhooks
Create a webhook endpoint
curl --request POST \
--url https://api.capibo.work/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://ml.example.com/hooks/capibo",
"events": [
"video.accepted",
"export.ready"
]
}
'import requests
url = "https://api.capibo.work/v1/webhooks"
payload = {
"url": "https://ml.example.com/hooks/capibo",
"events": ["video.accepted", "export.ready"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://ml.example.com/hooks/capibo',
events: ['video.accepted', 'export.ready']
})
};
fetch('https://api.capibo.work/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "wh_3kd92m",
"url": "https://ml.example.com/hooks/capibo",
"events": [
"video.accepted"
],
"created_at": "2023-11-07T05:31:56Z",
"secret": "whsec_9f2c4e7a1b..."
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "tasks[0].videos must be at least 1.",
"param": "tasks[0].videos"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key."
}
}Authorizations
An API key from Settings → API keys, e.g. cpb_live_… or cpb_test_….
Body
application/json
Response
The created endpoint, with its signing secret.