Contacts are team-global (one per email per team, case-insensitive) and addressable by id or email — email wins when both are given.
MillionSend.Contacts.create(%{email: "ada@acme.dev", first_name: "Ada"})
MillionSend.Contacts.get(%{email: "ada@acme.dev"})
MillionSend.Contacts.get("contact-uuid")
MillionSend.Contacts.update(%{id: id, unsubscribed: true, first_name: nil}) # nil clears
Summary
Functions
POST /contacts. A duplicate email (per team, case-insensitive) is a 409
validation_error.
GET /contacts/:id_or_email — by id/email map or a bare id string.
GET /contacts — accepts limit:, after:, before:.
DELETE /contacts/:id_or_email — by id/email map or a bare id string.
PATCH /contacts/:id_or_email. Include a key with nil to clear it; omit to leave unchanged.
PATCH /contacts/:id_or_email/topics — set per-topic subscriptions. params
carries the address plus topics: as a list of
%{id: ..., subscription: :opt_in | :opt_out}.
Types
Functions
@spec create(MillionSend.Client.t(), map()) :: {:ok, MillionSend.Contacts.Contact.t()} | {:error, MillionSend.Error.t()}
POST /contacts. A duplicate email (per team, case-insensitive) is a 409
validation_error.
@spec get(MillionSend.Client.t(), address()) :: {:ok, MillionSend.Contacts.Contact.t()} | {:error, MillionSend.Error.t()}
GET /contacts/:id_or_email — by id/email map or a bare id string.
GET /contacts — accepts limit:, after:, before:.
@spec list(MillionSend.Client.t() | keyword()) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}
@spec list( MillionSend.Client.t(), keyword() ) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}
@spec remove(MillionSend.Client.t(), address()) :: {:ok, MillionSend.Contacts.Contact.t()} | {:error, MillionSend.Error.t()}
DELETE /contacts/:id_or_email — by id/email map or a bare id string.
@spec update(MillionSend.Client.t(), map()) :: {:ok, MillionSend.Contacts.Contact.t()} | {:error, MillionSend.Error.t()}
PATCH /contacts/:id_or_email. Include a key with nil to clear it; omit to leave unchanged.
@spec update_topics(MillionSend.Client.t(), map()) :: {:ok, MillionSend.Contacts.Contact.t()} | {:error, MillionSend.Error.t()}
PATCH /contacts/:id_or_email/topics — set per-topic subscriptions. params
carries the address plus topics: as a list of
%{id: ..., subscription: :opt_in | :opt_out}.