Zum Inhalt springen

Bulk create/update recipients

POST
/recipients/bulk
Code sample: Shell / cURL
curl --request POST \
--url https://rocketem.fotone.io/api/v2/recipients/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "audience": "aud_xxxxxxxxxxxx", "recipients": [ { "audience": "aud_xxxxxxxxxxxx", "email": "hello@example.com", "tracking_consent": true, "tracking_consent_at": "2026-04-15T12:00:00Z", "external_id": "example", "salutation": "example", "first_name": "example", "last_name": "example", "company": "example", "title": "example", "phone": "example", "street": "example", "address2": "example", "zip": "example", "city": "example", "region": "example", "country": "example", "birthday": "2026-04-15", "language": "example", "total_revenue": 1, "order_count": 1, "first_order_date": "2026-04-15", "last_order_date": "2026-04-15", "doi_status": "not_required", "consent_at": "2026-04-15T12:00:00Z", "consent_source": "example" } ], "dry_run": false, "history": false }'

Required scope: recipients:write

Asynchronously creates or updates up to 1000 recipients. Returns a job ID for tracking progress via GET /jobs/{id}. Suppressed emails are skipped.

Per row: doi_status names the status of a new row (an existing row keeps its own); unsubscribed is an opt-out that always applies, goes the way of POST /recipients/unsubscribe (scope subscriptions:write, 403 before anything is queued) and is never skipped as “suppressed”; history: true marks the rows as taken over from another system: an opt-out row then starts no automation and is written back to no shop; consent_at / consent_source become the row’s proof and are logged as a migration; birthday as in the single POST. The job’s result lists {"type": "unsubscribed", "count": n} among its notes.

Supports dry_run=true: synchronously classifies each submitted recipient into would_create / would_update / would_skip_suppressed / would_skip_gdpr_deleted / would_skip_undeliverable without dispatching a job, creating a BulkJob row, or consuming the daily create cap.

Idempotency-Key
string
<= 255 characters

Unique key for idempotent requests. Responses cached 24h.

Media typeapplication/json
object
audience

The audience to work on, by its identifier (aud_ plus 12 characters): in the app under Settings > Preference Center > General (and Settings > API with Custom Audiences on), or as id in GET /audiences. The first audience’s identifier, or none, addresses the newsletter. A Custom Audience’s table has no shop figures (total_revenue, order_count, first_order_date, last_order_date: 422); the organisation’s custom fields exist there too (since 2.3.0); its doi_status is one of pending, confirmed, not_required, unsubscribed, cleaned. A newsletter opt-out does not block an audience; complaints, bounces and legal blocks do.

string
/^aud_[A-Za-z0-9]{12}$/

Example

aud_xxxxxxxxxxxx
recipients
required
Array<object>
<= 1000 items

In addition to the fields below, the organisation’s custom fields (discover via GET /recipients/schema) are accepted under their own names, validated by their column type.

object
audience

The audience to work on, by its identifier (aud_ plus 12 characters): in the app under Settings > Preference Center > General (and Settings > API with Custom Audiences on), or as id in GET /audiences. The first audience’s identifier, or none, addresses the newsletter. A Custom Audience’s table has no shop figures (total_revenue, order_count, first_order_date, last_order_date: 422); the organisation’s custom fields exist there too (since 2.3.0); its doi_status is one of pending, confirmed, not_required, unsubscribed, cleaned. A newsletter opt-out does not block an audience; complaints, bounces and legal blocks do.

string
/^aud_[A-Za-z0-9]{12}$/

Example

aud_xxxxxxxxxxxx
email
required
string format: email
<= 255 characters
tracking_consent

Tracking consent (opens/clicks) from your system; needs tracking_consent:write. Same rules as a file import: without tracking_consent_at it never changes a stored decision; false only withdraws an older consent; a withdrawal the person made in rocketEM is never lifted. For single withdrawals use PUT /recipients/tracking-consent.

boolean
tracking_consent_at

When the person decided in your system (not in the future)

string format: date-time
external_id
string
<= 100 characters
salutation
string
<= 20 characters
first_name
string
<= 100 characters
last_name
string
<= 100 characters
company
string
<= 255 characters
title
string
<= 50 characters
phone
string
<= 50 characters
street

Mapped to address1

string
<= 255 characters
address2
string
<= 255 characters
zip
string
<= 20 characters
city
string
<= 100 characters
region
string
<= 100 characters
country

2-letter ISO code, mapped to country_code

string
<= 2 characters
birthday
string format: date
language
string
<= 2 characters
total_revenue
number
order_count
integer
first_order_date

Mapped to first_order_at

string format: date
last_order_date

Mapped to last_order_at

string format: date
doi_status

The neutral preference_only status is read-only (set by the preference center) and not accepted here. unsubscribed is an opt-out (suppression list or audience row, like POST /recipients/unsubscribe); also per row in POST /recipients/bulk.

string
default: not_required
Allowed values: not_required pending confirmed unsubscribed cleaned transactional archived
consent_at

When the person consented in your system (not in the future); the row’s consent date, logged as a migration. Only with a mailable status (not_required, confirmed).

string format: date-time
consent_source

Where that consent was given (e.g. shop_signup); stored as api:<source>. Without consent_at it is ignored.

string
<= 80 characters
dry_run

Preview only — no job dispatched, no cap consumed

boolean
history

The rows are history from another system: an opt-out row starts no automation and goes to no shop

boolean

Dry-run classification of what would be created/updated/skipped (only when dry_run=true)

Media typeapplication/json
object
data
object
dry_run
boolean
submitted
integer
would_create
integer
would_update
integer
would_skip_suppressed
integer
would_skip_gdpr_deleted
integer
would_skip_undeliverable

Rows at a domain that receives no mail (example.com, .test, IP literal …)

integer
would_unsubscribe

Rows with doi_status unsubscribed

integer
daily_cap_remaining

Remaining create cap for today (read-only — not decremented by dry_run)

integer

Example generated

{
"data": {
"dry_run": true,
"submitted": 1,
"would_create": 1,
"would_update": 1,
"would_skip_suppressed": 1,
"would_skip_gdpr_deleted": 1,
"would_skip_undeliverable": 1,
"would_unsubscribe": 1,
"daily_cap_remaining": 1
}
}

Bulk job accepted (only when dry_run=false)

Media typeapplication/json
object
data
object
job_id
string format: uuid
dry_run
boolean
accepted

Number of recipients queued for processing

integer
rejected

Present only when the daily create cap truncated the batch

integer
reason

Present only when rejected > 0 — human-readable cause

string

Example generated

{
"data": {
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"dry_run": true,
"accepted": 1,
"rejected": 1,
"reason": "example"
}
}

Validation failed

Media typeapplication/json
object
error
object
code
string
message
string
status
integer
details
object
key
additional properties
Array<string>

Example

{
"error": {
"code": "validation_error",
"message": "The given data was invalid.",
"status": 422
}
}