POST

Query Email Subscriptions


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves email subscriptions, given the provided paging, filtering, and sorting.

Currently, querying is supported on the email field with the $in array filter. For example, to query for emails "me@my.com" and "you@your.org", the filter should be formed like this:

Copy
{ "filter": { "email": { "$in": ["me@my.com", "you@your.org"] } } }

To learn how to query email subscriptions, see API Query Language.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Email Subscriptions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/email-marketing/v1/email-subscriptions/query

Body Params
filterstructRequired

Filter options. Currently, querying is supported on the email field with the $in array filter.


pagingPaging

Pagination options. For more information, see Pagination.

Response Object
subscriptionsArray <EmailSubscription>

List of subscribed emails that matched the query options.


metadataMetadata

Metadata for the paginated results.

Find Subscriptions for the Requested Email Addresses
Request
cURL
curl -X POST \ 'https://www.wixapis.com/email-marketing/v1/email-subscriptions/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "filter": { "email": { "$in": ["email-1@query.com", "email-2@query.com"] } }, "paging": { "limit": 30, "offset": 30 } }'
Response
JSON
{ "email_subscriptions": [ { "id": "9c130f52-31c4-11ed-a261-0242ac120002", "email": "email-1@query.com", "subscriptionStatus": "SUBSCRIBED", "deliverabilityStatus": "VALID", "createdDate": "2019-10-30T17:22:10.299Z", "updatedDate": "2019-10-30T17:22:10.299Z" }, { "id": "e50c4534-d0a5-11ea-87d0-0242ac130003", "email": "email-2@query.com", "subscriptionStatus": "PENDING", "deliverabilityStatus": "BOUNCED", "createdDate": "2019-09-20T17:48:10.299Z", "updatedDate": "2019-11-13T20:14:49.458Z" } ], "metadata": { "count": 2, "offset": 30, "total": 32 } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?