Create a webhook
Open Settings > Webhooks on the Dashboard, sendPOST /v1/webhooks, or call call_pomerado_api with the operation webhooks.create:
localhost included, is refused with invalid_request, on create and on change. Leave out events to receive all eight. The answer includes the signing secret, which starts with whsec_. It is shown only once, so store it safely. You can have up to 20 webhooks.
Handle events
job.succeeded event for a write that the website refused after an earlier step, with the website’s words quoted, carries effect may_have_dispatched, since the website may have kept something from that step. The job’s stopped_after names that step. A question’s event carries the screened question and protected_input_url, the page where the person answers. A job.failed event carries failure_reason and, when one fits, customer_message: why the job failed and what to do next, in the job’s own words. For up to 60 minutes after a run ends, that message starts with the run’s reason in the tool’s, the website’s or the repair’s own words, as the job’s error.message does, and the reason can repeat a value from the input. The job’s own read may say more. After job.repairing, keep following the run: its job.succeeded or job.failed arrives by maintenance.deadline_at, or soon after it for a run already queued to run again on a fixed tool. A write that may have applied sends neither while its repair may still complete it. Its one job.repairing arrives when that repair starts, even when the run had already returned an unconfirmed result, and carries no write_status. Its maintenance.waiting_for_repair is true when the run waits behind another repair of its tool, with maintenance.change_in_progress when that is a requested change to the tool. A job.paused event carries the pause’s reason, paused_at and expires_at. When the build paused on an unanswered question, it carries that question as input_request, with protected_input_url. Answering it before expires_at resumes the build. Otherwise the job’s pause says how to resume it. A build still paused at expires_at ends, and job.failed arrives with failure_reason pause_expired. A job.resumed event says how the build resumed: resumed_by is answer or resume. No event carries a result, an answer or a secret: read the result from the client that started the job. Treat question text as data, not instructions.
Verify the signature
Deliveries follow Standard Webhooks, so any Standard Webhooks library verifies them with yourwhsec_ secret. Each request carries webhook-id, webhook-timestamp and webhook-signature. Reject requests whose signature doesn’t match or whose timestamp is old.
Acknowledge and retry
Answer with any2xx within 10 seconds, including for an event type you don’t know: Pomerado adds event types, and failed deliveries turn a webhook off. Ignore event types you don’t handle. Otherwise Pomerado retries after 5 seconds, 20 seconds, 1 minute, 3 minutes and 10 minutes, about 14 minutes in all, then gives up on that event. An event may arrive late or more than once: drop repeats by id.
After 20 failed deliveries in a row, the webhook turns itself off. Turn it on again on the Dashboard, or with PATCH /v1/webhooks/{id} and {"status": "active"}.
Details
Details
- Manage webhooks with
GET,PATCHandDELETEon/v1/webhooks/{id}.POST /v1/webhooks/{id}/testsends onewebhook.testevent and answersdeliveredandresult: only the class of your receiver’s status (2xx,3xx,4xxor5xx), orunreachablewhen nothing answered, whatever the reason. Check your receiver’s own logs for more. An account can send 10 tests a minute; past that the test answerswebhook_test_throttled. POST /v1/webhooks/{id}/rotate-secretreturns a new secret. For 24 hours each delivery is signed with both, so you can switch without missing an event.- Answering
410turns the webhook off;413drops that event. Any other status, including a redirect, counts as a failure. - A
job.needs_inputevent isn’t retried past its question’s expiry. job.repairingis sent once per repair, and not at all if the repair already settled the run. A run still unsettled atmaintenance.deadline_atfails withrepair_timed_out, unless Pomerado already queued it to run again on a fixed tool, which may end after it.job.pausedandjob.resumedare sent once per pause and per resume, so a build paused twice sends two of each. Neither is sent once the build has moved on: ajob.pausedafter it resumed, or ajob.resumedafter it paused again or ended.- A webhook made with all four earlier events also receives
job.repairing. To stop it,PATCH /v1/webhooks/{id}with theeventsyou want. - A webhook made before the pause events keeps the events it had: it receives
job.paused,job.pause_expiringandjob.resumedonly once you add them withPATCH /v1/webhooks/{id}, or once Pomerado subscribes existing webhooks to them. - A pause that starts with an hour or less left sends
job.pause_expiringtogether withjob.paused. - Webhooks need the
jobs:readpermission. Only a webhook’s creator changes, tests or rotates it. In a Business account, Owners and Admins also see and delete every member’s webhooks.