Skip to content
Internal: only for Sendwing’s own apps (the web app, admin). It may change at any time.

Send a test of a campaign

POST
/api/organizations/{organizationId}/campaigns/{campaignId}/test
curl --request POST \
--url https://api.sendwing.app/api/organizations/example/campaigns/example/test \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "emails": [ "example" ] }'

Sends it to up to 5 addresses to check how it looks, in any status: the subject starts with [Test], merge tags show their fallbacks, and nothing is tracked. Needs campaign: send, as it emails any address. 422 when the checklist, apart from the audience, doesn’t pass.

organizationId
required
string

The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.

campaignId
required
string

Like cmp_…

Media typeapplication/json
object
emails
required
Array<string>
>= 1 items <= 5 items

Example generated

{
"emails": [
"example"
]
}

Sent

Media typeapplication/json
object
sent
required

How many test emails were sent

integer
>= -9007199254740991 <= 9007199254740991

Example generated

{
"sent": 1
}

The request isn’t valid; issues lists each problem

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The API key or access token is missing, invalid or expired

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

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

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Not found in this workspace

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Valid, but what it acts on isn’t ready for it; issues lists what to fix

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Too many requests; wait for the seconds in Retry-After

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400, each invalid field of the request; for a 422, what to fix first

Array<object>
object
path
required

The field, like events.0.name in the request or subject of what it acts on

string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}