/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Create Audience Profile

Create Audience Profile

Create a new audience profile

POST/v1/projects/{projectId}/audiencesTry it
Session token

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

StatusCodeWhen
400validation_errorA 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
401unauthorizedNo session token, or an API key — this endpoint needs a session JWT
403forbiddenYou're not a member of the project's organization
409conflictA profile with this slug already exists in the project (Audience profile slug already taken)
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X POST https://api.syntext.dev/v1/projects/proj_abc123/audiences \
-H "Authorization: Bearer $SYNTEXT_JWT" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Enterprise partner with OTC and VA access",
"audiences": ["otc", "virtual-accounts"]
}'
Responseapplication/json
201Created
{
"data": {
"id": "8d0c6a1e-2f4b-4c3d-9e7a-5b1f0a2c3d4e",
"projectId": "3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c",
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Enterprise partner with OTC and VA access",
"audiences": ["otc", "virtual-accounts"],
"lastUsedAt": null,
"createdAt": "2026-03-15T10:30:00Z",
"updatedAt": "2026-03-15T10:30:00Z",
"accessToken": null
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext