Zum Inhalt springen

Create a recipient

POST
/recipients
Code sample: Shell / cURL
curl --request POST \
--url https://rocketem.fotone.io/api/v2/recipients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "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" }'

Required scope: recipients:write

Creates a new recipient in the organisation’s database. Checks suppression list and GDPR deletion history before creating. Sets doi_status to ‘not_required’ by default.

A call with a consent_at of the last 24 hours counts as a signup: it starts the automations with the trigger “New subscriber”. Without consent_at, or with an older one, the row is stock handed over from your system and starts nothing. Feed stock in with POST /recipients/bulk.

doi_status: unsubscribed is an opt-out: the address goes the way of POST /recipients/unsubscribe (suppression list for the newsletter, the row’s status for an audience) and the profile is stored beside it; an address already suppressed is not refused but gets no profile row (201 with suppressed: true), an existing row still answers 409 (use POST /recipients/unsubscribe for it). An opt-out row needs the subscriptions:write scope. consent_at and consent_source state the consent given in your system (a takeover): they become the row’s proof and are logged as a migration dated as stated.

Idempotency-Key
string
<= 255 characters

Unique key for idempotent requests. Responses cached 24h.

Media typeapplication/json

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

Recipient created

Media typeapplication/json
object
data

A recipient of the list. PII fields (email, name, address, phone) are only included if the token has recipients:read_pii scope. The organisation’s custom fields (see GET /recipients/schema) are also included under their own names; they are always treated as PII. With audience the row comes from the audience table: no shop figures and no custom fields, but birthday, source and extra (the signup form’s own fields, JSON); birthday and extra need recipients:read_pii.

object
id
integer
email

Requires read_pii scope

string format: email
external_id
string
salutation

Requires read_pii scope

string
first_name

Requires read_pii scope

string
last_name

Requires read_pii scope

string
company

Requires read_pii scope

string
phone

Requires read_pii scope

string
title

Requires read_pii scope

string
address1

Requires read_pii scope

string
address2

Requires read_pii scope

string
city

Requires read_pii scope

string
zip

Requires read_pii scope

string
region

Requires read_pii scope

string
country_code

Requires read_pii scope

string
language
string
language_edited

1 when the language is a conscious recipient choice (preference center, or language_edited=true via PATCH). Plain API language writes no longer overwrite it.

integer
lifecycle_stage
string
total_revenue
number
order_count
integer
first_order_at
string format: date-time
last_order_at
string format: date-time
consent_at
string format: date-time
nullable
consent_source
string
nullable
doi_status
string
Allowed values: not_required pending confirmed unsubscribed cleaned transactional archived preference_only
doi_sent_at

When the DOI email was sent

string format: date-time
nullable
doi_confirmed_at

When the recipient confirmed the DOI

string format: date-time
nullable
sync_source
string
source
string
tags

JSON encoded

string
imported_at
string format: date-time
nullable
last_synced_at
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
tracking_consent

Only when tracking_consent was sent; failed = the recipient change was saved, the consent was not (send it again)

string
Allowed values: granted revoked unchanged failed

Example

{
"data": {
"doi_status": "not_required"
},
"tracking_consent": "granted"
}

Tracking_consent sent without the tracking_consent:write scope

Conflict — email exists, is suppressed, or was GDPR-deleted

Media typeapplication/json
object
error
object
code
string
message
string
status
integer

Example generated

{
"error": {
"code": "example",
"message": "example",
"status": 1
}
}

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
}
}

Organisation not configured for API access

Media typeapplication/json
object
error
object
code
string
message
string
status
integer

Example generated

{
"error": {
"code": "example",
"message": "example",
"status": 1
}
}