Create Audience
Creates a new audience
curl --request POST \
--url https://wt.ls/api/v4/audiences \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '{
"name": "<string>",
"listId": "<string>",
"filters": "{\"points\": {\"gte\": 100}, \"AND\": [{\"email\": {\"contains\": \"@gmail.com\"}}]}",
"mode": "manual"
}'
{
"data": {
"audience": {
"id": "<string>",
"name": "<string>",
"filters": "<string>",
"mode": "smart",
"listId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subs": [
{
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"points": 123,
"referrals": 123,
"listId": "<string>",
"isVerified": true,
"unsubscribed": true,
"customData": {},
"address": "<string>",
"isGDPR": true,
"name": "<string>",
"instagram": "<string>",
"twitter": "<string>",
"website": "<string>",
"company": "<string>",
"country": "<string>",
"city": "<string>",
"list": {},
"audiences": [
"<any>"
],
"referralLink": "<string>",
"privateLink": "<string>"
}
]
}
}
}
Authorizations
API key to authorize requests
Body
Name of the audience
ID of the list this audience belongs to
JSON string containing Prisma where clause for Sub model. Required if mode is 'smart'
Audience mode
manual
, smart
Response
Unique identifier for the audience
Name of the audience
JSON string containing Prisma where clause for filtering contacts
Audience mode (smart or manual)
smart
, manual
ID of the list this audience belongs to
When the audience was created
When the audience was last updated
Contacts in this audience
Unique identifier for the contact
Email address of the contact
First name of the contact
Last name of the contact
Phone number of the contact
When the contact was created
Points accumulated by the contact
Number of referrals by the contact
ID of the list this contact belongs to
Whether the contact is verified
Whether the contact has unsubscribed
Custom data associated with the contact
Contact's address
Whether the contact has GDPR consent
Full name of the contact
Instagram handle
Twitter handle
Personal website URL
Company name
Country of residence
City of residence
Associated list information
Audiences this contact belongs to
Contact's referral link
Contact's private subscriber page URL
curl --request POST \
--url https://wt.ls/api/v4/audiences \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '{
"name": "<string>",
"listId": "<string>",
"filters": "{\"points\": {\"gte\": 100}, \"AND\": [{\"email\": {\"contains\": \"@gmail.com\"}}]}",
"mode": "manual"
}'
{
"data": {
"audience": {
"id": "<string>",
"name": "<string>",
"filters": "<string>",
"mode": "smart",
"listId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subs": [
{
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"points": 123,
"referrals": 123,
"listId": "<string>",
"isVerified": true,
"unsubscribed": true,
"customData": {},
"address": "<string>",
"isGDPR": true,
"name": "<string>",
"instagram": "<string>",
"twitter": "<string>",
"website": "<string>",
"company": "<string>",
"country": "<string>",
"city": "<string>",
"list": {},
"audiences": [
"<any>"
],
"referralLink": "<string>",
"privateLink": "<string>"
}
]
}
}
}