Panda Video Referrer Management API
# Referrer Management Manages the **whitelist of domains** allowed to embed and play videos from this library. Combined with `block_none_refer`, this is the primary mechanism to control where the player is allowed to load. > 🚧 **All operations in this section require the `?action=` query parameter.** Without it, POST/DELETE requests return `405 Unsupported method`, and GET falls back to "library details" instead of returning referrers. ## Endpoints and actions | Method | `?action=` | Operation | |---|---|---| | GET | `refer` | List allowed referrers | | POST | `refer` | Add 1+ referrers | | POST | `referValidation` | Toggle the `block_none_refer` policy | | DELETE | `refer` | Remove 1+ referrers (asynchronous) | ## Referrer lifecycle ``` pending → active (worker confirmed the domain at the CDN) active → turning_inactive (when block_none_refer is set to false) active → deleting → row destroyed (worker removed from CDN) inactive ↔ pending (re-activated when block_none_refer turns true) ``` Intermediate states (`pending`, `turning_inactive`, `deleting`) typically resolve in seconds to a couple of minutes. Operations against a referrer in an intermediate state are rejected with `400 You have domains loading, please wait until they are loaded`. ## Side effects - Every mutation pushes a message to SQS — the refer worker reconciles the whitelist with Bunny CDN's `videolibrary` allowed-referers list. - Required system domains are always injected by the worker (dashboard, gstatic, `player-*` hostnames) — you do **not** need to add them manually. - Audit log entries are queued for `add` and `remove` actions under the `security` category. ## Business rules - `hostname` is validated by a strict regex (no scheme, no commas; wildcard `*.example.com` accepted). - Duplicate hostnames per library return `400 Refer already exists` (case-insensitive match). - Only `type: ALLOW` is processed today; the field is required but its value is effectively fixed.