Create a new audience profile to control content access for a client segment.
Note
Org membership is required. Being signed in is not enough: you must be a
member of the organization that owns {projectId}. A project you cannot see
returns 404, one you are not a member of returns 403 with the forbidden
code — see Authentication.
accessToken is returned to workspace owners and admins only. It is the
code that unlocks this profile's gated pages, so for a member the field is
left out of the response entirely. Every other field is the same for every role.
Path Parameters
NameDescription
projectId:stringpathRequired
The project ID.
Request Body
NameDescription
name:stringbodyRequired
Display name for the profile, 1–100 characters. Example: "Acme Corporation".
slug:stringbodyRequired
URL-safe identifier, 1–50 characters of lowercase letters, numbers and hyphens (^[a-z0-9-]+$). Must be unique within the project. It can't be changed after creation. Example: acme-corp.
description:stringbody
Optional description of the profile or client, up to 500 characters.
audiences:string[]body
Audience tags this profile grants access to, each 1–50 characters. They correspond to the audience field in page frontmatter. An empty list is accepted.
Example: ["otc", "virtual-accounts"]
Default"[]"
Response
201 Created with the new profile in data.
Response — 201 Created
accessToken is present only for owners and admins, and is null until a code is minted with Generate Access Token.
Errors
Status
Code
When
400
validation_error
A field is missing or out of range — for example a slug with characters other than a–z, 0–9 and -. Each problem is in details.issues
401
unauthorized
No session token, or an API key — this endpoint needs a session JWT
403
forbidden
You're not a member of the project's organization
409
conflict
A profile with this slug already exists in the project (Audience profile slug already taken)