Consent And Privacy API Boundaries

Store profile data and reference-based consent evidence through the Subscriber API. Learn when evidence is required, which raw evidence to keep in your system, and how to use Mailrith-hosted 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, 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 custom_fields for profile data. Add Tags and enroll in Sequences through their separate Subscriber endpoints after the upsert.
  5. To make a Subscriber Active, set status to Active only after obtaining their consent, and send consent_evidence with lawful_basis, collected_at, and evidence_reference. You may also send consent_text_version, source_url, and a lowercase SHA-256 technical_evidence_hash.
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": "Unconfirmed",
    "custom_fields": {
      "cf_company": "Analytical Engines"
    }
  }'

Import Job Mappings

API import jobs use a short-lived browser upload plus mappings. The signed-in user chooses the CSV in Mailrith, while the connected app receives only its file name, column names, row count, and upload status.

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. Start an import upload and ask the signed-in user to open its short-lived link.
  2. After the user chooses a CSV with stable headers, wait until the upload reports ready.
  3. Map Email, Name, Country, Subscriber Status, and custom fields as needed.
  4. Add tags or sequences only when every imported Subscriber should receive them.
  5. Store Mailrith's returned job ID and poll the job status until it reaches a final state.
Import With Country And Status
# Start an upload and open data.upload_url for the signed-in user.
curl -X POST https://api.mailrith.com/v1/jobs/subscriber-import-uploads \
  -H "Authorization: Bearer mrk_example_secret_key"

# After the upload reports ready, map its returned headers:
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 '{
    "upload_id": "7a7283c5-c46e-4b70-bf57-b3385f8df983",
    "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, custom_fields, and create_only are supported upsert fields. Tags and Sequence enrollment use separate endpoints.

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.

Keep the full consent records in your own system, including when and how each Subscriber agreed to receive your emails. The Subscriber API stores only the consent_evidence reference fields and rejects raw consent text, IP address, and user-agent fields.

  • 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.