Consent And Privacy API Boundaries

The public Subscriber API stores profile and list-management data, not separate consent-evidence fields. This guide explains the API boundary, safe Subscriber upserts, imports, webhooks, and when to use Mailrith-hosted GDPR consent workflows.

9 min read

Single Subscriber Upserts

POST /v1/subscribers can create or update one Subscriber. This is the best API shape for one-person writes where your system is processing one person at a time.

At minimum, send email. Add profile fields, tags, sequences, custom fields, status, and subscription date only when your source system knows those values. Treat the API response as the saved record and keep Mailrith's returned Subscriber ID if your system needs to refer to the same person later.

When an upsert updates an existing Subscriber, empty or null optional values leave saved Subscriber details unchanged. This includes name, status, country, subscribed_on, and custom_fields. Send a filled-in value only when your system should replace the saved value. New Subscribers need a valid email, while Custom Fields can remain blank.

  1. Confirm the workspace API key belongs to the workspace where the Subscriber should live.
  2. Send email and any known Subscriber profile fields.
  3. Use status only when the source system is authoritative for the Subscriber's list state.
  4. Use existing_tag_ids, new_tags, sequence_ids, and custom_fields when your integration owns that mapping.
  5. Do not send consent-evidence fields that are not listed in the OpenAPI schema.
Upsert Subscriber
curl -X POST https://api.mailrith.com/v1/subscribers \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "name": "Ada Lovelace",
    "status": "Active",
    "new_tags": ["Website Signup"],
    "custom_fields": {
      "cf_company": "Analytical Engines"
    }
  }'

Import Job Mappings

API import jobs use CSV text plus mappings. Map the columns that identify the Subscriber, then optionally map country, Subscriber status, and custom fields.

When an import row updates an existing Subscriber, blank mapped custom-field cells leave saved custom-field values unchanged. New Subscribers can leave Custom Fields blank.

Keep your source-list review in your own migration or CRM process before you queue the import.

When you have consent proof for a Subscriber in another system, keep that proof in the source system or migrate it into tags and ordinary Subscriber fields your workspace can use.

  1. Upload or generate CSV text with stable headers.
  2. Map Email, Name, Country, Subscriber Status, and custom fields as needed.
  3. Add tags or sequences only when every imported Subscriber should receive them.
  4. Store Mailrith's returned job ID and poll the job status until it reaches a final state.
Import With Country And Status
curl -X POST https://api.mailrith.com/v1/jobs/subscriber-imports \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Idempotency-Key: import-2026-04-11" \
  -H "Content-Type: application/json" \
  -d '{
    "csv_text": "Email,Name,Country,Subscriber Status\nada@example.com,Ada Lovelace,DE,Active",
    "mappings": [
      { "csv_column": "Email", "field": { "type": "email" } },
      { "csv_column": "Name", "field": { "type": "name" } },
      { "csv_column": "Country", "field": { "type": "country" } },
      { "csv_column": "Subscriber Status", "field": { "type": "subscriber-status" } }
    ],
    "new_tag_name": "Website Signup"
  }'

Accepted Subscriber Fields

Use the generated OpenAPI document as the exact contract. The notes below explain the common Subscriber fields in normal integrations.

email is the identity field for Subscriber upserts.

name, status, country, subscribed_on, existing_tag_ids, new_tags, sequence_ids, and custom_fields are the main optional write fields.

country can be sent as a country name or country code. Mailrith returns the saved two-letter country code.

Empty or null optional values in an update mean no change for that saved field. This includes profile fields such as name, status, country, and subscribed_on, plus custom_fields. Send a non-empty value when your integration should replace a saved value.

create_only returns a conflict instead of updating an existing Subscriber with the same email address.

Consent-evidence fields such as lawful basis, consent text, collection time, source URL, IP address, and user agent are not accepted by the public Subscriber API.

  • Do not send fields that are not in the OpenAPI schema.
  • Do not use tags as proof unless your team has a clear tagging policy and source records outside Mailrith.
  • Do not overwrite Subscriber status from a source system unless that system is allowed to control sending eligibility.
  • Do not log full request bodies in integration logs unless you have a clear retention and access policy for personal data.

Need Help Shipping an Integration?

Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.

Contact Mailrith

On this page

Jump to the section you need.