# List usage events Source: https://developer.hooper.gg/api-reference/billing/list-usage-events /openapi.json get /v1/usage One usage event per billable job: `held` at submit, then `settled` (credits drawn for the measured length) or `voided` (nothing charged). # Retrieve the balance Source: https://developer.hooper.gg/api-reference/billing/retrieve-the-balance /openapi.json get /v1/balance # Retrieve the public price list Source: https://developer.hooper.gg/api-reference/billing/retrieve-the-public-price-list /openapi.json get /v1/pricing The current list price and billing terms. **No API key needed.** A customer's own rate can differ: it's `rate_cents_per_hour` on `GET /v1/balance`. # List events Source: https://developer.hooper.gg/api-reference/events/list-events /openapi.json get /v1/events Every event emitted for your organization, newest first. Use it to catch up after missed webhook deliveries. # Retrieve an event Source: https://developer.hooper.gg/api-reference/events/retrieve-an-event /openapi.json get /v1/events/{id} # Sessionfailed Source: https://developer.hooper.gg/api-reference/sessionfailed /openapi.json webhook session.failed Sent when processing fails. `data.object.error.code` says why; the credit hold is voided, nothing is charged. # Sessionprocessed Source: https://developer.hooper.gg/api-reference/sessionprocessed /openapi.json webhook session.processed Sent when a session finishes successfully. `data.object` is the full session, highlights included. Verify `Hooper-Signature` before trusting the body. # List a session's highlights Source: https://developer.hooper.gg/api-reference/sessions/list-a-sessions-highlights /openapi.json get /v1/sessions/{id}/highlights Every clip the pipeline cut for the session. The first 100 are embedded on the session object; use this endpoint to page the rest. # List a session's players Source: https://developer.hooper.gg/api-reference/sessions/list-a-sessions-players /openapi.json get /v1/sessions/{id}/players The roster with per-player box scores, highest scorer first. # List a session's shots Source: https://developer.hooper.gg/api-reference/sessions/list-a-sessions-shots /openapi.json get /v1/sessions/{id}/shots # List sessions Source: https://developer.hooper.gg/api-reference/sessions/list-sessions /openapi.json get /v1/sessions Newest first. Each item is the full session object, highlights included. # Retrieve a session Source: https://developer.hooper.gg/api-reference/sessions/retrieve-a-session /openapi.json get /v1/sessions/{id} # Submit a video Source: https://developer.hooper.gg/api-reference/sessions/submit-a-video /openapi.json post /v1/sessions Places a credit hold, creates the session and queues it for processing. Responds immediately with the session in `queued` state; you are notified through a webhook (`session.processed` / `session.failed`) when it finishes, or you can poll `GET /v1/sessions/{id}`. Send an `Idempotency-Key` header to make retries safe: the same key with the same body returns the original response for 24 hours. # Create an upload Source: https://developer.hooper.gg/api-reference/uploads/create-an-upload /openapi.json post /v1/uploads Returns a resumable upload URL. `PUT` the file bytes directly to `upload_url` (GCS resumable protocol), then submit a session with `source: { type: "upload", upload_id }`. Videos must be MP4 or MOV, at most 10 GB and 1080p — the same envelope a mobile recording produces. Images (PNG, JPEG or WebP, at most 5 MB) are for `branding`: pass the upload id as `branding.cover.upload_id` or `branding.logo.upload_id`. An image upload is not used up by a submit, so one upload can brand any number of sessions. If your images are already at a public URL, skip the upload and send `branding.cover.url` / `branding.logo.url` instead. # Create a webhook endpoint Source: https://developer.hooper.gg/api-reference/webhooks/create-a-webhook-endpoint /openapi.json post /v1/webhook_endpoints The `secret` (`hws_prod_…`) is returned **once**, in this response only. Use it to verify the `Hooper-Signature` header on deliveries. # Delete a webhook endpoint Source: https://developer.hooper.gg/api-reference/webhooks/delete-a-webhook-endpoint /openapi.json delete /v1/webhook_endpoints/{id} # List webhook endpoints Source: https://developer.hooper.gg/api-reference/webhooks/list-webhook-endpoints /openapi.json get /v1/webhook_endpoints # Retrieve a webhook endpoint Source: https://developer.hooper.gg/api-reference/webhooks/retrieve-a-webhook-endpoint /openapi.json get /v1/webhook_endpoints/{id} # Send a test event Source: https://developer.hooper.gg/api-reference/webhooks/send-a-test-event /openapi.json post /v1/webhook_endpoints/{id}/test Synchronously POSTs a synthetic `session.processed` event (`id: "evt_test"`) to the endpoint and reports the response, so you can verify signature handling before the first real job. # Authentication Source: https://developer.hooper.gg/authentication API keys, environments, and rate limits. Every request needs an API key in the `Authorization` header: ```bash theme={null} curl https://zeus.hooper.gg/v1/balance \ -H "Authorization: Bearer hk_prod_8KzQ…" ``` Keys are issued by Hooper for your organization. The plaintext is shown once when it's created; Hooper stores only a hash and cannot recover it. Keep it server-side — never ship it in a browser or mobile app. ## Key format | Prefix | Meaning | | - | - | | `hk_prod_…` | API key for production (`api.hooper.gg`) | | `hk_stg_…` | API key for staging | | `hws_prod_…` / `hws_stg_…` | Webhook signing secret (see [Webhooks](/webhooks)) | The middle segment names the environment that issued the credential. A production server refuses a staging key with a specific error so the mismatch is obvious: ```json theme={null} { "error": { "type": "authentication_error", "code": "wrong_environment", "message": "This key was minted for the 'stg' environment; this server accepts 'prod' keys" } } ``` ## Error codes | HTTP | `code` | Meaning | | - | - | - | | 401 | `missing_api_key` | No `Authorization: Bearer` header | | 401 | `invalid_api_key` | Malformed, unknown, or revoked key | | 401 | `wrong_environment` | Key belongs to the other environment | | 429 | `rate_limit_exceeded` | More than 60 requests/minute on this key — honour `Retry-After` | ## Rotating a key Ask Hooper to mint a new key, switch your integration to it, then have the old one revoked. Revocation is immediate; a revoked key returns `invalid_api_key`. # Billing Source: https://developer.hooper.gg/billing Prepaid credits, metered per second of video. Your organization holds a **prepaid credit balance** in cents. Processing is metered at a per-hour rate (see `GET /v1/balance` → `rate_cents_per_hour`), billed per second of video actually processed and rounded up to the cent. ## How a job is charged You never tell Hooper how long a video is. Hooper measures it, and you're charged for that measured length. **1. Hold at submit** `POST /v1/sessions` places a **hold**: an estimate of the cost, from the file size for uploads and 2 hours for URL and Veo sources (for [several videos](/sessions#sources), the uploaded parts' combined size plus 2 hours if any part is a link), and never more than your available balance. The response headers tell you what was held and what remains: ``` X-Hooper-Cost-Cents: 1080 X-Hooper-Balance-Cents: 48920 ``` You get `402` only when your available balance can't cover any of the video: ```json theme={null} { "error": { "type": "insufficient_credits", "code": "insufficient_credits", "message": "Not enough credits to process this video", "needed_cents": 1080, "available_cents": 0 } } ``` If you own credit but all of it is reserved for videos in progress, the message says so and the body adds `held_cents`; it frees up as those videos are measured and processed. **2. Measured before processing** Once Hooper has downloaded the video, and before any processing, the hold becomes the **real cost of its measured length**. If your credit can't cover it, the session fails with `error.code = "insufficient_credits"` and nothing is charged; an uploaded file is kept, so you can add credit and resubmit the same `upload_id`. **3. Settle on success** When the job finishes, the hold is **settled for the measured length**, and credits are drawn from the oldest-expiring balance first. `cost_cents` on the session is the final figure. **4. Void on failure** If processing fails for any reason — including a video over the [size/resolution limit](/sessions#limits) or a job that never reports back — the hold is **voided** and nothing is charged. ## Pricing The list price, the free trial and the purchase limits are on the [pricing page](https://www.hooper.gg/api/pricing). Code and AI agents can read the same numbers with no API key: ```bash theme={null} curl https://api.hooper.gg/v1/pricing ``` Your own rate can differ from the list price. `rate_cents_per_hour` on `GET /v1/balance` is the rate you're charged. ## Free trial Every account starts with free credit. The [pricing page](https://www.hooper.gg/api/pricing) shows the current amount and how much video it covers. A longer video fails before processing with `insufficient_credits`, and nothing is charged. Credit is drawn oldest-expiring first, so the trial is used before anything you buy later. When it runs out, add credit (see [Topping up](#topping-up)). ## Pricing codes If Hooper gave you a pricing code, enter it from **Usage** in the Hub (or in the **Buy credits** dialog) to move your organization to that code's rate. A code only ever lowers your rate, each code works once per organization, and videos already in progress keep the rate they started at. `rate_cents_per_hour` on `GET /v1/balance` shows the rate you're on. ## Balance ```bash theme={null} curl https://api.hooper.gg/v1/balance -H "Authorization: Bearer $HOOPER_API_KEY" ``` ```json theme={null} { "object": "balance", "currency": "usd", "available_cents": 49248, "held_cents": 752, "credit_cents": 50000, "rate_cents_per_hour": 500, "soonest_expiry": 1787702400 } ``` * `available_cents` = `credit_cents` − `held_cents`. This is what a new submit is checked against. * `held_cents` is credit reserved for videos in progress. It returns to `available_cents` as each video is measured and settled. * Credits expire a fixed time after purchase (`credit_expiry_months` on `GET /v1/pricing`); `soonest_expiry` is the next date the balance shrinks on its own. ## Usage `GET /v1/usage` lists one usage event per billable job: ```json theme={null} { "id": "ue_91", "object": "usage_event", "session": "sess_18234", "status": "settled", "held_seconds": 7200, "quantity_seconds": 5412, "rate_cents_per_hour": 500, "cost_cents": 752, "created": 1756220000, "settled_at": 1756224000, "voided_at": null } ``` `status` is `held`, `settled` or `voided`. Filter by `status`, `api_key`, and `created[gte]` / `created[lte]`. ## Topping up * Buy credits by card from **Usage** in the Hub. The [pricing page](https://www.hooper.gg/api/pricing) has the minimum and maximum. * Invoiced customers keep getting credit added by Hooper. * Organizations with a saved card can enable **auto-recharge**. Hooper charges a fixed amount off-session when a settle drops the balance below your threshold (at most once an hour), and before it would refuse a submit or fail a video for lack of credit, as long as the amount covers it. Contact Hooper to set it up. # Errors Source: https://developer.hooper.gg/errors One envelope, machine-readable codes, and what to do about each. Every error response has the same body: ```json theme={null} { "error": { "type": "invalid_request_error", "code": "parameter_invalid", "message": "Input should be a valid string", "param": "source.url" } } ``` | Field | Meaning | | - | - | | `type` | The broad class — branch on this first. | | `code` | A stable machine-readable reason. | | `message` | Human-readable. May change; don't parse it. | | `param` | The request field at fault, when there is one (dotted path; list items by zero-based index, e.g. `source.parts.1.upload_id`). | Every response also carries a `Request-Id` header (`req_…`). Include it when you contact support. ## Types | `type` | HTTP | Meaning | | - | - | - | | `invalid_request_error` | 400, 404, 409 | The request is malformed, refers to something that doesn't exist, or conflicts with current state. Fix the request. | | `authentication_error` | 401 | Bad or missing key — see [Authentication](/authentication). | | `insufficient_credits` | 402 | Your available balance can't cover any of the video. Body includes `needed_cents`, `available_cents`, and `held_cents` when credit is reserved for videos in progress. | | `rate_limit_error` | 429 | Slow down; honour `Retry-After`. | | `api_error` | 5xx | Hooper's fault. Safe to retry with the same `Idempotency-Key`. | ## Codes you should handle | `code` | HTTP | Where | What to do | | - | - | - | - | | `parameter_invalid` | 400 | any | Check `param`. | | `video_too_large` | 400 | submit | The file is over 10 GB. Nothing was held; an uploaded blob was deleted. With `param: source.parts`, the uploaded [parts](/sessions#sources) only pass 10 GB together, and none was deleted. | | `upload_incomplete` | 409 | submit (`upload` source or part, `branding` images) | The bytes haven't landed yet, or the object is empty — finish the `PUT`, then resubmit. For `branding`, the upload must have been created with an image `content_type`. | | `image_invalid` | 400 | submit (`branding.*.upload_id`) | The uploaded image isn't a PNG, JPEG or WebP. Nothing was held. | | `branding_save_failed` | 503 | submit (`branding`) | Hooper couldn't save your branding images. Nothing was held; retry with the same `Idempotency-Key`. | | `idempotency_key_reused` | 400 | submit | Same `Idempotency-Key`, different body. Use a new key. | | `idempotency_key_in_progress` | 409 | submit | A request with this `Idempotency-Key` is still being processed. Retry shortly; you'll get its response. | | `insufficient_credits` | 402 | submit | Top up, then resubmit. | | `resource_missing` | 404 | any `{id}` | No such object for your organization. | | `missing_api_key` / `invalid_api_key` / `wrong_environment` | 401 | any | See [Authentication](/authentication). | | `rate_limit_exceeded` | 429 | any | Back off for `Retry-After` seconds. | ## Session failures A session that fails does so asynchronously: `status` becomes `failed`, `error` is set, you receive a `session.failed` event, and **the hold is voided**. For a branding image, `error.param` also names the image; for one of [several videos](/sessions#sources), it names the part (`source.parts.1`), with the same `error.code` a single source would get. `error.code` values: | `error.code` | Meaning | | - | - | | `no_hoops` | No hoop could be detected. Check the camera angle. With the default `camera_setup: "stationary"`, Hooper only looks in the upper middle of the frame, so if the hoop is elsewhere, resubmit with `"panning"` ([Recording options](/sessions#recording-options)). | | `no_court` | The court could not be detected. | | `no_shots` | The video contained no detectable shots. | | `video_too_large` | Over 1080p (or over 10 GB for a URL/Veo source). Uploaded bytes were deleted. | | `source_invalid` / `source_unavailable` | The URL/Veo source was rejected or couldn't be downloaded. | | `source_too_slow` | The host sent the video slower than 1 MB/s. Nothing was charged; upload the file with `/v1/uploads` instead. | | `insufficient_credits` | The measured video costs more than your credit (after any auto-recharge). Nothing was charged; uploaded bytes are kept so you can add credit and resubmit. | | `image_unavailable` | A `branding` image URL didn't answer `200` within 15 seconds, redirected more than 3 times, or pointed at a private address. `error.param` names the image (`branding.cover` or `branding.logo`). | | `image_invalid` | A `branding` image isn't a valid PNG, JPEG or WebP, or is corrupt. `error.param` names the image. | | `image_too_large` | A `branding` image URL returned more than 5 MB. `error.param` names the image. | | `video_composition_failed` | The video couldn't be prepared for processing. | | `timeout` | Processing never reported back; swept after 24h. | | `unknown` | Anything else. Quote the session id to support. | For the three `image_*` codes, fix that image and resubmit. `error.message` says what was wrong. See [Branding errors](/sessions#branding-errors). # Introduction Source: https://developer.hooper.gg/introduction Send Hooper a basketball game; get back highlights, every shot, and a box score. The Hooper API turns raw game footage into structured basketball data. You submit a video — an upload, a public URL, or a Veo link — and Hooper's vision pipeline returns: > [card] Highlights > > A clip for every shot, in up to seven renditions plus horizontal cuts and previews. > [card] Shots > > Timing, outcome, points, court location, who scored / assisted / rebounded. > [card] Players > > The roster with a per-player box score and team totals. ## How it works **1. Submit a video** `POST /v1/sessions` with a `source`. A credit hold is placed and the job is queued. You get a `session` back immediately in `queued` state. **2. Get notified** When processing finishes, Hooper POSTs a signed `session.processed` (or `session.failed`) event to your webhook endpoint. The event carries the full session — highlights included — so there is nothing to fetch. **3. Use the data** Every session, highlight, shot and player has a stable prefixed id (`sess_`, `hl_`, `shot_`, `plr_`) and cross-links to the others. > [!TIP] > > Prefer to ask in plain language? Connect Claude, Cursor or another AI assistant to the [Hooper MCP server](/mcp-server) and it calls the API for you. ## Conventions * **Base URL** `https://zeus.hooper.gg`, all paths under `/v1`. * **Auth** `Authorization: Bearer hk_prod_…` — see [Authentication](/authentication). * **Ids** are opaque prefixed strings. Every object carries `object` and `created` (Unix seconds). * **Lists** — top-level or embedded — are always `{ "object": "list", "data": [...], "has_more": bool, "total_count": n }`. * **Money** is integer cents. **Time** is Unix seconds. * **Errors** are `{ "error": { "type", "code", "message", "param" } }` — see [Errors](/errors). * Every response carries a `Request-Id` header. Quote it when you contact support. ## Environments Keys are tagged with the environment that minted them: `hk_prod_…` works against production, `hk_stg_…` against staging. Sending a key to the wrong environment returns `401` with `code: "wrong_environment"` so the mistake is obvious. # MCP server Source: https://developer.hooper.gg/mcp-server Use the Hooper API from Claude, Cursor and other AI assistants. Hooper runs a [Model Context Protocol](https://modelcontextprotocol.io) server, so an AI assistant can submit games and read back sessions, shots and highlights for you. Ask things like *"analyze this Veo match"* or *"show me every made three from last night"* and the assistant calls the API. The server is a thin client of `/v1`. It holds no credentials: every tool call is made with **your** API key, so billing, rate limits and organization scoping are exactly what the API enforces. ## What it can do Once connected, you talk to the assistant in plain language and it picks the right [tools](#tools): > [card] Analyze a game > > *"Analyze this game:* `https://app.veo.co/matches/…`*"* > > Checks your balance, submits the video, and tells you the session id and what it will cost. > [card] Check on processing > > *"Is my last game done yet?"* > > Looks up the session's status and gives you a link to watch it in the Hooper Hub. Processing takes minutes to an hour depending on length. > [card] Shot analysis > > *"Break down every three-pointer in that game. Who made them and from where?"* > > Pages through every shot with time, result, court location, scorer, assister and rebounder. > [card] Name your players > > *"Analyze this game. We're Acme: #23 Ana Silva, #7 Cleo Dias."* > > Sends your roster with the game, so shots and highlights come back credited to your players. See [Rosters](#rosters). > [card] Highlights > > *"Give me links to all the made shots from the second half."* > > Returns clips with playable video and preview image URLs. > [card] Analyze a file on your computer > > *"Analyze* `~/Videos/game.mp4`*"* > > In assistants that can run commands (Claude Code, Cursor), uploads the file and submits it. See [Local files](#local-files). > [card] History and credits > > *"How many games have I processed this month, and how many credits do I have left?"* > > Lists your sessions and reads your available and held credits. Only `analyze_video` spends credits. ## Connect You need an API key (`hk_prod_…`, see [Authentication](/authentication)). The server is at: ``` https://mcp.hooper.gg/mcp ``` It speaks Streamable HTTP; send your key in the `Authorization` header. > [tab] Claude Code > > ```bash theme={null} > claude mcp add --transport http hooper https://mcp.hooper.gg/mcp \ > --header "Authorization: Bearer hk_prod_…" > ``` > > Run `/mcp` inside Claude Code to confirm `hooper` is connected. > [tab] Cursor > > Add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project): > > ```json theme={null} > { > "mcpServers": { > "hooper": { > "url": "https://mcp.hooper.gg/mcp", > "headers": { "Authorization": "Bearer hk_prod_…" } > } > } > } > ``` > [tab] Claude Desktop > > Claude Desktop reaches remote servers with a pasted key through the [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) bridge (requires Node.js). Add to `claude_desktop_config.json` and restart the app: > > ```json theme={null} > { > "mcpServers": { > "hooper": { > "command": "npx", > "args": ["-y", "mcp-remote", "https://mcp.hooper.gg/mcp", "--header", "Authorization:${HOOPER_AUTH}"], > "env": { "HOOPER_AUTH": "Bearer hk_prod_…" } > } > } > } > ``` > > The key goes in `env` rather than `args` because some platforms mangle spaces inside arguments. > [!WARNING] > > These config files hold your key in plain text, and the key can spend credits. Use a dedicated key for assistants so you can revoke it on its own. > [!NOTE] > > **claude.ai** custom connectors (Claude on the web and mobile) require OAuth sign-in rather than a pasted key, which isn't supported yet. Use one of the clients above. ## Tools | Tool | Calls | What it returns | | - | - | - | | `create_upload` | `POST /v1/uploads` | An `upload_id` and a ready-to-run `curl` command that sends a local file. Free. | | `analyze_video` | `POST /v1/sessions` | A new session in `queued` state, from a link, an `upload_id`, or [several videos](/sessions#sources) as `parts` (links and `upload_id`s, in play order), with optional [rosters](#rosters). **Costs credits.** | | `get_session` | `GET /v1/sessions/{id}` | Status, shot and highlight counts, and a `hub_url` to watch it in the Hooper Hub | | `list_sessions` | `GET /v1/sessions` | Your sessions, newest first, cursor-paged | | `list_shots` | `GET /v1/sessions/{id}/shots` | Every shot: time, result, points, court position, scorer / assister / rebounder | | `list_highlights` | `GET /v1/sessions/{id}/highlights` | Clips with playable video and preview URLs | | `list_players` | `GET /v1/sessions/{id}/players` | Who each `plr_` id is: jersey, name, team and your metadata | | `get_balance` | `GET /v1/balance` | Available and held credits, and the hourly rate | Every tool except `create_upload` and `analyze_video` is read-only. Session ids can be given as `sess_18234` or just `18234`. ### Differences from the REST API The tools are shaped for a model's context window, so a few things differ from calling `/v1` directly: * **Sessions are summarized.** `get_session` and `list_sessions` return `shot_count` and `highlight_count` instead of the embedded lists. Page through them with `list_shots` and `list_highlights`. Each session also carries a `hub_url` for watching it in the Hooper Hub. * **No box scores.** Sessions leave out `totals` and players leave out `stats`. Players are told apart by jersey number, and without numbers by appearance, so per-player stats can be misleading. `list_players` is there to say who the `plr_` ids on shots and highlights are. For box scores, call the [API](/sessions) directly. * **Shots carry the court position only.** `list_shots` returns `court_location` (the shot chart point) instead of the `location` object, and leaves out `excitement_score`. * **Highlights carry two renditions.** `list_highlights` returns the default and horizontal cuts plus the preview image, not every resolution. * **Uploads need a shell.** Video never passes through the assistant or the MCP server. `create_upload` hands back a `curl` command and the assistant runs it on your machine, so local files work only in assistants that can run commands. See [Local files](#local-files). * **No webhooks.** The assistant polls with `get_session`. Processing takes minutes to an hour depending on length. ## Rosters Hooper tells players apart by the jersey numbers it reads. Give the assistant each team's numbers, and names if you like, and it passes them to `analyze_video` as [`rosters`](/sessions#rosters). The detected players then come back with your names and your own ids in `metadata`, so *"show me Ana's made threes"* works and follows her from game to game. Without a roster, the `plr_` ids on shots and highlights are Hooper's best guess within that one game. They're unnamed, a `null` means Hooper couldn't tell who it was, and one person is sometimes split into two players. Rosters need jersey numbers to be read, so leave `jerseys` on `auto` or set it to `enabled`. ## Local files The video never goes through the MCP server or the assistant itself. The assistant asks for an upload, then sends the file with a command on your machine: **1. Reserve an upload** The assistant measures the file (for example `wc -c < game.mp4`) and calls `create_upload` with its exact size and path. This is free. **2. Send the file** `create_upload` returns a command like the one below, and the assistant runs it. It streams the file straight to Hooper's storage, so a long game can take a while on a slow connection. ```bash theme={null} curl -sS --fail -X PUT -T '/Users/you/Videos/game.mp4' -H 'Content-Type: video/mp4' 'https://storage.googleapis.com/…' ``` **3. Submit** The assistant calls `analyze_video` with the `upload_id`. Submitting before the file has finished uploading returns `409 upload_incomplete`. This works in assistants that can run commands, such as Claude Code and Cursor's agent. Claude Desktop can't run commands, so there you give it a public link instead, or [upload with the API](/sessions#sources) yourself. The upload URL accepts the file for 7 days. ## Credits and retries `analyze_video` is billed like `POST /v1/sessions` (see [Billing](/billing)). The server derives the [`Idempotency-Key`](/sessions#idempotency) from the tool's arguments, so if an assistant retries a call after a timeout it gets the original session back instead of paying twice. The flip side: submitting the **same URL with the same options within 24 hours** returns the earlier session rather than starting a new run. To deliberately reprocess, change an option or add a `metadata` entry. Tool calls count toward your key's [rate limit](/authentication#error-codes) of 60 requests per minute. ## Errors API errors reach the assistant as a readable tool error with the code, message and `Request-Id`, for example: ``` Hooper API error 402 (insufficient_credits): Not enough credits to process this video [needed_cents: 752] [available_cents: 100] [Request-Id: req_…] ``` A missing or malformed `Authorization` header fails every tool call with `Missing Hooper API key`. Check the header is set in your client's config. See [Errors](/errors) for every code. # Quickstart Source: https://developer.hooper.gg/quickstart From zero to your first highlights in three requests. You need an API key (`hk_prod_…`) from your Hooper contact and a public HTTPS URL that can receive webhooks. **1. Register a webhook endpoint** ```bash theme={null} curl https://zeus.hooper.gg/v1/webhook_endpoints \ -H "Authorization: Bearer $HOOPER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/hooks/hooper" }' ``` The response includes `"secret": "hws_prod_…"` **exactly once** — store it. You'll use it to verify deliveries. **2. Submit a video** The simplest source is a public Veo match page or an HTTPS link to an MP4: ```bash theme={null} curl https://zeus.hooper.gg/v1/sessions \ -H "Authorization: Bearer $HOOPER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: match-abc-123" \ -d '{ "source": { "url": "https://app.veo.co/matches/20260826-acme-vs-north/" }, "metadata": { "external_match_id": "abc-123" }, "options": { "session_type": "5v5" } }' ``` ```json theme={null} { "id": "sess_18234", "object": "session", "status": "queued", "metadata": { "external_match_id": "abc-123" }, "highlights": { "object": "list", "data": [], "has_more": false, "total_count": 0, "url": "/v1/sessions/sess_18234/highlights" }, "...": "..." } ``` The `X-Hooper-Cost-Cents` header tells you what was held. To upload your own file instead, see [Sessions → Sources](/sessions#sources). **3. Receive the result** Minutes to an hour later (depending on length), your endpoint receives: ```json theme={null} { "id": "evt_91", "object": "event", "type": "session.processed", "created": 1756224000, "data": { "object": { "id": "sess_18234", "status": "processed", "duration_seconds": 5412, "cost_cents": 752, "highlights": { "object": "list", "total_count": 42, "data": [ { "id": "hl_9f2c", "player": "plr_5", "video": { "1080p": "https://…" } } ] }, "shots": { "object": "list", "total_count": 118, "data": [ "..." ] }, "players": { "object": "list", "total_count": 10, "data": [ { "id": "plr_5", "name": "Ana", "stats": { "points": 22 } } ] }, "totals": { "points": 88, "...": "..." } } } } ``` Verify the `Hooper-Signature` header before trusting it — see [Webhooks](/webhooks). Prefer polling? `GET /v1/sessions/sess_18234` returns the same object. > [!TIP] > > Use `metadata` to carry your own ids. It is echoed on the session and inside every event, so you never need a mapping table. # Sessions Source: https://developer.hooper.gg/sessions Submitting video, what comes back, and the limits. A **session** is one submitted game and everything the pipeline produced for it. The same object shape is returned by every endpoint and inside every webhook event, so you parse it once. ## Sources `POST /v1/sessions` takes a `source`. `type` is optional — Hooper derives it from the URL, and a Veo link is always routed to the Veo path even if you say `url`. > [tab] Upload your own file > > Three steps: create an upload, `PUT` the bytes to the returned resumable URL, then submit. `size` must be the file's exact length in bytes, because `upload_url` accepts exactly that many. `expires_in_seconds` is how long `upload_url` accepts the `PUT`; the stored file doesn't expire. > > ```bash theme={null} > # 1. create the upload > curl https://zeus.hooper.gg/v1/uploads \ > -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ > -d '{ "content_type": "video/mp4", "size": 2147483648 }' > # → { "id": "up_3f9a…", "upload_url": "https://storage.googleapis.com/…", "expires_in_seconds": 604800 } > > # 2. PUT the file (GCS resumable protocol — a single PUT works for most files) > curl -X PUT "$UPLOAD_URL" -H "Content-Type: video/mp4" --data-binary @game.mp4 > > # 3. submit > curl https://zeus.hooper.gg/v1/sessions \ > -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ > -d '{ "source": { "type": "upload", "upload_id": "up_3f9a…" } }' > ``` > > Submitting before the bytes have landed returns `409 upload_incomplete`. > [tab] Public URL > > Any public `https://` link to an MP4 or MOV. Hooper downloads it server-side. > > ```json theme={null} > { "source": { "type": "url", "url": "https://cdn.example.com/games/2026-08-26.mp4" } } > ``` > > The host must be publicly resolvable (private and link-local addresses are rejected). > [tab] Veo > > A public Veo match page or CDN link. No download on your side. > > ```json theme={null} > { "source": { "type": "veo", "url": "https://app.veo.co/matches/20260826-acme-vs-north/" } } > ``` > [tab] Several videos > > One game recorded as several videos (halves, quarters, a camera that restarted): send them as `parts`, in play order, and Hooper joins them into one session. **Each part is a `source`**: the same fields, rules and errors as the other tabs, so one list can mix uploads, URLs and Veo links. > > ```json theme={null} > { > "source": { > "type": "parts", > "parts": [ > { "type": "upload", "upload_id": "up_3f9a…" }, > { "type": "url", "url": "https://cdn.example.com/games/2026-08-26-second-half.mp4" }, > { "type": "veo", "url": "https://app.veo.co/matches/20260826-acme-vs-north/" } > ] > } > } > ``` > > * 2 to 10 parts. For a single video, send a plain `source`. > * A part can't repeat an earlier one, and parts can't contain parts. A part refuses fields it doesn't know. > * Each part is at most 1080p, and all parts together at most 10 GB (see [Limits](#limits)). > * Parts can differ in resolution, frame rate and orientation. Hooper joins them into one 1080p, 30 fps video and letterboxes any part with a different shape. > * Without `options.camera_setup`, a parts session is processed as `panning`, because the camera may have moved between videos. Send `stationary` only if the camera didn't move, with the hoop in the upper middle of every video. > > A part is refused exactly as a single source would be, with `param` naming it: an unfinished upload in the second part is `409 upload_incomplete` with `param: source.parts.1.upload_id`. Refusals only `parts` can get: > > | Error | `param` | When | > | - | - | - | > | `400 parameter_invalid` | `source.parts` | Fewer than 2 or more than 10 parts. | > | `400 parameter_invalid` | `source.parts.N.` | A field a part doesn't know. | > | `400 invalid_request` | `source.parts` | `parts` with `upload_id` or `url`, or `type: "parts"` without `parts`. | > | `400 invalid_request` | `source.type` | `parts` with `type` `upload`, `url` or `veo`. | > | `400 invalid_request` | `source.parts.N` | The part repeats an earlier one. | > | `400 video_too_large` | `source.parts` | Uploaded parts total more than 10 GB. Nothing is held or deleted: each part is fine on its own. | > > If the session fails because of one part, `error.param` names it, for example `{ "code": "source_too_slow", "param": "source.parts.1", … }`. ### Request fields | Field | Notes | | - | - | | `group` | A `grp_…` under your organization. Omit it and the session lands in your organization's own private group. | | `metadata` | Up to 20 string key/values; echoed on the session and in every event. | | `options` | Describes how the video was recorded. See [Recording options](#recording-options). | | `branding` | Your own opening cover and corner logo on the processed video. See [Branding](#branding). | | `rosters` | Each team's players, so the players Hooper detects come back with your names and your own ids. See [Rosters](#rosters). | ### The credit hold Submitting places a hold on your balance: an estimate (from the file size for uploads, 2 hours for URL and Veo sources; for `parts`, the uploaded parts' combined size plus 2 hours if any part is a URL or Veo link), never more than your available balance. Before processing, Hooper measures the video and resizes the hold to its real cost; you're charged for that measured length. The `duration_seconds` on the returned session object is the measured length. It is `null` until the session is `processed`. See [Billing](/billing). ### Recording options Everything under `options` is optional. Values are case-sensitive, and anything outside the listed values is rejected with `400 parameter_invalid`, with `param` naming the field (for example `options.camera_setup`). Four options change how the video is analysed: | Option | Values | Default | Effect | | - | - | - | - | | `camera_setup` | `stationary`, `panning` | `stationary` (`panning` for [several videos](#sources)) | Where Hooper looks for the hoop. `stationary` means the camera stays still with the hoop in the upper middle of the frame. Hooper looks **only** there: roughly the middle third horizontally, and the top half vertically. `panning` means the camera follows the play, and Hooper searches the whole frame. | | `jerseys` | `auto`, `enabled`, `disabled` | `auto` | Whether Hooper reads jersey numbers to tell players apart. See [Jerseys](#jerseys). | | `session_mode` | `game`, `practice`, `shootaround` | `game` | `game`: two teams, split using the team names below. `practice`: the same analysis without the team split. `shootaround`: a shooting workout with no teams and no free-throw detection. | | `session_type` | `solo`, `1v1`, `2v2`, `3v3`, `4v4`, `5v5` | `5v5` | The format. In `game` and `practice` it sets the default `num_players`, and `3v3`, `4v4` and `5v5` turn on free-throw detection. | > [!WARNING] > > If your camera is fixed but the hoop is **not** in the upper middle of the frame (for example a wide gym camera), send `camera_setup: "panning"`. Otherwise Hooper finds no hoop and the session fails with `no_hoops`. The rest are saved with the session but do not change the results the API returns: | Option | Values | Default | Meaning | | - | - | - | - | | `court_type` | `high_school`, `ncaa_women`, `ncaa_men`, `fiba`, `wnba`, `nba` | `ncaa_men` | The court markings, which set the 3-point line distance. A shot's `is_three_point` comes from the video analysis. | | `point_system` | `1`, `2`, `3` | `1` | `1` = 2s and 3s, `2` = 1s and 2s, `3` = every basket is worth 1. Shot `points` and `totals` in the API always use standard scoring (2 or 3 per basket, 1 per free throw). | | `recording_setup` | `tripod`, `ground` | `tripod` | `tripod`: a tripod or another raised mount. `ground`: low to the floor, such as a phone propped against a bottle. | | `num_players` | `1`–`10` | from `session_type` | Players on the court. In `game` and `practice` it defaults to what `session_type` implies (`5v5` gives 10), so send it only to override. `shootaround` has no default. | | `model` | `beta`, `flash` | `flash` | **Deprecated.** Every session runs on the `flash` pipeline. `beta` is still accepted so existing requests keep working, but it also runs `flash`. Omit this option. | | `recording_team_name` | any string | `Team 1` | Your team's name. Used only in `game` mode. Echoed as `teams.recording.name`. A [roster](#rosters) can name the team instead; sending both is refused with `400` and `param: options.recording_team_name`. | | `opponent_team_name` | any string | `Team 2` | The opposing team's name. Used only in `game` mode. Echoed as `teams.opponent.name`; the same rule as above applies. | A full request, for a 5v5 game filmed on a fixed tripod with numbered jerseys: ```json theme={null} { "source": { "type": "upload", "upload_id": "up_3f9a1c2b7e5d4a08" }, "metadata": { "external_match_id": "abc-123" }, "options": { "session_type": "5v5", "session_mode": "game", "camera_setup": "stationary", "jerseys": "enabled", "court_type": "nba", "recording_team_name": "Acme Varsity", "opponent_team_name": "North High" } } ``` #### Jerseys `jerseys` decides whether Hooper reads jersey numbers. Reading them is how Hooper tells players apart in an organized game. It is also what fills in `players[].jersey` and lets [`rosters`](#rosters) be matched. | Value | What Hooper does | Use it when | | - | - | - | | `auto` (default) | Looks at five frames from the video and decides whether the players wear numbered team uniforms. If it can't tell, it doesn't read numbers, unless you sent `rosters`. | You don't know in advance. | | `enabled` | Always reads numbers. | Players wear numbered uniforms, as in any league game. Recommended with `rosters`. | | `disabled` | Never reads numbers, and tells players apart by how they look instead. Can't be combined with `rosters`. | Pickup games, or bibs without numbers. | When Hooper reads numbers, it groups each player's actions by number and team: * An action where Hooper couldn't read the number isn't credited to any player. * A number has to be read on at least two actions to become a player. So reading numbers works best when they're legible in the video. `auto` gets this right for most videos, but it can decide that a game has no numbered uniforms when it does. Numbers are then not read, and rosters are not matched. If you know the players wear numbers, send `enabled`. > [!NOTE] > > `has_jerseys` (`true` / `false`) is the older form of this option. It still works, but is deprecated: `true` means `enabled` and `false` means `disabled`. Send one or the other; a request with both is refused with `400` and `param: options`. ### Branding Put your own images on the processed video. Both are optional and work with every source type, including Veo. | Field | Where it appears | Image to send | | - | - | - | | `branding.cover` | Full-frame for the first 5 seconds of `video`. | 16:9, ideally 1920×1080. Other shapes are scaled to fill the frame and center-cropped. | | `branding.logo` | Lower-right corner of the game footage, on `video` and on every highlight. Not shown over the cover. | A PNG with a transparent background, landscape between about 1.6:1 and 3.6:1 (for example 520×220). See [Logo size](#logo-size). | Each image must be a valid PNG, JPEG or WebP of at most 5 MB. Hooper reads the format from the file itself, not from its name or `Content-Type`. #### Sending an image Send each image as a public URL or as an upload, whichever you have. Use one or the other per image, not both. > [tab] Public URL > > Hooper downloads the image when it starts processing the session, before the video. > > ```bash theme={null} > curl https://zeus.hooper.gg/v1/sessions \ > -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ > -d '{ > "source": { "type": "veo", "url": "https://app.veo.co/matches/20260826-acme-vs-north/" }, > "branding": { > "cover": { "url": "https://cdn.example.com/brand/cover.jpg" }, > "logo": { "url": "https://cdn.example.com/brand/logo.png" } > } > }' > ``` > > The URL must be public `https://` and answer `200` within 15 seconds. Up to 3 redirects are followed, and private or link-local addresses are rejected, including through a redirect. Hooper keeps its own copy with the session, so the image only needs to stay at that URL until the session is `processed`. Each new session downloads the URL again, so a changed file applies to the sessions you submit next, not to ones already processed. > > At submit, Hooper only checks the address. If the image itself is unusable, the session fails during processing (see [Branding errors](#branding-errors)). > [tab] Upload > > Upload the image once, then reuse its id. An image upload is not used up by a submit. > > ```bash theme={null} > # 1. create the image upload; size is the file's exact length in bytes > curl https://zeus.hooper.gg/v1/uploads \ > -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ > -d '{ "content_type": "image/png", "size": 48213 }' > # → { "id": "up_7c1e…", "upload_url": "https://storage.googleapis.com/…", "expires_in_seconds": 604800 } > > # 2. PUT the file to upload_url > curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/png" --data-binary @logo.png > > # 3. send its id with every session > curl https://zeus.hooper.gg/v1/sessions \ > -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ > -d '{ > "source": { "type": "veo", "url": "https://app.veo.co/matches/20260826-acme-vs-north/" }, > "branding": { "logo": { "upload_id": "up_7c1e…" } } > }' > ``` > > `expires_in_seconds` only limits how long `upload_url` accepts the `PUT`. The uploaded image doesn't expire, so you can keep using its `upload_id`. #### Logo size A landscape logo between about 1.6:1 and 3.6:1 is drawn at most 260×110 px on the 1920×1080 frame, 48 px from the right edge and 52 px from the bottom. That is enough to cover the wordmark Veo burns into its exports, so on a Veo source your logo replaces Veo's. A squarer or wider logo is enlarged past that box so it still covers the wordmark: a square logo is drawn at 180×180, for example. Any resolution works, since Hooper scales it. To keep it sharp, send it at least as large as it will be drawn. #### What to expect * **The session says what it carries.** Every session object has `"branding": { "cover": true, "logo": true }`, set when you submit. A `processed` session always has every image it lists. * **The cover is part of the video.** `video`, every shot's `start_seconds` / `end_seconds` and the measured `duration_seconds` include its 5 seconds. Those 5 seconds are billed like the rest of the video; branding costs nothing else. * **A branded video is always 1920×1080.** A portrait recording gets black bars at the sides. #### Branding errors Problems Hooper can see at submit are refused at submit, before anything is held. `param` names the field (`branding.logo` is shown; `branding.cover` works the same way): | Error | `param` | Cause | | - | - | - | | `400 invalid_request` | `branding.logo` | Neither or both of `url` and `upload_id` were sent. | | `400 invalid_request` | `branding.logo.url` | The URL isn't public `https://`, or is longer than 2,048 characters. | | `400 image_invalid` | `branding.logo.upload_id` | The upload isn't a PNG, JPEG or WebP. | | `409 upload_incomplete` | `branding.logo.upload_id` | The upload hasn't finished, or wasn't created with an image `content_type`. | | `503 branding_save_failed` | | Hooper couldn't save your images. Retry with the same `Idempotency-Key`. | Anything else fails the session. Hooper never processes a video without the branding you asked for. The session ends in `failed`, the hold is voided (nothing is charged), and you receive `session.failed`. Its `error` names the image and says what to fix: ```json theme={null} "error": { "code": "image_unavailable", "param": "branding.logo", "message": "The logo image could not be downloaded. Its url must be public https and return the image (status 200) within 15 seconds, with at most 3 redirects. Fix it and resubmit; nothing was charged." } ``` | `error.code` | Cause | | - | - | | `image_unavailable` | The URL didn't answer `200` within 15 seconds, redirected more than 3 times, or now points at a private address. | | `image_invalid` | The file isn't a valid PNG, JPEG or WebP, or is corrupt. | | `image_too_large` | The file at the URL is over 5 MB. | URL images are downloaded before the video, so a bad URL fails the session within moments of processing starting. ### Rosters Send each team's players, and the players Hooper detects come back with your names and your own ids. Every `highlight.player` then points at a player you know, so you can follow a player's highlights and stats across games, even when rosters change from game to game. ```json theme={null} "rosters": { "recording": { "name": "Acme Varsity", "metadata": { "team_id": "lg-t-12" }, "players": [ { "jersey": "23", "name": "Ana Silva", "metadata": { "player_id": "lg-4821" } }, { "jersey": "7", "name": "Cleo Dias", "metadata": { "player_id": "lg-0937" } } ] }, "opponent": { "name": "North High", "metadata": { "team_id": "lg-t-07" }, "players": [ { "jersey": "23", "name": "Bea Costa", "metadata": { "player_id": "lg-7710" } } ] } } ``` `recording` is your team and `opponent` the other one, the same two sides as `recording_team_name` and `opponent_team_name`. Send one or both: a practice with one squad only needs `recording`. An empty `rosters` object is refused with `400` and `param: rosters`. Each roster: | Field | Required | Notes | | - | - | - | | `players` | Yes | 1 to 200 players, each with a different number. | | `name` | No | The team's name. The same as sending `recording_team_name` / `opponent_team_name`; sending both for one side is refused with `400` and `param` naming the option. Echoed as `teams..name`. | | `metadata` | No | Up to 20 string key/values, with the same limits as the session's `metadata`. Echoed as `teams..metadata`. Put your own team id here. | Each player: | Field | Required | Notes | | - | - | - | | `jersey` | Yes | The number on the player's jersey: 1 to 3 digits, as a string (`"7"`, `"23"`). Hooper matches players by it. | | `name` | No | Up to 50 characters. Returned as `players[].name`. | | `metadata` | No | Up to 20 string key/values, with the same limits as the session's `metadata`. Returned as `players[].metadata`. Put your own player id here. | Two teammates with the same number are refused with `400` and `param: rosters..players`, because Hooper could never tell them apart. `"7"` and `"07"` count as the same number. The same number on both teams is fine. Rosters are matched by jersey number, so they can't be sent with `jerseys: "disabled"` (or `has_jerseys: false`); that request is refused with `400` and `param: options.jerseys`. #### How players are matched Hooper reads jersey numbers from the video, then matches the players it detected to your rosters: * **One player per number and side.** A detected player is named when its number is on the roster of its side. The video doesn't know which side is yours, so Hooper tries both ways round and keeps the one that names more players. `players[].team_id` then follows your rosters: `1` is `recording`, `2` is `opponent`, and `players[].team_name` is that side's name. * **Numbers have to be read.** Matching uses the numbers Hooper reads, so it depends on [`jerseys`](#jerseys). With the default `auto`, Hooper decides from the video, and if it can't tell, your rosters keep numbers on. Send `enabled` when you know the players wear numbers. * **Matching never fails a session.** A player whose number couldn't be read, or isn't on its side's roster, comes back without a roster name and with `metadata: {}`. #### What comes back ```json theme={null} "teams": { "recording": { "name": "Acme Varsity", "metadata": { "team_id": "lg-t-12" } }, "opponent": { "name": "North High", "metadata": { "team_id": "lg-t-07" } } }, "players": { "object": "list", "total_count": 10, "has_more": false, "data": [ { "id": "plr_5", "object": "player", "name": "Ana Silva", "jersey": "23", "team_id": 1, "team_name": "Acme Varsity", "metadata": { "player_id": "lg-4821" }, "stats": { "points": 22, "…": "…" } } ] } ``` `teams` is on every session. A side you didn't name has Hooper's default name (`Team 1` for `recording`, `Team 2` for `opponent`) and `metadata: {}`. Each player carries its side as `team_id` (`1` = `recording`, `2` = `opponent`) and `team_name`, the same name as in `teams`; both are `null` for a player Hooper couldn't place on a side. `highlight.player` and `shot.players.*` point at the `plr_…` ids in `players`. A `plr_…` id only exists within one session; your `metadata` is what stays the same from game to game. To collect each player's highlights across sessions: ```python theme={null} highlights_by_player = defaultdict(list) # your player_id → highlights for session in sessions: # each from GET /v1/sessions/{id} player_ids = {p["id"]: p["metadata"].get("player_id") for p in session["players"]["data"]} for highlight in session["highlights"]["data"]: # page highlights.url when has_more is true highlights_by_player[player_ids.get(highlight["player"])].append(highlight) ``` Good to know: * Roster players Hooper didn't detect in the video don't appear in `players`. A player is detected once Hooper reads their number on at least two of their actions (see [Jerseys](#jerseys)). * Hooper can't read `00` yet, so a player wearing it stays unnamed. * Now and then the video splits one player into two detected players. Both get the same `name` and `metadata`, so add their stats up by your id. ## Limits The API accepts the same envelope a Hooper mobile recording produces: | | Limit | | - | - | | Size | ≤ 10 GB | | Resolution | ≤ 1080p (1920×1080, either orientation) | | Format | MP4 or MOV, H.264 preferred | Where the size is knowable at submit (an upload's blob size, a URL's `Content-Length`) an oversize video is refused with `400 video_too_large` and nothing is held. Resolution is only known once the video is downloaded and probed; if it exceeds the limit the session ends in `failed` with `error.code = "video_too_large"`, **the credit hold is voided** (nothing is charged) and any uploaded bytes are deleted. A URL or Veo source must download at 1 MB/s or faster. A slower host fails the session with `error.code = "source_too_slow"` and nothing is charged; for those, upload the file with `/v1/uploads` instead. With [several videos](#sources), each part follows these rules on its own, and the parts together must stay within 10 GB. A part over 1080p fails the session with `error.code = "video_too_large"` and `error.param` naming it; if that part is an upload, it is deleted and the other parts stay usable for a resubmit. Parts that only pass 10 GB together while downloading fail the session with `video_too_large` and no `param`, and nothing is deleted. ## Lifecycle ``` queued → processing → processed ↘ failed ``` | `status` | Meaning | | - | - | | `queued` | Accepted; waiting for a worker. | | `processing` | A worker has the video. | | `processed` | Done. `highlights`, `shots`, `players`, `totals` are populated; `cost_cents` is final. | | `failed` | Something went wrong; see `error`. The hold is voided — nothing is charged. | A job that never reports back is swept after 24 hours: the session fails with `error.code = "timeout"`, the hold is voided, and you still receive a `session.failed` event. ## The session object ```json theme={null} { "id": "sess_18234", "object": "session", "created": 1756224000, "status": "processed", "group": "grp_412", "source": { "type": "veo", "upload_id": null, "url": "https://app.veo.co/matches/…", "parts": null }, "metadata": { "external_match_id": "abc-123" }, "branding": { "cover": false, "logo": true }, "teams": { "recording": { "name": "Acme Varsity", "metadata": { "team_id": "lg-t-12" } }, "opponent": { "name": "Team 2", "metadata": {} } }, "run_version": 1, "duration_seconds": 5412, "cost_cents": 752, "highlights": { "object": "list", "total_count": 42, "has_more": false, "url": "/v1/sessions/sess_18234/highlights", "data": [ { "id": "hl_9f2c", "object": "highlight", "shot": "shot_a1b2", "player": "plr_5", "length_seconds": 8.5, "is_lowlight": false, "video": { "default": "…", "horizontal": "…", "1080p": "…", "720p": "…", "480p": "…", "360p": "…", "240p": "…", "144p": "…" }, "preview": { "default": "…", "horizontal": "…" } } ] }, "shots": { "object": "list", "total_count": 118, "has_more": true, "url": "/v1/sessions/sess_18234/shots", "data": [ { "id": "shot_a1b2", "object": "shot", "index": 7, "start_seconds": 412.0, "end_seconds": 420.5, "made": true, "points": 3, "is_three_point": true, "is_free_throw": false, "location": { "shot_image_normed": [0.42, 0.61] }, "excitement_score": 0.87, "players": { "scorer": "plr_5", "assister": "plr_3", "rebounder": null }, "highlight": "hl_9f2c" } ] }, "players": { "object": "list", "total_count": 10, "has_more": false, "url": "/v1/sessions/sess_18234/players", "data": [ { "id": "plr_5", "object": "player", "name": "Ana", "jersey": "23", "team_id": 1, "team_name": "Acme Varsity", "metadata": { "player_id": "lg-4821" }, "stats": { "points": 22, "fg_2pt_att": 9, "fg_2pt_make": 5, "fg_3pt_att": 6, "fg_3pt_make": 4, "ft_att": 0, "ft_make": 0, "assist": 3, "rebound": 7 } } ] }, "totals": { "points": 88, "fg_2pt_att": 41, "…": "…" }, "video": { "url": "…", "preview_url": "…", "1080p": "…", "720p": "…", "360p": "…", "width": 1920, "height": 1080, "fps": 30 }, "artifacts": { "actions": "…jsonl", "balls": "…jsonl", "hoops": "…jsonl", "clusters": "…jsonl" }, "error": null } ``` Things worth knowing: * **`source` echoes what you submitted.** `upload_id` is the upload's id for an upload (otherwise `null`), and `url` is the link you sent (for an upload, Hooper's storage path). For [several videos](#sources), `type` is `parts`, and `parts` lists each one in the same shape: `{ "type": "upload", "upload_id": "up_3f9a…", "url": "…" }`. `parts` is `null` otherwise. * **Highlights are the product.** Each is a cut clip linked to its `shot` and its `player` (the scorer). * **Embedded lists cap at 100 items.** `has_more: true` means page the `url` with `limit` / `offset`. * **Cross-links are ids**: `shot.highlight` → `hl_…`, `shot.players.scorer` / `highlight.player` → `plr_…` matching `players.data[].id`. A player's `team_id` `1` is `teams.recording`, `2` is `teams.opponent`; `team_name` repeats that side's name. * A `queued`, `processing` or `failed` session has the **same keys** with empty lists — never a missing field. * Attribution ignores tags the pipeline marked invalid, using the same rule as the box score, so a shot's `players` and a player's `stats` always agree. ## Idempotency Send an `Idempotency-Key` header (any string ≤ 255 chars) on `POST /v1/sessions`. Replaying the same key with the same body within 24 hours returns the original response with an `Idempotent-Replayed: true` header; the same key with a different body returns `400 idempotency_key_reused`. Concurrent requests with the same key are safe: exactly one session is created, and the others receive its response (or a retryable `409 idempotency_key_in_progress` if it hasn't finished yet). Retrying a 5xx with the same key is also safe — the replay finishes any step the failed attempt left undone. Use your own match id. # Webhooks Source: https://developer.hooper.gg/webhooks Signed callbacks when a session finishes — and how to verify them. Register an HTTPS endpoint and Hooper POSTs an **event** to it when a session finishes. The event carries the full session object, so a single delivery gives you the highlights, shots and box score. ## Events | `type` | When | `data.object` | | - | - | - | | `session.processed` | Processing finished successfully | The session, with `highlights` / `shots` / `players` populated | | `session.failed` | Processing failed (or timed out) | The session with `status: "failed"` and `error` set; nothing was charged | ```json theme={null} { "id": "evt_91", "object": "event", "type": "session.processed", "created": 1756224000, "data": { "object": { "id": "sess_18234", "object": "session", "status": "processed", "…": "…" } } } ``` ## Registering an endpoint ```bash theme={null} curl https://zeus.hooper.gg/v1/webhook_endpoints \ -H "Authorization: Bearer $HOOPER_API_KEY" -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/hooks/hooper", "enabled_events": ["*"] }' ``` The response includes `"secret": "hws_prod_…"` — **shown once**, so store it now. Send a synthetic event to check your handler with `POST /v1/webhook_endpoints/we_2/test`. ## Verifying signatures Every delivery carries: ``` Hooper-Signature: t=1756224000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e146c8a0… Hooper-Event-Id: evt_91 ``` `v1` is `HMAC-SHA256(secret, "{t}.{raw_body}")`. This is the same scheme Stripe uses, so an existing Stripe verifier works with the secret swapped. Verify before you parse, using the **raw** request body, and reject timestamps older than 5 minutes. ```python Python theme={null} import hmac, hashlib, time def verify(secret: str, body: bytes, header: str, tolerance: int = 300) -> bool: parts = dict(p.split("=", 1) for p in header.split(",")) ts, sig = int(parts["t"]), parts["v1"] expected = hmac.new(secret.encode(), f"{ts}.".encode() + body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, sig) and abs(time.time() - ts) <= tolerance # FastAPI / Flask etc. if not verify(HOOPER_WEBHOOK_SECRET, request_body_bytes, request.headers["Hooper-Signature"]): return Response(status=400) ``` ```javascript Node theme={null} import crypto from "node:crypto"; export function verify(secret, rawBody, header, tolerance = 300) { const parts = Object.fromEntries(header.split(",").map((p) => p.split("="))); const ts = Number(parts.t); const expected = crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex"); const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1)); return ok && Math.abs(Date.now() / 1000 - ts) <= tolerance; } // Express: use express.raw({ type: "application/json" }) so req.body is the raw bytes. ``` ```python Python (with the stripe package) theme={null} import stripe # Same algorithm: Stripe's verifier accepts Hooper's header with Hooper's secret. stripe.WebhookSignature.verify_header(raw_body, sig_header, HOOPER_WEBHOOK_SECRET, tolerance=300) ``` ## Delivery semantics * **Acknowledge with any 2xx.** Do it fast; process asynchronously. * **At-least-once.** Retries happen on any non-2xx or timeout (10 s): after 1m, 5m, 30m, 2h, 6h, 12h, 24h — eight attempts over about two days. Dedupe on the event `id`. * **Auto-disable.** An endpoint that has been failing for 7 straight days is disabled; re-create it when fixed. * **Catch-up.** Missed something? `GET /v1/events?type=session.processed&created[gte]=…` lists every event, newest first. ## Endpoint requirements Public `https://` URL, no credentials in the URL, resolving to a public address. Private, loopback and link-local destinations are rejected at registration.