Documentation Index
Fetch the complete documentation index at: https://docs.letterby.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction to Audiences
Audiences allow you to segment your contacts into targeted groups for personalized campaigns, analytics, and engagement strategies. Letterby supports two types of audiences:- Manual Audiences: Manually curated contact lists
- Smart Audiences: Dynamic segments that automatically update based on filter criteria
Getting Started
Prerequisites
Before working with audiences, ensure you have:- A valid API key with access to your Letterby account
- At least one project (list) with contacts
- Understanding of your contact data structure
All audience endpoints require authentication via the
apiKey header.Creating Audiences
Manual Audiences
Manual audiences are perfect for hand-picked segments like VIP customers or beta testers.Smart Audiences
Smart audiences automatically include contacts based on filter criteria. They update in real-time as your contact data changes.Advanced Filtering for Smart Audiences
Smart audiences use Prisma-compatible where clauses, allowing for complex filtering logic.Basic Filtering Examples
By Points Range
By Email Domain
By Verification Status
Complex Filtering with AND/OR Logic
Gmail Users with High Points
Multiple Conditions with OR
Complex Nested Logic
Available Filter Fields
| Field | Type | Description | Example |
|---|---|---|---|
email | String | Contact’s email address | {"contains": "@company.com"} |
firstName | String | First name | {"startsWith": "John"} |
lastName | String | Last name | {"endsWith": "Smith"} |
points | Number | Points accumulated | {"gte": 100} |
referrals | Number | Number of referrals | {"gt": 5} |
isVerified | Boolean | Verification status | true |
unsubscribed | Boolean | Subscription status | false |
company | String | Company name | {"in": ["Tech Corp", "StartupXYZ"]} |
country | String | Country | {"equals": "United States"} |
city | String | City | {"contains": "New York"} |
createdAt | Date | Registration date | {"gte": "2024-01-01T00:00:00Z"} |
String Operators
equals: Exact matchcontains: Partial match (case-insensitive)startsWith: Starts with textendsWith: Ends with textin: Matches any value in arraynotIn: Doesn’t match any value in array
Number Operators
equals: Exact valuegt: Greater thangte: Greater than or equallt: Less thanlte: Less than or equalin: Matches any value in array
Managing Audiences
Listing All Audiences
Retrieve all audiences for a specific list:Retrieving a Specific Audience
Get detailed information about a single audience:Updating Audiences
Modify audience properties including name, filters, and mode:Practical Use Cases
1. Customer Lifecycle Segmentation
2. Geographic Targeting
3. Referral Champions
Best Practices
1. Naming Conventions
- Use descriptive names: “High-Value Gmail Users” vs “Audience 1”
- Include criteria in the name when helpful
- Use consistent naming patterns across your organization
2. Filter Optimization
- Start with simple filters and gradually add complexity
- Test filters with small datasets first
- Use specific date ranges to avoid overly large audiences
3. Regular Maintenance
- Review audience performance regularly
- Update filter criteria based on changing business needs
- Archive unused audiences to keep your workspace clean
4. Testing Smart Audiences
Error Handling
Common Errors and Solutions
Invalid Filters Format
Missing Required Fields
name and listId when creating audiences.
Filters Required for Smart Mode
filters parameter.
API Reference Links
For detailed endpoint documentation, see:Next Steps
Once you’ve mastered audiences, explore:- Using audiences in email campaigns
- Analyzing audience engagement metrics
- Building automated workflows based on audience membership
- Integrating audiences with your CRM or marketing tools