---
title: Create Audience Profile
protocol: rest
method: POST
endpoint: /v1/projects/{projectId}/audiences
description: "Create a new audience profile"
---

# Create Audience Profile

Create a new audience profile to control content access for a client segment.

<Endpoint method="POST" path="/v1/projects/{projectId}/audiences" />

## Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Display name for the profile. Example: "Acme Corporation".
</ParamField>

<ParamField body="slug" type="string" required>
  URL-safe identifier for the profile. Must be unique within the project. Cannot be changed after creation.
  
  **Format**: lowercase letters, numbers, and hyphens only. Example: `acme-corp`.
</ParamField>

<ParamField body="description" type="string">
  Optional description of the profile or client.
</ParamField>

<ParamField body="audiences" type="string[]" required>
  Array of audience tags this profile grants access to. These tags correspond to the `audience` field in page frontmatter.
  
  **Example**: `["otc", "virtual-accounts"]`
</ParamField>

## Response

Returns the created audience profile object.

## Example

<CodeGroup>
```bash cURL
curl -X POST https://api.syntext.dev/v1/projects/proj_abc123/audiences \
  -H "Authorization: Bearer stx_abc12345_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corporation",
    "slug": "acme-corp",
    "description": "Enterprise partner with OTC and VA access",
    "audiences": ["otc", "virtual-accounts"]
  }'
```

```typescript SDK
import { Syntext } from '@syntext/sdk'

const client = new Syntext('stx_abc12345_...')

const profile = await client.audiences.create('proj_abc123', {
  name: 'Acme Corporation',
  slug: 'acme-corp',
  description: 'Enterprise partner with OTC and VA access',
  audiences: ['otc', 'virtual-accounts'],
})
```

```python Python
from syntext import Syntext

client = Syntext("stx_abc12345_...")

profile = client.audiences.create(
    "proj_abc123",
    name="Acme Corporation",
    slug="acme-corp",
    description="Enterprise partner with OTC and VA access",
    audiences=["otc", "virtual-accounts"],
)
```
</CodeGroup>

### Response

```json
{
  "id": "aud_xyz789",
  "name": "Acme Corporation",
  "slug": "acme-corp",
  "description": "Enterprise partner with OTC and VA access",
  "audiences": ["otc", "virtual-accounts"],
  "createdAt": "2024-03-15T10:30:00Z",
  "updatedAt": "2024-03-15T10:30:00Z"
}
```

## Error Responses

### 400 Bad Request

Returned when the slug contains invalid characters.

```json
{
  "error": {
    "code": "invalid_slug",
    "message": "Slug must contain only lowercase letters, numbers, and hyphens"
  }
}
```

### 409 Conflict

Returned when a profile with this slug already exists.

```json
{
  "error": {
    "code": "slug_exists",
    "message": "A profile with this slug already exists"
  }
}
```

### 422 Unprocessable Entity

Returned when the request is missing required data.

```json
{
  "error": {
    "code": "empty_audiences",
    "message": "At least one audience tag is required"
  }
}
```
