Update the access policy for a session, including visibility, viewer limits, blocked paths, and password protection.
Path Parameters
The session slug (format: adjective-noun-number)
Request Body
All fields are optional. Only the fields provided will be updated.
Whether the session is publicly accessibleWhen set to false, the session becomes private and requires additional authentication.
Maximum number of concurrent viewers allowed in the sessionDefault is 20. Set to a lower number to limit concurrent access.
Array of URL paths to block from being accessed by viewersExample: ["/admin", "/api/internal"]
Password required for viewers to access the sessionSet to an empty string to remove password protection.
Response
Whether the update was successful
The updated policy objectWhether the session is publicly accessible
Maximum number of concurrent viewers allowed
Array of blocked URL paths
Example Request
curl -X POST https://control.wormkey.io/sessions/by-slug/quiet-lime-42/policy \
-H "Content-Type: application/json" \
-d '{
"public": false,
"maxConcurrentViewers": 5,
"blockPaths": ["/admin", "/api/internal"],
"password": "secure123"
}'
Example Response
{
"ok": true,
"policy": {
"public": false,
"maxConcurrentViewers": 5,
"blockPaths": ["/admin", "/api/internal"],
"password": "secure123"
}
}
Partial Update Example
You can update individual fields without affecting others:
curl -X POST https://control.wormkey.io/sessions/by-slug/quiet-lime-42/policy \
-H "Content-Type: application/json" \
-d '{
"maxConcurrentViewers": 10
}'
{
"ok": true,
"policy": {
"public": true,
"maxConcurrentViewers": 10,
"blockPaths": [],
"password": ""
}
}
Error Response
Returns a 404 error if the session is not found:
{
"error": "Session not found"
}