Syntext DOCS
Get Started
API Update Audience Profile
PATCH/v1/projects/{projectId}/audiences/{profileId}

Update Audience Profile

Update the name, description, or audience tags of an existing profile. The slug cannot be changed after creation.

Path Parameters

The project ID.

The audience profile ID.

Request Body

All fields are optional. Only provided fields will be updated.

Updated display name for the profile.

Updated description. Set to null to clear.

Updated array of audience tags. Replaces the existing tags entirely.

Changing audiences affects all existing tokens for this profile. Clients with old tokens will gain or lose access to pages based on the new tags.

Response

Returns the updated audience profile object.

Example

curl -X PATCH https://api.syntext.dev/v1/projects/proj_abc123/audiences/aud_xyz789 \
-H "Authorization: Bearer stx_abc12345_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp (Enterprise)",
"audiences": ["otc", "virtual-accounts", "transfers"]
}'
import { Syntext } from '@syntext/sdk'

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

const profile = await client.audiences.update('proj_abc123', 'aud_xyz789', {
name: 'Acme Corp (Enterprise)',
audiences: ['otc', 'virtual-accounts', 'transfers'],
})
from syntext import Syntext

client = Syntext("stx_abc12345_...")

profile = client.audiences.update(
"proj_abc123",
"aud_xyz789",
name="Acme Corp (Enterprise)",
audiences=["otc", "virtual-accounts", "transfers"],
)

Response

{
  "id": "aud_xyz789",
  "name": "Acme Corp (Enterprise)",
  "slug": "acme-corp",
  "description": "Enterprise partner with OTC and VA access",
  "audiences": ["otc", "virtual-accounts", "transfers"],
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-03-20T14:45:00Z"
}

Error Responses

404 Not Found

Returned when the profile does not exist.

{
  "error": {
    "code": "profile_not_found",
    "message": "Profile does not exist"
  }
}

422 Unprocessable Entity

Returned when the request contains invalid data.

{
  "error": {
    "code": "empty_audiences",
    "message": "Audiences array cannot be empty"
  }
}
{
  "error": {
    "code": "slug_immutable",
    "message": "Slug cannot be changed after creation"
  }
}
Assistant
Responses are generated using AI and may contain mistakes.

Ask me anything about the documentation.

ESC