Create a webhook endpoint
curl --request POST \
--url https://api.melso.ai/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://partner.example.com/webhooks/melso",
"description": "Production listener",
"event_types": [
"tax_return.calculated",
"tax_return.filed",
"invoice.registered"
]
}
'import requests
url = "https://api.melso.ai/v1/webhook-endpoints"
payload = {
"url": "https://partner.example.com/webhooks/melso",
"description": "Production listener",
"event_types": ["tax_return.calculated", "tax_return.filed", "invoice.registered"]
}
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://partner.example.com/webhooks/melso',
description: 'Production listener',
event_types: ['tax_return.calculated', 'tax_return.filed', 'invoice.registered']
})
};
fetch('https://api.melso.ai/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"endpoint": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"event_types": [
"company.onboarding_completed"
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>"
},
"signing_secret": "<string>"
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}Webhook endpoints
Create a webhook endpoint
Registers an HTTPS URL for the event types you choose.
POST
/
webhook-endpoints
Create a webhook endpoint
curl --request POST \
--url https://api.melso.ai/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://partner.example.com/webhooks/melso",
"description": "Production listener",
"event_types": [
"tax_return.calculated",
"tax_return.filed",
"invoice.registered"
]
}
'import requests
url = "https://api.melso.ai/v1/webhook-endpoints"
payload = {
"url": "https://partner.example.com/webhooks/melso",
"description": "Production listener",
"event_types": ["tax_return.calculated", "tax_return.filed", "invoice.registered"]
}
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://partner.example.com/webhooks/melso',
description: 'Production listener',
event_types: ['tax_return.calculated', 'tax_return.filed', 'invoice.registered']
})
};
fetch('https://api.melso.ai/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"endpoint": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"event_types": [
"company.onboarding_completed"
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>"
},
"signing_secret": "<string>"
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}Preview. A contract we are building with design partners. It is not callable yet, and fields can still change. See Availability.
signing_secret; it is shown
once. See Webhooks for signature verification.Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Headers
A unique key, such as a UUID, that makes a retried create safe. Reusing a key with a different body is refused.
Maximum string length:
255Body
application/json
An absolute https URL that resolves to public addresses.
Maximum string length:
2048Minimum array length:
1Available options:
company.onboarding_completed, mandate.signed, mandate.activated, mandate.rejected, mandate.revoked, invoice.issued, invoice.registered, invoice.registration_failed, invoice.sent, invoice.paid, document.processed, bank_movement.reconciliation_proposed, tax_obligation.due_soon, tax_return.calculated, tax_return.approved, tax_return.filed, case.updated, case.information_requested, case.approval_requested, case.completed, notification.received, certificate.issued, payroll_run.validated, affiliation.accepted, affiliation.rejected, contribution_settlement.available, contribution_settlement.discrepancy, contribution_settlement.paid, employment_notification.registered, employment_notification.rejected Maximum string length:
500