List a campaign’s recipients
const url = 'https://api.sendwing.app/api/organizations/example/campaigns/example/recipients?limit=50&status=queued&event=delivered';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.sendwing.app/api/organizations/example/campaigns/example/recipients?limit=50&status=queued&event=delivered' \ --header 'x-api-key: <x-api-key>'Who it went to, with each recipient’s delivery and engagement; newest contacts first. status and event narrow it. Empty until it starts sending. For a campaign from a month that’s archived, a page can be short with more to come: follow nextCursor until it’s null.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.
Like cmp_…
Query Parameters
Section titled “Query Parameters”How many items a page holds
The nextCursor of the previous page
Only recipients who did this, like opened
Responses
Section titled “Responses”A page of recipients
object
object
Like con_…
The address it was sent to; for an archived campaign, the contact’s current one
queued until it’s sent; failed or skipped with an error
Why it failed or was skipped: refused or invalid when it couldn’t be sent, like for the address; content_rejected when it was rejected after being accepted; campaign_canceled when the campaign was canceled first; campaign_canceled_maybe_sent when it was canceled while this email may have gone out
Pass as cursor to get the next page; null on the last page
Example
{ "data": [ { "status": "queued", "error": "refused" } ]}The request isn’t valid; issues lists each problem
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key or access token is missing, invalid or expired
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key’s permissions, or the app’s scopes and the member’s role, don’t allow this
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Not found in this workspace
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Too many requests; wait for the seconds in Retry-After
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}