Mailrelay API Reference

Create or update a subscriber

POST /subscribers/sync

Create or update a subscriber

This method can be used when you want to add a subscriber regardless if it already exists.

Similar to create action, you should provide a default status which will be used if subscriber doesn't exists.

There are two optional parameters that you can provide:

Parameters

NameTypeDescription
replace_groups boolean Set this to true if existing groups should be replaced when subscriber already exists.
replace_tags boolean Set this to true if existing tags should be replaced when subscriber already exists.
restore_if_deleted boolean Set this to true if deleted subscribers should be restored.
status string Initial status of the subscriber
email string Email
whatsapp_phone string WhatsApp phone
name string Name
address string Address
city string City
state string State
country string Country of the subscriber. The value should be in ISO 3166-1 alpha-2 format
birthday string Birthday
website string Website
locale string Locale
time_zone string Time zone
group_ids array An array of group IDs that this subscriber should be assigned to. Example: [1, 4, 5]

Responses

StatusDescription
200 Subscriber was updated or restored
201 Subscriber was created
400 The request is invalid. Check if the field names in the request and the request data is valid.
422 A validation error occurred. Check the response body for more information.
401 The API key wasn't sent or is invalid
500 An internal error happened. Try again later.