Send DOI email
curl --request POST \ --url https://rocketem.fotone.io/api/v2/recipients/doi \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "audience": "aud_xxxxxxxxxxxx", "email": "hello@example.com", "language": "example", "first_name": "example", "last_name": "example", "salutation": "example", "company": "example", "tracking_consent": true, "tracking_consent_text_version": "example" }'Required scope: recipients:write
Start the Double Opt-In process for an email. Creates the recipient with
doi_status: pending if new, resends the DOI email if already pending, and
sends an “already subscribed” mail (preference-center link, no DOI) if the
address is confirmed or not_required. An address that unsubscribed earlier
(reason unsubscribe, shop_unsubscribe, legacy_unsubscribe or complaint)
gets a fresh DOI mail; only the click lifts the block.
Every call is recorded in the organisation’s consent log (channel api_doi,
the token label as actor; no IP, the caller is a server).
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Header Parameters
Abschnitt betitelt „Header Parameters“Unique key for idempotent requests. Responses cached 24h.
Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“object
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.
Example
aud_xxxxxxxxxxxxLanguage for DOI email (default: org default)
Tracking consent (opens/clicks) from your own signup form. Needs the scope
tracking_consent:write (without it the call answers 403). Only used while the
organisation requires consent; it takes effect when the DOI link is clicked, and the DOI
email names it. Omitted or false clears a tick of an earlier request.
Identifier of the consent wording shown in your form (stored as api:<value>; without it the proof records that your own form’s wording was used).
Responses
Abschnitt betitelt „Responses“DOI process started
object
object
The status after the call: pending after a DOI mail, the real status of an address that is already subscribed (confirmed, not_required), the unchanged status or null with skipped_rate_limit
doi_sent = new or re-signup after an opt-out, doi_resent = was pending, already_subscribed = “already subscribed” mail instead of a DOI, skipped_rate_limit = fourth mail to this address within 24 h, nothing sent
The doi_status before the call, new for an unknown address, none for a row without status
Example
{ "data": { "outcome": "doi_sent" }}signup_closed: the Custom Audience named by audience has its signup closed (since 2.3.0; the newsletter takes API signups regardless). forbidden: tracking_consent sent without the tracking_consent:write scope
Email is suppressed (legal, block_all, robinson, manual, bounce, without reason) or GDPR-deleted
Validation failed
object
object
object
Example
{ "error": { "code": "validation_error", "message": "The given data was invalid.", "status": 422 }}