Plans, usage and webhook endpoints
Your quota, the plans, and the endpoints that register and manage webhooks.
Odds are one consensus line across the sportsbooks we track: information only, not betting advice.
GET /v1/plans
The only endpoint that answers without a credential. Returns every plan, Free first, with its monthly request quota, per-minute limit, key limit and a checkout_url; the free-plan terms (100 requests a month, no card, never expires) and the URL that mints its key; the MCP endpoint with both of its auth doors; and the documentation links. Static per deploy and cached an hour — poll it never, read it once.
curl "https://api.ufcalendar.com/v1/plans" from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.plans() import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.plans(); Response: data, 5 fields
| Field | Type | Description |
|---|---|---|
currency | string | |
plans | Plan[] | |
free_plan | object | |
mcp | object | |
links | object |
GET /v1/usage
Current-month usage for the calling key: tier, requests used/limit, rpm limit, and the reset as both a Unix timestamp (reset) and ISO-8601 (reset_at); month (YYYYMM) and period (YYYY-MM) are the same month in two spellings. On the free plan tier is free (100 requests a month, metered per account). On an owner-granted trial, trial_ends_at is when the trial ends (null otherwise) — plan around it, not reset_at.
curl "https://api.ufcalendar.com/v1/usage" \
-H "Authorization: Bearer $UFCALENDAR_API_KEY" from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.usage() import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.usage(); Response: data, 9 fields
| Field | Type | Description |
|---|---|---|
tier | Tier | Plan tier. |
month | string | YYYYMM (legacy; see period). |
requests_used | integer | |
requests_limit | integer | |
rpm_limit | integer | |
reset | integer | Unix seconds of the next monthly reset (legacy; see reset_at). |
period | string | YYYY-MM. |
reset_at | string | |
trial_ends_at | string | null | Owner-granted trials only: when the trial ends and the account falls back to the free plan — usually well before reset_at. Null on the free plan and on a paid plan. |
POST /v1/webhook-endpoints
Pro+. Deliveries stop while the account is below Pro (a cancelled plan falls to the free plan); an endpoint keeps the event list it was created with, so to add a newer kind such as roster.changed, delete it and register it again. Body: {"url": "https://...", "events": ["event.announced", "fight.result", "card.changed", "event.completed", "odds.moved", "roster.changed"]}. Subscribe to event.announced and you do not need to poll /v1/events to discover new cards — it fires once, within a minute of a card first landing in our data, and carries the same event object the list endpoint returns. fight.result fires once per bout within a minute of the result, as revision 1, and again as the next revision (corrected: true, with the previous result) whenever the winner, method, round, time or status is corrected in the 72 h after it — upsert on fight_id and keep the highest revision. odds.moved fires when the UFCalendar consensus line on an upcoming bout moves at least 5 implied-probability points on corner a, or the favourite flips, measured against the last line we delivered for that bout (its opening line before the first delivery), so a slow drift arrives once, not per refresh: data is {fight_id, event, fighter_a, fighter_b, odds: {consensus, opening, movement, updated_at}, previous, delta_points_a, direction, favourite_flipped, moved_at}. Information only, not betting advice. roster.changed fires once per confirmed roster move of a promotion that publishes its roster (UFC): a signing, a departure (no longer listed on the roster), a retirement or a return, as published by the promotion; data is the /v1/rosters/{org}/moves row ({id, fighter, org, kind, from_status, to_status, observed_at, previous_checked_at, backfilled}). A move whose athlete reaches the API roster only later (a signing before the debut booking) is delivered when they do, within 30 days, with its original window; moves reconstructed from archives are never delivered. The response contains the signing secret ONCE. Every delivery body is {"id", "type", "data", "sent_at"} (WebhookDelivery schema) — id is stable across retries, so deduplicate on it. Deliveries carry X-UFCalendar-Signature: t=<unix>,v1=<hmac> where the HMAC-SHA256 input is "<t>.<rawBody>". Verify the timestamp too: reject anything where |now - t| exceeds 300 seconds, otherwise a captured delivery can be replayed at you forever with a valid HMAC. Delivery is at-least-once — expect a retry roughly every 60s until your endpoint returns 2xx. Endpoints auto-disable after 20 consecutive failures, and you may hold at most 3 active endpoints (409 endpoint_limit). Latency: results are dispatched within ~1 minute of the result being recorded. event.announced only fires for cards that have not started yet, and fight.result / event.completed only for cards that started in the last 7 days, so archive backfills never reach you as new-card or new-result noise. card.changed is filtered the same way: a change whose before and after read identically (a venue row re-minted for the same arena, a source dropping a sub-time it never knew) is never delivered, and when a source flip-flops a value we deliver the move and its undo once, not the twentieth repeat. Deliveries are free — they never count against your monthly request quota, only the calls you make to manage endpoints do.
curl -X POST "https://api.ufcalendar.com/v1/webhook-endpoints" \
-H "Authorization: Bearer $UFCALENDAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/ufcalendar","events":["fight.result","card.changed"]}' from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.create_webhook_endpoint("https://example.com/ufcalendar", ["fight.result", "card.changed"]) import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.createWebhookEndpoint("https://example.com/ufcalendar", ["fight.result", "card.changed"]); Response: data, 4 fields
| Field | Type | Description |
|---|---|---|
id | integer | |
url | string | |
events | WebhookKind[] | |
secret | string | whsec_… — shown ONCE. HMAC-SHA256 key for X-UFCalendar-Signature. |
GET /v1/webhook-endpoints
Pro and above. Counts as one request against your quota; the deliveries themselves do not.
curl "https://api.ufcalendar.com/v1/webhook-endpoints" \
-H "Authorization: Bearer $UFCALENDAR_API_KEY" from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.webhook_endpoints() import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.webhookEndpoints(); Response: data items, 6 fields
| Field | Type | Description |
|---|---|---|
id | integer | |
url | string | |
events | WebhookKind[] | |
active | boolean | |
failure_count | integer | Consecutive failures; 20 auto-disables the endpoint. |
created_at | string |
POST /v1/webhook-endpoints/{id}/rotate-secret
Pro and above. Issues a fresh whsec_ secret for the endpoint and returns it ONCE, keeping the endpoint id and its delivery history. The previous secret stops verifying the moment this returns, so deploy the new one to your receiver first (or accept both during the cutover). Use this instead of delete-and-recreate when a secret leaks.
| Parameter | In | Type | Description |
|---|---|---|---|
id required | path | integer |
curl -X POST "https://api.ufcalendar.com/v1/webhook-endpoints/12/rotate-secret" \
-H "Authorization: Bearer $UFCALENDAR_API_KEY" from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.rotate_webhook_secret(12) import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.rotateWebhookSecret(12); Response: data, 4 fields
| Field | Type | Description |
|---|---|---|
id | integer | |
url | string | |
events | WebhookKind[] | |
secret | string | whsec_… — shown ONCE. HMAC-SHA256 key for X-UFCalendar-Signature. |
DELETE /v1/webhook-endpoints/{id}
Pro and above. Idempotent: deleting an id that is not yours (or no longer exists) still answers 200.
| Parameter | In | Type | Description |
|---|---|---|---|
id required | path | integer |
curl -X DELETE "https://api.ufcalendar.com/v1/webhook-endpoints/12" \
-H "Authorization: Bearer $UFCALENDAR_API_KEY" from ufcalendar import FightAPI
api = FightAPI() # or FightAPI("ufcalendar_...")
data = api.delete_webhook_endpoint(12) import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
const data = await api.deleteWebhookEndpoint(12); Response: data, 1 fields
| Field | Type | Description |
|---|---|---|
ok | boolean |