Endpoints
Every webhook takes three addresses, allPOST:
Copy the URL from the channel’s Integrations: Copy URL, Copy Slack URL or Copy GitHub URL. It is shown
in full only when the webhook is created or its URL is rotated.
Mantle JSON
POST https://api.mantle.chat/api/hooks/{webhookId}/{token}, with content-type: application/json.
Body
All three fields are strings.
The body can be up to 64 KB. Fields Mantle doesn’t know are ignored.
Answer
200, when the post went through or the request repeated an idempotency_key:
Errors
Every error answers{ "ok": false, "error": "…", "message": "…" }.
Retry only
429, 500 and 503, with the same idempotency_key. A wrong URL and a deleted webhook answer the same
404.
Slack format
POST https://api.mantle.chat/api/hooks/{webhookId}/{token}/slack, with Slack’s incoming webhook body as JSON, or as a
form with the JSON in a payload field (application/x-www-form-urlencoded).
- Read:
text,blocksandattachments. When there are blocks, they’re the post, andtextis only Slack’s notification text. - Ignored:
username,icon_url,icon_emojiandchannel. The webhook keeps its own name, icon and channel. - Body: up to 64 KB.
The Slack URL takes no
thread_key or idempotency_key.
GitHub events
POST https://api.mantle.chat/api/hooks/{webhookId}/{token}/github, as GitHub sends a repository’s or an organization’s
webhook events, as JSON or as a form.
- Events that post:
push,pull_request,pull_request_review,issues,issue_comment,releaseandworkflow_run, pluspingwhen the webhook is added. See Use it with GitHub for which actions of each post. - Threads: a pull request’s events, reviews and comments share a thread, and so do an issue’s.
- Body: up to 1 MB.
Answer
- An event that posts answers as Mantle JSON does.
- An event that doesn’t post answers
200 { "ok": true, "posted": false }, after its URL is checked, so GitHub’s delivery log shows it as delivered. - Errors answer as Mantle JSON’s do. A body that isn’t a GitHub event, or a request without
X-GitHub-Event, answers400 invalid_payload, and a body over 1 MB answers413 payload_too_large.