Recipients
This page provides you information about how to manage recipients (subscribe, unsubscribe, update personal data).
On this page:
- 1.1 New to MailUp?
- 2 Manage a single email recipient / subscriber
- 2.1 Add a single recipient / subscriber - synchronous import
- 2.2 Update personal data fields of a subscriber
- 2.3 Update subscription status of a recipient
- 2.4 Update group assignment
- 2.4.1 EMAIL - Also subscribes to the MailUp list the group belongs to (confirmSubscription=true by default)
- 2.4.2 SMS - Also subscribes to the MailUp list the group belongs to (confirmSubscription=true by default)
- 2.4.3 EMAIL - Assigns to group without changing subscription status
- 2.4.4 SMS - Assigns to group without changing subscription status
- 2.5 Check if a subscriber exists
- 2.6 Known restriction
- 3 Manage multiple recipients
- 4 Read import information
- 5 Read personal data fields configuration
- 6 Retrieve all subscribed/unsubscribed/pending recipients from a list
- 7 Retrieve recipients by ID, email or mobile number
- 7.1 Array format
- 8 Retrieve recipients that belong to a group
- 9 Manage recipient subscription status
New to MailUp?
Confused with MailUp terminology? Please take a moment to review the Definitions and Recipients Management sections.
A few definitions and important notes:
Email Recipient: The person whose email address - and optionally other data - is added to MailUp.
Email Recipient Status: A recipient's status may be subscribed, not subscribed, unsubscribed, or pending (i.e. pending subscription confirmation). A MailUp account can contain multiple Lists (e.g. "Monthly Newsletter", "Daily Specials", etc.). Status is List-specific.
Email Subscriber: An email recipient whose status is "Subscribed"
Subscription management is List-specific: Since Status is List-specific, the action to subscribe/unsubscribe is also list-specific. To subscribe/unsubscribe to/from multiple Lists you have to perform one subscribe/unsubscribe action for each target List.
COI (Confirmed Optin, also known as double opt-in): A confirmed opt-in subscription process - a best practice in email marketing - is enforced only when explicitly requested via the ConfirmEmail parameter. When COI is enabled, a subscription request message is sent automatically. The content of that message can be found - and fully customized - in the list settings of your MailUp admin console.
Remove VS unsubscribe: unsubscription is usually the preferred choice. It means you keep track that the recipient did an opt-out request. Removal means you want to fully delete a subscriber
Manage a single email recipient / subscriber
Add a single recipient / subscriber - synchronous import
A single recipient can be added to a console account by calling the following methods:
POST /Console/List/{id_List}/Recipient
POST /Console/Group/{id_Group}/Recipient
You can choose to perform a double optin procedure for the given recipient by adding the querystring parameter "ConfirmEmail=true": in this case the recipient will be added to the given list/group in "Pending" status, and a confirmation email will be sent to that address, waiting for his/her confirmation. You can also update the information and status of an existing recipient by specifying his/her email address or mobile number as unique identifier of the existing recipient.
Description | Retrieve recipient dynamic field definitions. |
|---|---|
HTTP Method | POST |
URL | You can add a new recipient to a Console account, adding it to a specific List or a specific Group, by calling the following methods: POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/RecipientIf you add a recipient to a group, automatically it will be added to the list related to that group. POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/RecipientTo enable Confirmed Opt-In (COI) the querystring parameter ConfirmEmail must be set to true POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Recipient?ConfirmEmail=true
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Recipient?ConfirmEmail=true |
JSON request (example) | Email is mandatory, mobile number is optional. Personal data fields are updated in any case, regardless the previous subscription status (if any). {
"Fields":[{
"Description":"name",
"Id":1,
"Value":"test"
}],
"Name":"String content",
"Email":"test@example.com",
"MobileNumber":"",
"MobilePrefix":""
} |
JSON response (example) | Recipient ID is returned (e.g. 77) |
Paging and filtering (example) | none |
Update personal data fields of a subscriber
This section refers to changes to a specific subscriber's personal data field (the subscriber must already exist)
The update operation requires:
Recipient ID, which can be retrieved with the operation listed above (Check if a subscriber exists)
The IDs of the fields to be updated
Description | Retrieve recipient dynamic field definitions. |
|---|---|
HTTP Method | PUT |
URL | https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Recipient/Detail |
JSON request (example) | Modifying the "Region" field (whose Id is 8) for the recipient with ID = 23 {
"Email":"test25@example.com",
"Fields":[{
"Description":"Region",
"Id":8,
"Value":"England"
}],
"Name":"Test",
"idRecipient":23
} |
JSON response (example) | {"IsPaginated":false,"Items":[{"Email":"test25@example.com","Fields":[{"Description":"FirstName","Id":1,"Value":""},{"Description":"LastName","Id":2,"Value":""},{"Description":"Company","Id":3,"Value":""},{"Description":"City","Id":4,"Value":""},{"Description":"Province","Id":5,"Value":""},{"Description":"ZIP","Id":6,"Value":""},{"Description":"State","Id":7,"Value":""},{"Description":"Region","Id":8,"Value":"Italy"},{"Description":"Address","Id":9,"Value":""},{"Description":"Gender ","Id":10,"Value":""},{"Description":"phone","Id":11,"Value":""},{"Description":"CustomerID","Id":12,"Value":""},{"Description":"LatestOrderID","Id":13,"Value":""},{"Description":"LatestOrderDate","Id":14,"Value":""},{"Description":"LatestOrderAmount","Id":15,"Value":""},{"Description":"LatestOrderProductIDs","Id":16,"Value":""},{"Description":"LatestOrderCategoryIDs","Id":17,"Value":""},{"Description":"LatestShippedOrderDate","Id":18,"Value":""},{"Description":"LatestShippedOrderID","Id":19,"Value":""},{"Description":"LatestAbandonedCartDate","Id":20,"Value":""},{"Description":"LatestAbandonedCartTotal","Id":21,"Value":""},{"Description":"LatestAbandonedCartID","Id":22,"Value":""},{"Description":"TotalOrdered","Id":23,"Value":""},{"Description":"TotalOrderedLast12m","Id":24,"Value":""},{"Description":"TotalOrderedLast30d","Id":25,"Value":""},{"Description":"AllOrderedProductIDs","Id":26,"Value":""}],"MobileNumber":null,"MobilePrefix":null,"Name":null,"idRecipient":23}],"PageNumber":0,"PageSize":20,"Skipped":0,"TotalElementsCount":1} |
Paging and filtering (example) | none |
Update subscription status of a recipient
You can change the subscription status of an existing recipient in a specified List. To update multiple recipients at the same time, see Manage multiple recipients below.
Update operation requires
Recipient ID (refer to section "Check if a subscriber exists")
List ID
POST operation described in this section has been designed only to extend subscription to another list (e.g. recipient with ID=21 is already subscribed to list 1 and I want to add it also to list 2 -> POST /Console/List/2/Subscribe/21).
The function here described cannot be used to force subscription of unsubscribed recipients: the only way to subscribe again an unsubscribed recipient is to import it with doubleoptin (i.e. imported as pending with confirmation request email e.g. POST /Console/List/2/Recipient?ConfirmEmail=true)
Description | Add/remove the recipient with the related id in the List specified. |
|---|---|
HTTP Method | POST/DELETE |
URL | Subscribe POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Subscribe/{id_Recipient}SMSPOST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Sms/List/{id_List}/Subscribe/{id_Recipient}Unsubscribe DELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Unsubscribe/{id_Recipient}SMSDELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Sms/List/{id_List}/Unsubscribe/{id_Recipient} |
JSON request (example) | none |
JSON response (example) | none |
Paging and filtering (example) | none |
Update group assignment
A group in MailUp is a subset of a list. Subscribe/unsubscribe is at the list level, not at the group level. Groups are typically used for segmentation purposes within a list.
You can use the API to assign or remove an existing recipient to/from a specified group. Removing a recipient from a group does not affect its list subscription status.
Update operation requires
Recipient ID (see section "Check if a subscriber exists")
Group ID
Description | Add/remove the recipient with the related id to the specified group |
|---|---|
HTTP Method | POST/DELETE |
URL | Add EMAIL - Also subscribes to the MailUp list the group belongs to (confirmSubscription=true by default)POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Subscribe/{id_Recipient}SMS - Also subscribes to the MailUp list the group belongs to (confirmSubscription=true by default)POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/SMS/Group/{id_Group}/Subscribe/{id_Recipient}EMAIL - Assigns to group without changing subscription statusPOST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Subscribe/{id_Recipient}?confirmSubscription=falseSMS - Assigns to group without changing subscription statusPOST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/SMS/Group/{id_Group}/Subscribe/{id_Recipient}?confirmSubscription=falseRemove from a group DELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Unsubscribe/{id_Recipient} |
JSON request (example) | none |
JSON response (example) | none |
Paging and filtering (example) | none |
Check if a subscriber exists
This method allows you to:
verify whether a certain recipient is already a subscriber in a certain list within a specified MailUp account
retrieve the recipientID and personal data fields for that recipient, if it is found
Known restriction
At this time unfortunately the REST API does not include a method to search a recipient by email address regardless the subscription status, within a specific list. To accomplish that at the moment you will need to do one of the following:
run the same search three times for subscribed, unsubscribed and finally pending recipients.
access to EmailOptins resource filtering by Status (requires the Recipient ID instead of the email address)
Description | Check subscriber and retreive data |
|---|---|
HTTP Method | GET |
URL | see example in the "paging and filtering" row |
JSON request (example) | none |
JSON response (example) | when the specified recipient belongs to listsuscribersthe response contains the personal data fields of the recipient {"IsPaginated":false,"Items":[{"Email":"peter@example.com","Fields":[{"Description":"FirstName","Id":1,"Value":""},{"Description":"LastName","Id":2,"Value":""},{"Description":"Company","Id":3,"Value":""},{"Description":"City","Id":4,"Value":""},{"Description":"Province","Id":5,"Value":""},{"Description":"ZIP","Id":6,"Value":""},{"Description":"State","Id":7,"Value":""},{"Description":"Region","Id":8,"Value":""},{"Description":"Address","Id":9,"Value":""},{"Description":"Gender ","Id":10,"Value":""},{"Description":"phone","Id":11,"Value":""},{"Description":"CustomerID","Id":12,"Value":""},{"Description":"LatestOrderID","Id":13,"Value":""},{"Description":"LatestOrderDate","Id":14,"Value":""},{"Description":"LatestOrderAmount","Id":15,"Value":""},{"Description":"LatestOrderProductIDs","Id":16,"Value":""},{"Description":"LatestOrderCategoryIDs","Id":17,"Value":""},{"Description":"LatestShippedOrderDate","Id":18,"Value":""},{"Description":"LatestShippedOrderID","Id":19,"Value":""},{"Description":"LatestAbandonedCartDate","Id":20,"Value":""},{"Description":"LatestAbandonedCartTotal","Id":21,"Value":""},{"Description":"LatestAbandonedCartID","Id":22,"Value":""},{"Description":"TotalOrdered","Id":23,"Value":""},{"Description":"TotalOrderedLast12m","Id":24,"Value":""},{"Description":"TotalOrderedLast30d","Id":25,"Value":""},{"Description":"AllOrderedProductIDs","Id":26,"Value":""}],"MobileNumber":null,"MobilePrefix":null,"Name":null,"idRecipient":13}],"PageNumber":0,"PageSize":20,"Skipped":0,"TotalElementsCount":1}when the specified recipient does not belong to list subscribers (i.e. it may be not existing but also unsubscribed or subscribed only to other MailUp lists for that console account) an empty list is returned {"IsPaginated":false,"Items":[],"PageNumber":0,"PageSize":20,"Skipped":0,"TotalElementsCount":0} |
Paging and filtering (example) |
Manage multiple recipients
If you need to subscribe or unsubscribe multiple recipients it is strongly recommended to use an asynchronous method instead of calling many times the single import method. The Confimed Opt-in subscription method is availble in this mode by performing a few different API calls, as described below (see Send confirmation email).
Subscribe/unsubscribe recipients - asynchronous import
Asynchronous import is used to perform a bulk import of several recipients into the specified list. Since the process is not synchronous, it is fast and it immediately returns an import ID (without waiting for the end of the import process), but it's not real time and there cannot be two or more imports at the same time with a single MailUp account. A HTTP 500 error with description="Resource internal error. Another import is running" is returned when you try to do more import at the same time. Please check the import status in order to know whether the import task has been completed.
In case of bulk import, the upper limit for parameter size is configured to support an upload size that is about 7MB for each call. This limit approximately corresponds to 5,000 recipients with 27 personal data fields (upload time = 300s) or 50,000 recipients with only email field (upload time = 370s). In any case, we recommend to set a configurable upload size limit in your application and make a test with this size. When upload size exceeds this limit you can split the list of recipients in more blocks and perform more requests. When more import requests are pending, MailUp processes them in a sequential order.
The import process is able to recognize existing recipients (using the email address or the mobile number as unique identifiers), and update them according to the given input details. It is possible to add somequerystringparameters to specify some advanced behavior for the import process:
ConfirmEmail=true: if specified, sets the new recipients status to "Pending", and a confirmation email is generated (but not yet sent). Please check below in the section "Send Confirmation Email" the procedure to actually send the emails generated so far.
importType=asOptout: if specified, the given recipients' status is set to "Optout", except for the ones already in “Pending” Status. A complete explanation of the available scenarios is provided below.
clearMissingOrEmptyFields: when set to "true", the import process clears on MailUp field that is not specified or set as empty in the request body.
removeFromPrevGroups: when set to "true", first the import process removes the given recipients from any group they have been part of, then it adds them only to the group specified along with this request. This querystring parameter applies only to "Import recipients into a group" cases.
ignoreMobile: (RECOMMENDED if you are not going to send SMS) when set to "true", the import process ignores the MobileNumber and MobilePrefix fields. As multi-channel import is much slower than single-channel import (up to 60 times), you should avoid importing on both channels when it is not mandatory for your business goals.
fileName: accepts a recipients' list in a file format instead of passing it through the request body. This option is recommended when uploading a large amount of data with a single call (e.g. more than 10K recipients). Please refer to the second of the links below for more details
Description | Create and execute a task that imports specified recipients. Import task ID is returned |
|---|---|
HTTP Method | POST |
URL | Import recipients into a list https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/RecipientsImport recipients into a group (a group always belongs to a single list) https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{ID_GROUP}/Recipients |
JSON request (example) | The example below imports two recipients. The first is subscribed to both email and SMS (Mobile) channels,while the second is subscribed only to email channel. For each recipient to be imported you may specify a different set of "Fields" values in a random order. Please note that field "description" field is optional. In this example the default values for English version are used, therefore names in your console account can be different than what you see below. "Name" field is mandatory but it is not accessible with MailUp console account (you can leave it empty) [{"Email":"john@doe.uk",
"Fields":[{"Description":"FirstName","Id":1,"Value":"John"},
{"Description":"Province","Id":5,"Value":"East Midlands"},
{"Description":"LastName","Id":2,"Value":"Doe"},
{"Description":"TotalOrdered","Id":23,"Value":"2000"},
{"Description":"Company","Id":3,"Value":"Main Ltd"}],
"MobileNumber":"9874561153","MobilePrefix":"0044","Name":""},
{"Email":"mary@poppins.uk",
"Fields":[{"Description":"FirstName","Id":1,"Value":"Mary"},
{"Id":3,"Value":"Baby sitter"},
{"Id":4,"Value":"London"}],
"Name":""}] |
JSON response (example) | 3 (import ID, a progressive number) |
Paging and filtering (example) | none |
Send Confirmation Email
The confirmation emails (generated in the bulk import process as the result of "ConfirmEmail=true"querystring parameter) can be sentwith the following process;
Retrieve the SendingID of that confirmation email, with the following call, where {id_import} is the result of the current import call. The result of this GET call is a structure with the SendingID (idImport) and the number of generated emails (EnqueuedEmails).
GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Import/{id_import}/SendingSend the email immediately or planning a schedule by calling one of these methods where {id_sending} is the SendingID retrieved at previousstep, with no body. Moreover a body like {Date:'yyyy-MM-dd HH:mm'} is required: for the "Deferred" case. NOTE: the specified date must be in UTC and at least 5 minutes in the future, with the format described in the section 'Type and cast definition' of "Paging and filtering" page
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Sendings/{id_sending}/Immediate
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Sendings/{id_sending}/DeferredRead import information
As stated above, bulk import tasks are asynchronous. Since you can run only one import task a time, it is important to check if there is a running process before starting a new one.
This section contains a method to query the status of a process by specifying its ID, a method to get a list of import tasks and a method to get all the details of a completed import.
Read Import Status
Description | Read status of an import task by specifying its ID. List ID is not required. |
|---|---|
HTTP Method | GET |
URL | https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Import/{IMPORT_ID} |
JSON request (example) | none |
JSON response (example) | {"Completed":true,"CreatedRecipients":1,"ImportedRecipients":0,"NotValidRecipients":0,"UpdatedRecipients":0,"ValidRecipients":1,"idImport":3} |
Paging and filtering (example) | none |
Get import status codes
Description | Retrieve the status codes of import tasks |
|---|---|
HTTP Method | GET |
URL | https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Imports/StatusCodes |
JSON request (example) | none |
JSON response (example) | [
{
"ImportStatusCode": 1,
"ImportStatusName": "ToBeExecuted"
},
{
"ImportStatusCode": 2,
"ImportStatusName": "InProgress"
},
{
"ImportStatusCode": 3,
"ImportStatusName": "Completed"
},
{
"ImportStatusCode": 4,
"ImportStatusName": "Failed"
}
] |
Paging and filtering (example) | None |
Get list of import tasks
Description | Retrieve the list of all the import tasks |
|---|