Recipients

Recipients

This page provides you information about how to manage recipients (subscribe, unsubscribe, update personal data).

On this page:

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. 

Based on the existing status, if available, and the ConfirmEmail parameter, the following scenarios hold true:

Use case

ConfirmEmail

Action

Description

Use case

ConfirmEmail

Action

Description

NEW - Brand new recipient for specified list*

false

added and subscribed

not existing in any list of that account

NEW - Brand new recipient for specified list*

true

added as "pending", request confirmation email is sent

recipient becomes "subscribed" after clicking on confirmation link received by email

OPTIN - Recipient is already subscribedonthat list

false

no change on subscription status (subscribed)



OPTIN - Recipient is already subscribedonthat list

true

no change on subscription status (subscribed)



PENDING - Recipient is already present as pending on specified list

false

no change on subscription status (pending)



PENDING - Recipient is already present as pending on specified list

true

remains pending, confirmation request email is sent

recipient becomes "subscribed" after clicking on confirmation link received by email

OPTOUT- Recipient is already present as unsubscribed on specified list

false

no change on subscription status (unsubscribed)



OPTOUT- Recipient is already present as unsubscribed on specified list

true

moved to pending status, confirmation request email is sent

recipient becomes "subscribed" after clicking on confirmation link received by email

*Usually it does not matter if recipient is already subscribed/unsubscribed on another list, but be aware that a "key mismatch" may occur if recipient is already registered with a different phone number.In this casethe request is denied and no action applies

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}/Recipient

If 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}/Recipient

To 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

Email
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Subscribe/{id_Recipient}
SMS
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Sms/List/{id_List}/Subscribe/{id_Recipient}



Unsubscribe

Email
DELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Unsubscribe/{id_Recipient}
SMS
DELETE 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 status
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Subscribe/{id_Recipient}?confirmSubscription=false
SMS - Assigns to group without changing subscription status
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/SMS/Group/{id_Group}/Subscribe/{id_Recipient}?confirmSubscription=false



Remove 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

https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Recipients/Subscribed?filterby="Email=='{Email}'"

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)

https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/3/Recipients/Subscribed?filterby="Email==%27peter@example.com%27"






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




  • Brand new recipents are added and subscribed to the list

  • Recipents that exist on other lists are subscribed to the list

  • Already subscribed recipents remain subscribed

  • Previously unsubscribed or pending recipients are updated but their subscription status does not change

  • If the recipient already exists it is updated if specified personal data are different from the specified ones. Empty fields are managed as "do not change"

  • Please refer to management of single recipient if you want to access to more advanced features like forcing subscription/unsubsubscriptionor if you want to clear a personal data field





New Recipients

Previously Subscribed

Previously Pending

Previously unsubscribed



New Recipients

Previously Subscribed

Previously Pending

Previously unsubscribed

POST /Console/List/{id_List}/Recipients

Subscribed

no change

no change

no change

POST /Console/List/{id_List}/Recipients?ConfirmEmail=true

Pending*

Pending*

no change

no change

POST /Console/List/{id_List}/Recipients?importType=asOptout

Unsubscribed

Unsubscribed

no change

no change

*Confirmation request message will be sent immediately



Prerequisite: you must have a valid MailUp FTP account. Please contact your sales representative or MailUp support to request one

Here is how to import a list of recipients using the fileName parameter.

  1. Create a CSV file (e.g. myfile.csv)

    1. please check out the CSV File Format page for more details

  2. Transfer your file using FTP to the target folder (e.g. /import/1 if you want your file to be imported into MailUp list 1)

  3. Call MailUp API to start uploading


    POST /Console/List/{id_list}/Recipients?fileName="myFile.csv"

    please note that the request body is ignored when fileName parameter is used, but it is required to contain open and closed square bracket.


  4. Check the request result to understand if it has been accepted

    1. HTTP 200 is returned if the request has a valid format, then you can monitor the import status using the ReadImportStatus method

    2. Error HTTP 400 (Bad Request) is returned if one of the following occurs

      1. the specified file is not found

      2. the specified file has not the expected format

      3. the header row is missing or invalid








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}/Recipients



Import 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;

  1.  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}/Sending
  1. Send 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}/Deferred






Read 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