Add a webhook
LiveRegister an https address and we post each live event to it the moment it happens: the clock, periods, every score and card, and full time. Every post is signed.
Parameters
| Name | What it does | Example |
|---|---|---|
urlhttps, optional | Where to send events. | https://example.com/rugby-hook |
eventslist, optional | Which events to send. | match.clock,match.period,match.event,match.event_removed,match.finished |
Any other parameter is refused with a 422 naming the ones this endpoint takes, so a typo never silently returns everything.
What each plan returns
Free key
Not included. Returns 403 with the upgrade link.
Archive
Not included. Returns 403 with the upgrade link.
Live
Included.
Response fields
| Field | Meaning |
|---|---|
url | Your https address, on a public host |
events | Which to send: match.clock, match.period, match.event, match.event_removed, match.finished. Leave out for all |
secret | Signs every post; check X-RugbyAPI-Signature against it |
post body | { id, event, sent_at, data } where data holds the match ID and what changed |
retries | Anything but a 2xx is tried again after 1, 5 and 30 minutes, 2 and 6 hours |
Errors you can get
| Status | Code | When |
|---|---|---|
400 | key_in_address | The key was put in the address. Send it in a header (see Authentication). |
401 | missing_key | No Authorization: Bearer header, or the key was rotated (invalid_key, revoked_key). |
403 | plan_required | Your plan is below Live. |
422 | bad_parameter | A parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes). |
422 | too_many | The account already has five webhooks. Delete one first. |
429 | daily_limit | Today's lookups are used. Resets at 00:00 UTC. |
Every error has the same shape. All error codes