rugbyAPI
Platform / Add a webhook
Documentation/Platform/Add a webhook

Add a webhook

Live

Register 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.

POSThttps://api.rugbyapi.com/v1/webhooks

Parameters

NameWhat it doesExample
urlhttps, optionalWhere to send events.https://example.com/rugby-hook
eventslist, optionalWhich 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

FieldMeaning
urlYour https address, on a public host
eventsWhich to send: match.clock, match.period, match.event, match.event_removed, match.finished. Leave out for all
secretSigns every post; check X-RugbyAPI-Signature against it
post body{ id, event, sent_at, data } where data holds the match ID and what changed
retriesAnything but a 2xx is tried again after 1, 5 and 30 minutes, 2 and 6 hours

Errors you can get

StatusCodeWhen
400key_in_addressThe key was put in the address. Send it in a header (see Authentication).
401missing_keyNo Authorization: Bearer header, or the key was rotated (invalid_key, revoked_key).
403plan_requiredYour plan is below Live.
422bad_parameterA parameter is malformed, or unknown (unknown_parameter names the ones this endpoint takes).
422too_manyThe account already has five webhooks. Delete one first.
429daily_limitToday's lookups are used. Resets at 00:00 UTC.

Every error has the same shape. All error codes