Tool name: create-contact-audience
Saves a contact audience, as "Save as audience" on the contact search page does: a named search over channel, subscription status, bounces, opt-in and confirmation dates, tags and custom field values. It is dynamic -- a newsletter addressing it (update-newsletter-draft, mode "saved_audience") reaches whoever matches when it is sent. Tags come from search-tags, fields and their types from search-custom-fields. The answer counts the contacts that match now. Sends nothing.
Input example
{ "name": "string", "filter": { "channel": "any", "email": { "address": { "operator": "is", "value": "string" }, "statuses": [ "subscribed" ], "bounces": [ "not-bounced" ], "optInDate": { "operator": "on", "date": "string", "until": "string" }, "confirmationDate": { "operator": "on", "date": "string", "until": "string" } }, "sms": { "phoneNumber": { "operator": "is", "value": "string" }, "statuses": [ "subscribed" ], "bounces": [ "not-bounced" ], "subscriptionDate": { "operator": "on", "date": "string", "until": "string" } }, "tags": { "include": [ 1 ], "includeMatch": "all", "exclude": [ 1 ], "excludeMatch": "all" }, "customFields": [ { "fieldId": "string", "operator": "is-empty", "value": "string", "values": [ "string" ], "until": "string" } ] }, "accountId": null }
Output example
{ "accountId": 0, "audienceId": 0, "name": "string", "filter": { "channel": "any", "email": { "address": { "operator": "is", "value": "string" }, "statuses": [ "subscribed" ], "bounces": [ "not-bounced" ], "optInDate": { "operator": "on", "date": "string", "until": "string" }, "confirmationDate": { "operator": "on", "date": "string", "until": "string" } }, "sms": { "phoneNumber": { "operator": "is", "value": "string" }, "statuses": [ "subscribed" ], "bounces": [ "not-bounced" ], "subscriptionDate": { "operator": "on", "date": "string", "until": "string" } }, "tags": { "include": [ 1 ], "includeMatch": "all", "exclude": [ 1 ], "excludeMatch": "all" }, "customFields": [ { "fieldId": "string", "operator": "is-empty", "value": "string", "values": [ "string" ], "until": "string" } ] }, "contactCount": 0, "unsentNewsletters": [ { "newsletterId": 0, "name": "string", "channel": "email", "status": "draft" } ] }