---
title: "Add new referer"
method: POST
path: "/{library_id}?action=refer"
---

# Add new referer

`POST /{library_id}?action=refer`

Adds referer rules (ALLOW or BLOCK) to a library. Note: this operation actually lives on the **library** service (`https://api-v2.pandavideo.com/library`), not the live service — the server override above ensures the correct URL is shown.

## Path parameters

- `library_id` string, required

## Request body

- union
  - object[]
    - `hostname` string, required — Domain name (e.g. `example.com`, `*.example.com`). Must contain a `.` and a TLD of 2+ letters — `localhost` and bare IPs are rejected by the validation regex.
    - `type` 'ALLOW' | 'BLOCK', required — ALLOW or BLOCK
  - object
    - `hostname` string, required
    - `type` 'ALLOW' | 'BLOCK', required

## Response `200`

Created referer entries (always returned as an array, even for a single-object request).

- object[]
  - `id` string, uuid
  - `library_id` string, uuid
  - `type` 'ALLOW' | 'BLOCK'
  - `url` string
  - `status` 'inactive' | 'active'
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400` — Validation error. Common reasons: hostname doesn't match the TLD regex (e.g. `localhost`); `type` not in `ALLOW`/`BLOCK`.

---

[API](https://skmtc.net/pandavideo/apis/api-v2.md) · [All operations](https://skmtc.net/pandavideo/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pandavideo/api-v2/versions/4fbd3c623ca9/schema)
