Register a webhook endpoint
curl --request POST \
--url https://api.relettr.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"description": "<string>"
}
'import requests
url = "https://api.relettr.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [],
"description": "<string>"
}
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: '<string>', events: [], description: '<string>'})
};
fetch('https://api.relettr.com/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "we_4mN8pQ2rS3tU4vW5xY6zA7",
"object": "webhook_endpoint",
"livemode": true,
"url": "<string>",
"events": [
"chapter.ready"
],
"enabled": true,
"description": "<string>",
"api_version": "v1",
"created_at": "2023-11-07T05:31:56Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Webhooks
Register a webhook endpoint
Registers an HTTPS URL (port 443 or 8443) to receive events. The
response contains the signing secret (whsec_…). It is shown only
once. Live and test endpoints are separate: an endpoint created with
a test key receives only test events.
POST
/
webhook_endpoints
Register a webhook endpoint
curl --request POST \
--url https://api.relettr.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"description": "<string>"
}
'import requests
url = "https://api.relettr.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [],
"description": "<string>"
}
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: '<string>', events: [], description: '<string>'})
};
fetch('https://api.relettr.com/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "we_4mN8pQ2rS3tU4vW5xY6zA7",
"object": "webhook_endpoint",
"livemode": true,
"url": "<string>",
"events": [
"chapter.ready"
],
"enabled": true,
"description": "<string>",
"api_version": "v1",
"created_at": "2023-11-07T05:31:56Z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Authorizations
Headers
Body
application/json
Event types to send. Defaults to every type except
chapter.step_completed, which is opt-in.
Available options:
chapter.ready, chapter.queued, chapter.processing, chapter.step_completed, chapter.needs_review, chapter.succeeded, chapter.failed, chapter.canceled, chapter.expired, chapter.deleted, balance.low, api_key.spend_limit_reached, ping Response
The endpoint, including its secret.