Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DataTalksClub/datamailer/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/subscriptions/subscribe is the fastest path to marking a contact as subscribed. It upserts the contact by normalized email, then calls subscribe_contact which sets status=subscribed and stamps verified_at=now on the client-scoped subscription. If you need finer control over subscription status, verified flag, or suppression fields on the same request, use the upsert endpoint (POST /api/contacts) instead.
Authentication
All requests must include a Bearer token issued for the target client.Request
Method and path:POST /api/subscriptions/subscribe
Content-Type: application/json
Body Parameters
The contact’s email address. Trimmed and validated before processing. The
contact is looked up and upserted by its normalized (lowercased) form.
Slug of the audience to subscribe the contact to. Must belong to the same
organization as the authenticated client.
Slug of the client making the request. Must match the authenticated client’s
own slug — cross-client writes are forbidden (HTTP 403).
Optional list of tag names to assign to the contact within this audience.
Each entry must be a non-empty string. Tags are audience-scoped and created
automatically if they do not already exist.
Behavior
Validate scope
Confirm that
email, audience, and client are present and that client
matches the authenticated token’s client slug.Upsert contact
Create the contact record if one does not already exist for the normalized
email address.
Subscribe
Call
subscribe_contact, which creates or updates the client-scoped
Subscription record with status=subscribed and stamps verified_at to
the current UTC time.Assign tags
For each name in
tags, look up or create the audience-scoped tag, then
create the ContactTag membership.Response
HTTP200 OK on success.
Internal ID of the contact record.
Normalized (lowercased) email address stored for this contact.
true when the contact has a subscription visible to the authenticated client.true when the contact or subscription has a non-null verified_at
timestamp.ISO 8601 timestamp of verification, or
null.true when the contact has a global marketing unsubscribe on record.true when the contact has a hard bounce on record.true when the contact has filed a spam complaint.true when the contact is eligible to receive marketing emails from this
client right now. Requires a verified subscription and no active suppression.true when the contact is not hard-bounced or complained, meaning
transactional sends are allowed.Sorted list of tag slugs assigned to this contact within the audience.