API Reference List Audience Profiles
List Audience Profiles
List all audience profiles for a project
Session token
Retrieve all audience profiles configured for a project, sorted by name. The list is not paginated — every profile is returned in one response.
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
projectIdThe project ID.
Response
Returns an array of audience profile objects.
Profile Object
NameDescription
idUnique profile identifier.
projectIdThe project the profile belongs to.
nameDisplay name of the profile.
slugURL-safe identifier. Immutable after creation.
descriptionOptional description of the profile.
audiencesArray of audience tags this profile grants access to.
accessTokenThe profile's access code, or
null if none has been created yet. Owners and admins only — omitted for members. Create one with Generate Access Token.lastUsedAtWhen the profile's access token was last accepted — by doc-site search or the AI assistant (sent as the
x-audience-token header), or when a reader unlocked gated pages with it. Updated at most once every 5 minutes per profile, so treat it as approximate. null if the token has never been used.createdAtISO 8601 timestamp when the profile was created.
updatedAtISO 8601 timestamp when the profile was last updated.
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl https://api.syntext.dev/v1/projects/proj_abc123/audiences \
-H "Authorization: Bearer $SYNTEXT_JWT"
// A browser has no environment variables: set these to your values.
const SYNTEXT_JWT = '<SYNTEXT_JWT>';
const response = await fetch('https://api.syntext.dev/v1/projects/proj_abc123/audiences', {
method: 'GET',
headers: {
'Authorization': `Bearer ${SYNTEXT_JWT}`,
},
});
const data = await response.json();
console.log(response.status, data);
import os
import requests
url = "https://api.syntext.dev/v1/projects/proj_abc123/audiences"
headers = {
"Authorization": f"Bearer {os.environ['SYNTEXT_JWT']}",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.syntext.dev/v1/projects/proj_abc123/audiences", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SYNTEXT_JWT"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/projects/proj_abc123/audiences")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("SYNTEXT_JWT")}"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/projects/proj_abc123/audiences',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SYNTEXT_JWT'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/projects/proj_abc123/audiences"))
.header("Authorization", "Bearer " + System.getenv("SYNTEXT_JWT"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.syntext.dev/v1/projects/proj_abc123/audiences");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer " + Environment.GetEnvironmentVariable("SYNTEXT_JWT"));
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
json
{
"data": [
{
"id": "aud_xyz789",
"projectId": "proj_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Enterprise partner with full access",
"audiences": ["otc", "virtual-accounts", "transfers"],
"lastUsedAt": "2024-02-21T09:12:00Z",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-02-20T14:45:00Z"
},
{
"id": "aud_def456",
"projectId": "proj_abc123",
"name": "Beta Testers",
"slug": "beta-testers",
"description": "Early access program participants",
"audiences": ["beta"],
"lastUsedAt": null,
"createdAt": "2024-01-10T08:00:00Z",
"updatedAt": "2024-01-10T08:00:00Z"
}
]
}