Campaigns
Campaigns are emails you set up in Gatsby for an event. With these endpoints you can find an event's email campaigns, see which guests each campaign has reached, and send a campaign to guests you added through the API.
The API sends a campaign exactly as it is saved in Gatsby. The subject, message, sender, reply-to address, cc, bcc and attachments all come from the campaign. The API cannot change them. To change the email, edit the campaign in Gatsby, then send it.
These endpoints cover email campaigns only. SMS campaigns are not listed, and requests for one return 404. Every path also works with /events in place of /event.
Typical flow
- Add guests to the event with Add guests to an event (
POST /event/:id/guestlist). - List the event's campaigns and copy the
campaignIdof the campaign to send. - Send the campaign with
recipientStatusset tonot_sent. Every guest who has not received the campaign gets it, including the guests you just added. To send to specific guests instead, pass theirpersonIds. - Check the send with the
sendIdfrom the response, or list the recipients to see each guest's status.
The campaign model
A campaign summary includes guest counts by recipient status. The counts cover the event's current guests. Guests removed from the event are not counted.
A guest can have more than one entry on a campaign. Counts and the recipients list have one row per entry, like the guest tabs of a campaign in Gatsby. A guest with no entry counts once, as not_sent.
Properties
- Name
campaignId- Type
- string
- Description
Unique identifier for the campaign.
- Name
name- Type
- string
- Description
The campaign name shown in Gatsby. An empty string when the campaign has no name.
- Name
channel- Type
- string
- Description
Always
email.
- Name
createdAt- Type
- string
- Description
When the campaign was created, in ISO 8601 format.
- Name
counts- Type
- object
- Description
The number of the event's guests in each recipient status. Has a key for every status, including those with zero guests.
not_sentcounts guests the campaign was never sent to.
The recipient model
A recipient is one entry of a guest on a campaign, with its status. Every current guest has at least one recipient row, including guests the campaign was never sent to. A guest with more than one entry has more than one row, so a personId can repeat.
Properties
- Name
personId- Type
- string
- Description
The guest's person ID. This is the same
personIdthe guest list and person endpoints return.
- Name
email- Type
- string | null
- Description
The guest's preferred email address.
nullwhen the guest has no email address.
- Name
status- Type
- string
- Description
The guest's recipient status on this campaign.
- Name
statusAt- Type
- string | null
- Description
When the guest reached this status, in ISO 8601 format.
nullfornot_sent.
- Name
reason- Type
- string | null
- Description
Why the email was not sent, for
blockedandfailedguests. See reason codes.nullfor every other status, and when Gatsby recorded no reason.
Recipient statuses
- Name
not_sent- Description
The campaign was never sent to this guest.
- Name
scheduled- Description
The guest's email is set to go out at a later time.
- Name
pending- Description
The email is being sent now.
- Name
sent- Description
The email was sent.
- Name
opened- Description
The guest opened the email.
- Name
failed- Description
The email could not be sent. An invalid email address shows as
failedwith the reasoninvalid_email.
- Name
bounced- Description
The guest's mail server rejected the email.
- Name
blocked- Description
Gatsby stopped the email before sending it.
reasonsays why.
- Name
unsubscribed- Description
The guest unsubscribed.
- Name
cancelled- Description
The guest's email was cancelled in Gatsby before it went out. Gatsby lists these guests under Not sent to. Guests in a send you cancel with Cancel a send do not get this status. A scheduled guest goes back to the status they had before the send. A guest whose email was already being sent shows as
not_sent.
Reason codes
- Name
missing_custom_fields- Description
The email uses a merge field that has no value for this guest.
- Name
unsubscribed- Description
The guest has unsubscribed from your emails.
- Name
invalid_email- Description
The guest's email address is not valid.
- Name
previous_bounce- Description
An earlier email to this address bounced.
- Name
no_email- Description
The guest has no email address.
- Name
no_seat_assigned- Description
The email includes seating details, and the guest has no seat.
- Name
seating_chart_not_found- Description
The email includes seating details, and the event has no seating chart.
The send model
A send is one request to send a campaign. Each 202 response from Send a campaign creates one send.
A send exists while at least one guest is still on it. When a cancel takes every guest off a send, the send no longer exists, and Retrieve a send and Cancel a send return 404 for its sendId. A send that was only partly cancelled, for example because some emails had already gone out, still exists.
Properties
- Name
sendId- Type
- string
- Description
Unique identifier for the send.
- Name
campaignId- Type
- string
- Description
The campaign that was sent.
- Name
status- Type
- string
- Description
Where the send stands:
scheduled: some guests are waiting forsendAt.sending: some guests' emails are being sent now.completed: no guest is waiting on this send.
Gatsby prepares a send's emails after it accepts the send. Until then, the send reads
scheduledorsending, even for guests Gatsby later blocks.
- Name
sendAt- Type
- string | null
- Description
When the send is set to go out, in ISO 8601 format in UTC. If the send is rescheduled in Gatsby, this is the new time.
nullfor a send that goes out right away.
- Name
createdAt- Type
- string
- Description
When the send was created, in ISO 8601 format.
- Name
counts- Type
- object
- Description
The send's guests by recipient status, as of this send. Only statuses with at least one guest are included. A guest waiting on the send is counted as
scheduledorpending. Guests a cancel took off the send are not counted. Neither are guests a later send reached before this one did.
List an event's campaigns
This endpoint returns the email campaigns of an event, newest first. Deleted campaigns and SMS campaigns are not included. The list is not paginated.
Use the counts on each campaign to see how many guests have not received it yet (counts.not_sent).
Errors
Returns 404 when the event does not exist.
Request
curl https://rest.gatsby.events/event/e8dj2ns9-34kd-9j3b/campaigns \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}"
Response
{
"campaigns": [
{
"campaignId": "c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607",
"name": "Investor day invitation",
"channel": "email",
"createdAt": "2026-11-02T17:45:12.000Z",
"counts": {
"not_sent": 12,
"scheduled": 0,
"pending": 0,
"sent": 140,
"opened": 86,
"failed": 0,
"bounced": 2,
"blocked": 1,
"unsubscribed": 0,
"cancelled": 0
}
}
]
}
List a campaign's recipients
This endpoint returns the event's guests with their status on the campaign, one row per recipient. Rows are listed in the order guests were added to the event, oldest first, so pages stay stable while you page through them. A guest with more than one entry on the campaign has more than one row.
Optional attributes
- Name
status- Type
- string
- Description
Return only rows with these recipient statuses. Repeat the parameter or separate values with commas, for example
status=not_sent,cancelled. Omit it to return every row.
- Name
limit- Type
- integer
- Description
The number of rows to return. Defaults to 25. Values above 100 return 100.
- Name
skip- Type
- integer
- Description
The number of rows to skip. Defaults to 0. See Pagination.
Response
- Name
recipients- Type
- array
- Description
The recipient rows on this page.
- Name
total- Type
- integer
- Description
The number of rows that match
status, across all pages.
- Name
limit- Type
- integer
- Description
The page size used.
- Name
skip- Type
- integer
- Description
The number of rows skipped.
Errors
Returns 404 when the event or campaign does not exist, or when the campaign belongs to another event. Returns 422 when status has an unknown value, or when limit or skip is not a number.
Request
curl -G https://rest.gatsby.events/event/e8dj2ns9-34kd-9j3b/campaigns/c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607/recipients \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}" \
-d status=not_sent,cancelled \
-d limit=50
Response
{
"recipients": [
{
"personId": "52907745-7672-470e-a8d1-1b2c3d4e5f60",
"email": "[email protected]",
"status": "not_sent",
"statusAt": null,
"reason": null
},
{
"personId": "8293b8f2-3019-42a8-b1c2-d3e4f5a6b7c8",
"email": "[email protected]",
"status": "cancelled",
"statusAt": "2026-12-01T16:20:05.000Z",
"reason": null
}
],
"total": 2,
"limit": 50,
"skip": 0
}
Send a campaign
This endpoint sends the campaign's saved email to the event's guests, now or at a time you choose. Choose the guests in one of two ways:
recipientStatus: "not_sent"sends to every guest with statusnot_sentorcancelled, the guests Gatsby lists under Not sent to. A guest the campaign was ever delivered to (sent,openedorbounced) is never included, and neither is a guest who is still waiting on a send. Guests whose last email failed or was blocked, and guests who unsubscribed, are not included either.personIdssends to the guests you list. Duplicate IDs count once. Some guests are skipped, as listed underskippedbelow.
The campaign must have a saved subject and message. If it sends from a linked Google or Outlook account, that connection must still be active.
Sends have their own rate limit of 10 requests per minute, with bursts of up to 5.
Attributes
Pass exactly one of personIds or recipientStatus.
- Name
personIds- Type
- array
- Description
Between 1 and 500 person IDs to send to. Duplicate IDs are sent to once.
- Name
recipientStatus- Type
- string
- Description
Must be
not_sent. Sends to every guest who has not received the campaign.
- Name
resend- Type
- boolean
- Description
Send to guests in
personIdseven if the campaign was already sent to them. Defaults tofalse. Can only be used withpersonIds. A guest still waiting on another send of this campaign is skipped even withresend.
- Name
sendAt- Type
- string
- Description
When to send, as an ISO 8601 date and time with a UTC offset, for example
2026-12-24T09:00:00-08:00or2026-12-24T17:00:00Z. Must be a real calendar date and time, so2027-02-31is refused. Must be in the future and no more than 365 days ahead. Omit it to send now.
Response
The status code tells you whether anything was sent:
202 Accepted: the send was created.sendIdidentifies it.200 OK: no guest qualified, so nothing was sent.sendId,statusandsendAtarenull. WithpersonIds,skippedsays why each person was skipped. WithrecipientStatus,skippedis always empty.
- Name
sendId- Type
- string | null
- Description
The new send's ID.
nullwhen nothing was sent.
- Name
campaignId- Type
- string
- Description
The campaign that was sent.
- Name
status- Type
- string | null
- Description
sendingfor a send that goes out now,scheduledfor a send withsendAt, ornullwhen nothing was sent.
- Name
sendAt- Type
- string | null
- Description
The time you passed in
sendAt, in UTC.nullfor a send that goes out now.
- Name
queued- Type
- array
- Description
The person IDs the send went to. Gatsby can still block a queued guest, for example one who has unsubscribed. List the recipients to see the outcome for each guest.
- Name
skipped- Type
- array
- Description
The person IDs from
personIdsthat were not sent to, each with areason:not_on_event: the person is not a guest of this event.already_queued: the guest is still waiting on another send of this campaign. This applies even withresend. When the skip has asendId, that is the send the guest is waiting on. Cancel it to send again. Without asendId, the guest is waiting on a send made in the Gatsby app, and you can only cancel it there.already_sent: the campaign was already sent to the guest. Passresend: trueto send again.
Errors
- Name
404 Not Found- Description
The event or campaign does not exist, the campaign is an SMS campaign or was deleted, or the campaign belongs to another event.
- Name
409 Conflict- Description
Another send or cancel of the same campaign is in progress. Sends and cancels of one campaign run one at a time. Retry after a few seconds. Also returned for some repeats of an
Idempotency-Key. See Safe retries.
- Name
422 Unprocessable Entity- Description
The body is invalid: both or neither of
personIdsandrecipientStatuswere passed,personIdsis empty or has more than 500 IDs,resendwas passed withrecipientStatus, or the body has an unknown field. Also returned whensendAthas no UTC offset, is not a real date and time, is in the past, or is more than 365 days ahead. Also returned when the campaign has no saved subject or message, when the campaign's linked Google or Outlook sender has expired (reconnect it in Gatsby, then retry), and forIdempotency-Keyerrors.
- Name
429 Too Many Requests- Description
You reached the send rate limit.
Request
curl -X POST https://rest.gatsby.events/event/e8dj2ns9-34kd-9j3b/campaigns/c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607/sends \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}" \
-H "Idempotency-Key: 6f1c0b52-investor-day-batch-1" \
-H "Content-Type: application/json" \
-d '{"recipientStatus":"not_sent"}'
202 response
{
"sendId": "0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21",
"campaignId": "c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607",
"status": "scheduled",
"sendAt": "2026-12-24T17:00:00.000Z",
"queued": ["52907745-7672-470e-a8d1-1b2c3d4e5f60"],
"skipped": []
}
200 response (nothing to send)
{
"sendId": null,
"campaignId": "c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607",
"status": null,
"sendAt": null,
"queued": [],
"skipped": [
{
"personId": "52907745-7672-470e-a8d1-1b2c3d4e5f60",
"reason": "already_sent"
},
{
"personId": "8293b8f2-3019-42a8-b1c2-d3e4f5a6b7c8",
"reason": "already_queued",
"sendId": "0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21"
}
]
}
Safe retries with Idempotency-Key
A network error can leave you unsure whether a send went through. To retry without sending the email twice, add an Idempotency-Key header to Send a campaign. Use any unique string of 1 to 255 characters, such as a UUID, and send the same key on every retry of the same request.
Gatsby keeps a 202 response for its key for 24 hours. Keys are scoped to your credential and organization, so they never collide with another caller's keys. With an API token (x-api-key), a key works for the full 24 hours. With an access token, a key is tied to that token, so a retry after the token is refreshed runs as a new request. Use an API token when you rely on retries.
- Name
Same key, same request, first returned 202- Description
Returns the first response again, with the same status code and body. Nothing new is sent.
- Name
Same key, first returned 200- Description
A
200(nothing to send) is not kept. A retry runs as a new request, so it sends to guests who qualify now.
- Name
Same key, first was refused before sending- Description
A refusal before anything was sent frees the key, for example an invalid body, no access, a campaign that was not found, another send in progress, or an expired sender connection. A retry runs as a new request.
- Name
Same key, first failed after sending began- Description
If the first request failed after the send began, the email may have gone out. That failure can be a
401, a422, a5xxor a timeout. For 24 hours, a retry returns409 Conflictand sends nothing. List the recipients to see who got the email, then send again with a new key if needed.
- Name
Same key, first request still running- Description
Returns
409 Conflict. Retry after a few seconds to get the first response.
- Name
Same key, different request- Description
Returns
422 Unprocessable Entity. A request is different when the event, campaign or body is different. The order of fields in the body does not matter.
A key that is empty or longer than 255 characters returns 422. Without the header, every request is a new send.
409 response (still running)
{
"message": "A request with this Idempotency-Key is still in progress. Retry shortly."
}
409 response (outcome unknown)
{
"message": "The first request with this Idempotency-Key failed after it may have sent. Check the campaign recipients (GET .../recipients) before sending again with a new key."
}
422 response
{
"message": "This Idempotency-Key was already used with a different request."
}
Retrieve a send
This endpoint returns a send with its guests counted by status. Use it to check whether a send has finished. For the status of each guest, list the recipients.
Right after you create a send, it can read scheduled or sending for a while, until Gatsby has prepared its emails.
Errors
Returns 404 when the event, campaign or send does not exist, when the send belongs to another campaign, or when a cancel took every guest off the send.
Request
curl https://rest.gatsby.events/event/e8dj2ns9-34kd-9j3b/campaigns/c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607/sends/0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21 \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}"
Response
{
"sendId": "0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21",
"campaignId": "c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607",
"status": "completed",
"sendAt": null,
"createdAt": "2026-12-03T18:02:44.000Z",
"counts": {
"sent": 10,
"opened": 1,
"blocked": 1
}
}
Cancel a send
This endpoint cancels the emails of a send that have not gone out yet. Each guest whose email is cancelled is taken off the send, the same as a cancel in the Gatsby app. A scheduled guest goes back to the status they had before the send, and a guest whose email was already being sent shows as not_sent. For a guest who never received the campaign, that is not_sent, so a later send with recipientStatus: "not_sent" includes them again.
Cancel cannot recall email that was already delivered. Those guests are counted in alreadySent and stay on the send. To stop a send from going out at all, schedule it with sendAt and cancel it before that time.
When the cancel takes every guest off the send, the send no longer exists. Retrieving or cancelling it again returns 404. When some guests stay on the send, cancelling again returns cancelled: 0.
Response
- Name
sendId- Type
- string
- Description
The send that was cancelled.
- Name
cancelled- Type
- integer
- Description
The number of guests whose email was still waiting and that this cancel took off the send.
- Name
alreadySent- Type
- integer
- Description
The number of guests this send already delivered to. Guests whose email failed or was blocked are in neither count, and neither are guests a later send reached first.
Errors
Returns 404 when the event, campaign or send does not exist, when the send belongs to another campaign, or when an earlier cancel took every guest off the send. Returns 409 when another send or cancel of the same campaign is in progress. Retry after a few seconds.
Request
curl -X DELETE https://rest.gatsby.events/event/e8dj2ns9-34kd-9j3b/campaigns/c4f1a2b3-5d6e-4f70-8a91-b2c3d4e5f607/sends/0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21 \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}"
Response
{
"sendId": "0b7e2f4c-1a3d-4e5f-9a8b-7c6d5e4f3a21",
"cancelled": 1,
"alreadySent": 0
}