Webhooks
Pass a webhook_url when you submit a task and we send one signed POST to that address when the task ends as completed, failed or cancelled. You can still poll the task as well.
Set the signing secret first
Your organisation has one signing secret. An admin makes it in Settings › Developers, in the Webhook signing secret section, with Create. Rotate replaces it and Clear removes it. The secret is shown once when you create or rotate it, so save it then.
Until a secret exists, a submit with a webhook_url is refused with a 400. If you clear it later, deliveries not yet sent are dropped, because they cannot be signed.
Your endpoint
- It must be reachable from the public internet.
- It must listen on port 80, 443, 8080 or 8443.
If a delivery fails we try again: immediately, then after 5 minutes, 15 minutes, 1 hour, 4 hours, 12 hours, 24 hours and 48 hours. That is 8 attempts, and then we give up.
Check the signature
Each delivery carries three headers.
X-DataAtScale-Signature:sha256=followed by a hex HMAC.X-DataAtScale-Timestamp: Unix seconds at delivery time.Content-Type: application/json.
The signature is the HMAC-SHA256 of the timestamp, a dot, and the raw body, made with your secret. Compare in constant time and reject deliveries older than about 5 minutes.
import hmac, hashlib, time
def verify(secret: str, body: bytes, sig_header: str,
ts_header: str, max_age_s: int = 300) -> bool:
if not (sig_header and ts_header and ts_header.isdigit()):
return False
if abs(int(time.time()) - int(ts_header)) > max_age_s:
return False
expected = "sha256=" + hmac.new(
secret.encode(),
f"{ts_header}.".encode() + body,
hashlib.sha256,
).hexdigest()
return hmac.compare_digest(expected, sig_header)
In the dashboard, the Webhook URL box in the "Name it" step of Find creators is called when the search finishes. The address there must start with https://, and it needs the signing secret too.
Repeat a request safely
If a POST times out you cannot tell whether it went through. Send an Idempotency-Key header with each POST, such as a UUID you make for that request, and use the same key when you send it again. Within 24 hours you get the first response back, marked Idempotent-Replayed: true, and not a second task or a second charge.
- A key belongs to your organisation and one request. The same key with a different body is refused as
idempotency_key_mismatch. - While the first request is still running, the same key answers 409
idempotency_in_progress. - Only successful answers and invalid-input errors are kept. Other refusals, such as not enough credits or a daily limit, are not kept, so after you fix the cause the same key runs the request.
- Answers that hold a secret or a link shown once, such as API keys, invites and checkout links, are not kept. The same key then answers 409
idempotency_already_completed. - Sign-in and account routes under
/v1/auth/ignore the header.
Rate limits
Each route has its own limit over a fixed 10-minute window. Signed-in routes count per organisation, and public routes count per IP address.
| Kind of request | Limit per 10 minutes |
|---|---|
| Free checks: estimates, input checks, match counts | 300 |
| Reads, such as GET requests for tasks and results | 20,000 |
| Writes, such as submits and cancels | 2,000 |
Each response carries three headers:
RateLimit-Limit: the route's limit for the window.RateLimit-Remaining: what is left in this window.RateLimit-Reset: seconds until the window ends.
When you pass the limit you get a 429 with code set to rate_limited, a Retry-After header, and resets_in_s in the body. Wait that many seconds. This is separate from your daily limits, which reset at midnight UTC and are in the article on daily limits.