Skip to main content
Add callback_url when you create a media task. When the task finishes, OmniaKey sends one signed POST with the finished task to that URL. Polling GET /v1/media/tasks/{id} keeps working, so you can use both.

Add a callback URL

Put callback_url at the top level of the create body:
The URL must:
  • start with https://. Any port works.
  • point to a public host. Private and loopback addresses, localhost and names such as *.local or *.internal are refused with 400 invalid_request before anything is charged.
  • be at most 2,048 characters, without a username or password.
callback_url is part of the idempotency check: the same Idempotency-Key with a different callback_url returns 409 idempotency_key_reused.

Delivery state

For a task created with callback_url, the create response and GET /v1/media/tasks/{id} include a callback object:
The task’s details in the media library show the same state. A delivered or failed event can be sent again there with Send again, and it keeps its webhook-id.

The event

data is the object GET /v1/media/tasks/{id} returns, so a succeeded task carries assets[] with freshly signed URLs. timestamp is when the event was created and stays the same on every attempt. OmniaKey sends the event after the task’s billing is final, so a failed or canceled task has normally been refunded by then. Most events leave within a few seconds of the task finishing.

Verify the signature

Events follow the Standard Webhooks spec, so its libraries verify them. Find your signing secret (whsec_...) under Task callbacks in Settings. Each account has one secret, and an API key can’t read it.

Without a library

  1. Base64-decode the part of the secret after whsec_. That is the HMAC key.
  2. Build {webhook-id}.{webhook-timestamp}.{raw body}.
  3. Compute its HMAC-SHA256 with that key.
  4. Compare the result, in constant time, with each v1,<base64> entry in webhook-signature. Entries are separated by spaces.
  5. Reject a webhook-timestamp more than 5 minutes away from your clock.
Verify the raw request body before you parse it. Parsing the JSON and serializing it again changes the bytes, and the signature no longer matches.
After you rotate the secret in Settings, every event carries two signatures for 24 hours, one from the new secret and one from the old. Switch your server to the new secret within that time and no event is lost.

Retries

After the first attempt, retries follow at 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours: 8 attempts over about 27.6 hours. After the last one the callback is failed.
  • Answer quickly and do slow work afterwards: an answer after 15 seconds counts as a failure.
  • Redirects aren’t followed, so use the final URL.
  • Delivery is at least once. Every attempt of an event carries the same webhook-id, so skip an event whose webhook-id you’ve already handled.
  • At most two attempts run at once per receiving host.
  • When you retry a failed task from the dashboard, its new run sends one more event with a new webhook-id.

Test your endpoint

Under Task callbacks in Settings, enter your URL and choose Send test. OmniaKey sends a signed webhook.test event right away and shows your endpoint’s status code and response time. No media task is needed, so you can check your receiver before your first task.

Network

  • Requests come straight from OmniaKey’s servers, not through a proxy. OmniaKey doesn’t publish a fixed list of source IP addresses, so check the signature instead of allowlisting IPs.
  • Your host name is resolved again before every attempt. An attempt to a name that resolves to a private or loopback address is refused, and the event is not tried again.