Marketing Lists & Audiences API
Overview
The Marketing Lists & Audiences API provides comprehensive management of customer segmentation within the Stack9 Digital Experience Platform. This API enables you to create dynamic audiences based on behavior and attributes, manage static lists for targeted campaigns, and orchestrate sophisticated segmentation strategies for personalized marketing at scale.
Resource Description
Marketing Audiences
Marketing audiences represent dynamic segments that automatically update based on defined criteria. Key characteristics:
- Dynamic Membership: Subscribers automatically join or leave based on real-time attribute changes
- Rule-Based Segmentation: Define complex criteria using subscriber attributes, behaviors, and engagement patterns
- Real-Time Updates: Audience membership recalculates as subscriber data changes
- Scalable Performance: Optimized for millions of subscribers with sub-second query performance
- Cross-Channel Activation: Use audiences across email, SMS, push, and other channels
Marketing Lists
Marketing lists represent static groups of subscribers for specific campaigns or purposes. Key characteristics:
- Static Membership: Manually controlled subscriber additions and removals
- Import/Export Support: Bulk operations for list management via CSV/Excel
- Campaign Association: Direct linkage to marketing campaigns and emails
- Suppression Lists: Support for exclusion lists and compliance requirements
- Version Control: Track list changes over time with audit trails
List-Audience Relationships
Lists can be associated with audiences to create hybrid segmentation strategies:
- Dynamic Lists: Lists that inherit members from audiences
- List Unions: Combine multiple lists and audiences
- Exclusion Rules: Remove audience members who appear in suppression lists
- Priority Management: Control precedence when subscribers belong to multiple segments
Key Features
- Flexible Segmentation: Combine static and dynamic approaches for optimal targeting
- Bulk Operations: Import thousands of subscribers with job tracking
- Real-Time Sync: Immediate updates across all marketing channels
- Performance Analytics: Track segment growth and engagement metrics
- Compliance Support: Built-in GDPR/CCPA compliance with audit trails
- API-First Design: Full programmatic control for automation workflows
- Job Management: Asynchronous processing for large-scale operations
Authentication
All endpoints require API key authentication:
X-API-Key: your-api-key-here
Marketing Audiences
Create Audience
Create a new dynamic audience for automated segmentation.
POST /api/audiences
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique, descriptive name for the audience |
Example Request
curl -X POST \
https://apis.app.stack9.co/api/audiences \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"name": "High-Value Customers"
}'
Example Response
{
"id": "aud_Kj9mNp2QrT8xLw3"
}
Error Responses
400 Bad Request
{
"message": "Invalid audience data",
"code": "INVALID_AUDIENCE",
"issues": [
{
"field": "name",
"message": "Audience name already exists"
}
]
}
List Audiences
Retrieve all audiences with filtering and pagination support.
POST /api/audiences/list
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Page number (1-based) |
limit | number | Yes | Items per page (max: 100) |
search | string | No | Search audiences by name |
filters | object | No | Filter criteria object |
filters.name | object | No | Filter by audience name |
filters.id | object | No | Filter by audience ID |
filters.created_at | object | No | Filter by creation date |
filters.updated_at | object | No | Filter by last update date |
Filter Operations
Each filter field supports the following operations:
eq: Equalsne: Not equalslike: Contains (case-insensitive)in: In array of valuesbetween: Between two values (for dates)gt,gte,lt,lte: Comparison operators
Example Request
curl -X POST \
https://apis.app.stack9.co/api/audiences/list \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 20,
"search": "customers",
"filters": {
"created_at": {
"operation": "between",
"value": ["2024-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]
}
}
}'
Example Response
{
"results": [
{
"id": "aud_Kj9mNp2QrT8xLw3",
"name": "High-Value Customers",
"created_at": "2024-03-15T10:30:00.000Z",
"updated_at": "2024-03-20T14:45:00.000Z",
"version": 3
},
{
"id": "aud_Nm7kPq4RsU9yMx5",
"name": "Newsletter Subscribers",
"created_at": "2024-02-01T08:00:00.000Z",
"updated_at": null,
"version": 1
}
],
"total": 15,
"totalPages": 1
}
Get Audience by ID
Retrieve detailed information about a specific audience.
GET /api/audiences/{audience_id}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audience_id | string | Yes | The audience's unique identifier |
Example Request
curl -X GET \
https://apis.app.stack9.co/api/audiences/aud_Kj9mNp2QrT8xLw3 \
-H 'X-API-Key: your-api-key-here'
Example Response
{
"id": "aud_Kj9mNp2QrT8xLw3",
"name": "High-Value Customers",
"created_at": "2024-03-15T10:30:00.000Z",
"updated_at": "2024-03-20T14:45:00.000Z",
"version": 3
}
Update Audience
Update an existing audience's properties.
PUT /api/audiences/{id}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The audience's unique identifier |
name | string | Yes | New name for the audience |
Example Request
curl -X PUT \
https://apis.app.stack9.co/api/audiences/aud_Kj9mNp2QrT8xLw3 \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"name": "VIP High-Value Customers"
}'
Example Response
{
"id": "aud_Kj9mNp2QrT8xLw3"
}
Delete Audience
Permanently delete an audience and remove all subscriber associations.
DELETE /api/audiences/{audience_id}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audience_id | string | Yes | The audience's unique identifier |
Example Request
curl -X DELETE \
https://apis.app.stack9.co/api/audiences/aud_Kj9mNp2QrT8xLw3 \
-H 'X-API-Key: your-api-key-here'
Example Response
{
"id": "aud_Kj9mNp2QrT8xLw3"
}
Add Subscriber to Audience
Add a subscriber to an audience for dynamic segmentation.
POST /api/audiences/{audience_id}/subscribers
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audience_id | string | Yes | The audience's unique identifier |
subscriber_id | string | Yes | The subscriber's unique identifier |
Example Request
curl -X POST \
https://apis.app.stack9.co/api/audiences/aud_Kj9mNp2QrT8xLw3/subscribers \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"subscriber_id": "sub_Pq9nRt5YsW2zNx8"
}'
Example Response
{
"audience_id": "aud_Kj9mNp2QrT8xLw3",
"subscriber_id": "sub_Pq9nRt5YsW2zNx8"
}
Remove Subscriber from Audience
Remove a subscriber from an audience.
DELETE /api/audiences/{audience_id}/subscribers/{subscriber_id}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audience_id | string | Yes | The audience's unique identifier |
subscriber_id | string | Yes | The subscriber's unique identifier |
Example Request
curl -X DELETE \
https://apis.app.stack9.co/api/audiences/aud_Kj9mNp2QrT8xLw3/subscribers/sub_Pq9nRt5YsW2zNx8 \
-H 'X-API-Key: your-api-key-here'
Example Response
{
"audience_id": "aud_Kj9mNp2QrT8xLw3",
"subscriber_id": "sub_Pq9nRt5YsW2zNx8"
}
Marketing Lists
Create List
Create a new marketing list with optional audience association.
POST /api/lists
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Memorable name for the list |
mode | string | Yes | List mode: static or dynamic |
audience_id | string | Yes | Associated audience ID (use default if none) |
jobs | array | No | Import jobs to process after creation |
Example Request - Static List
curl -X POST \
https://apis.app.stack9.co/api/lists \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"name": "Q1 2024 Campaign Targets",
"mode": "static",
"audience_id": "aud_default"
}'
Example Request - Dynamic List with Audience
curl -X POST \
https://apis.app.stack9.co/api/lists \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"name": "Auto-Updated VIP List",
"mode": "dynamic",
"audience_id": "aud_Kj9mNp2QrT8xLw3"
}'
Example Response
{
"id": "list_Rt7mKp3QsU9xNw4"
}
List All Lists
Retrieve all marketing lists with comprehensive filtering.
POST /api/lists/list
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Page number (1-based) |
limit | number | Yes | Items per page (max: 100) |
search | string | No | Search lists by name |
filters | object | No | Filter criteria object |
filters.id | object | No | Filter by list ID |
filters.name | object | No | Filter by list name |
filters.mode | object | No | Filter by mode (static/dynamic) |
filters.audience_id | object | No | Filter by associated audience |
filters.created_at | object | No | Filter by creation date |
filters.updated_at | object | No | Filter by last update date |
Example Request
curl -X POST \
https://apis.app.stack9.co/api/lists/list \
-H 'X-API-Key: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 25,
"filters": {
"mode": {
"operation": "eq",
"value": "static"
}
}
}'
Example Response
{
"results": [
{
"id": "list_Rt7mKp3QsU9xNw4",
"name": "Q1 2024 Campaign Targets",
"mode": "static",
"audience_id": "aud_default",
"audience_name": "All Subscribers",
"created_at": "2024-01-15T09:00:00.000Z",
"updated_at": "2024-03-10T16:30:00.000Z",
"version": 5
},
{
"id": "list_Nm8pQr5TsW3yOx6",
"name": "Product Launch Early Access",
"mode": "static",
"audience_id": "aud_Kj9mNp2QrT8xLw3",
"audience_name": "High-Value Customers",
"created_at": "2024-02-20T11:15:00.000Z",
"updated_at": null,
"version": 1
}
],
"total": 42,
"totalPages": 2
}