Update the project's stream security settings
Update the project's stream security settings
/v1/projects/{id}/security-settingsThis operation supports dashboard session-cookie authentication. Call it only from trusted server code; browsers must not manufacture or expose the session cookie.
Partial update: send only the fields that change. Domain patterns are
normalized (lowercased, pasted schemes/paths stripped) and
deduplicated; *.example.com matches every subdomain and the apex.
The stored document is always the full effective object, and the
response returns it. Enabling embedTokenAuthEnabled mints the embed
token key if the project has none yet. Session-cookie auth only. Rate
limit: 60 requests per 60 s per session.
Error codes: unauthorized (401), not_found (404),
invalid_security_settings (400), embed_tokens_unconfigured (503 —
the API has no EMBED_TOKEN_KEY_MASTER).
Authentication
- sessionCookie — Dashboard session cookie set by
POST /v1/auth/login. Video and playback endpoints additionally require theprojectIdquery parameter under cookie auth.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (Ulid) | Yes | — |
Request body
required
Content type: application/json
Schema: StreamSecuritySettingsPatch
{
"allowedReferrers": [
"*.myschool.example"
],
"blockedReferrers": [
"pirate.example"
],
"blockDirectUrlAccess": true
}Responses
| Status | Meaning |
|---|---|
200 | The full effective stream-security settings after the patch. |
400 | The request body or query failed validation. The per-operation description lists the exact error.code values. |
401 | No valid credential was presented. |
404 | The resource does not exist or is not visible to this caller. |
429 | Rate limit exceeded. |
503 | Embed token verification is not configured on this API. |
Example request
{
"allowedReferrers": [
"*.myschool.example"
],
"blockedReferrers": [
"pirate.example"
],
"blockDirectUrlAccess": true
}