AI Studios - Publication Permission Check

View as Markdown
Validate a user's access to a publication (studio) and optionally switch their workspace cookie. Request Body: {"url": "<publication-custom-url>"}. Logic Flow: 1. Resolve publication via custom URL (404 if invalid). 2. Determine membership: owner OR co-creator OR explicit workspace member OR current request workspace match. 3. If publication visibility != PUBLIC: - 401 if user unauthenticated - 404 if authenticated but not a member. 4. If member, set/overwrite workspace cookie (wsid) to publication.workspace.id. 5. Always return a JSON {detail: <message>} with appropriate status code. Cookie is only set when membership is confirmed and a workspace exists. Public visibility always returns 200 even for non-members (cookie unchanged).

Request

This endpoint expects an object.
urlstringRequired
Publication custom URL to validate access for

Response

Access granted (public or authorized). Cookie updated only when user is a member.

Errors

401
Unauthorized Error
404
Not Found Error