Subscribe to List

The Subscribe command allows you to add a Subscriber to a list and update the Subscriber's data.


The Subscribe command requires the following arguments: Command, Realm, Password, List, Format, and Data.


The command is ‘sub', the realm is ‘myrealm’ and the password is ‘mypass’.  A plain text format subscription for '' will be added to list_id='5'.

The Subscribe command expects as least one field in the Data argument.  The email address of the subscriber is always required to create a subscription record.  If the subscriber does not yet exist, a Subscriber record will be created using the email address as the primary key.  If the subscriber does exist, the Subscriber record will be updated with any data defined in the Data fields.

You can add one or many subscribers with the same subscribe command.  To add multiple subscribers, include additional subscribers separated by the carat (^) character.  Each additional subscriber must have the same number of data fields defined.

The Subscribe command supports the following arguments:







Defines the command to use.





Name of the realm to run the command.  This is required, and the command will fail if the realm and password do not match.





Authentication code for API access.  This is required, and the command will fail if the realm and password do not match.



List ID


Identifier of the list to apply the command.




The format of the email message content to send.

Plain Text = 1 HTML = 2 Multipart MIME = 99




Force Subscribe


When a Subscriber unsubscribes, in some instances an opt-out record is created preventing future subscriptions.  To force a subscription, set Force Subscribe to 1.  Records are not updated by default.




Override Subscription Confirmation Requirement


Lists include an option to require a subscriber to Confirm a subscription request through Subscription forms, Subscribe Links, and API calls.  If this option is enabled, the API subscribe command will not add the subscription until after the subscriber clicks a link to confirm they wish to be added to the List. 

To ignore the requirement, set override_confirmation argument to 1.  The subscription will be created and the confirmation email will not be sent to the subscriber.

override_confirmation= [0,1]



Data Yes Subscriber related data.  Email is always required, and additional fields are optional.





Using all commands and arguments (please note the command is wrapped for display purposes only):


The subscriber, ‘’, will be subscribed to list ‘5’ in the realm ‘myrealm’ with the option to receive MIME messages.   If the list requires subscription confirmation, the subscription will be created without the confirmation.

If a record for the subscriber already exists, then it will be updated.  If it does not exist, a new record will be created with the first name, ‘Jane’, last name, ‘Doe’, and custom field “gender” set to ‘female’.  Any optouts for the email address will be removed. 

Duplicate Subscriber

To add a subscriber with the same email, but different first name and allow a duplicate instead of updating an existing subscriber, add the Duplicate flag to the DATA argument:


A subscriber with the same email address will be created with the first name, ‘JD’, last name, ‘Doe’, and custom field “gender” set to ‘female’. 


Successful results return:

SUCCESS: Total Records Processed 1, Total Subscriptions 1, Records Added 1, Records Updated 0, Records Ignored (Optout Error)0, Records Failed Other Error 0  

Multiple Subscribers

To add multiple subscribers in one command: 


In addition to the first record example above, a second and third record are created.

Successful results return:

SUCCESS: Total Records Processed 3, Total Subscriptions 3, Records Added 3, Records Updated 0, Records Ignored (Optout Error)0, Records Failed Other Error 0  

Customer Key Example

Some systems have the ability to define a unique Customer Key per subscriber.  If your realm has Customer Key enabled, then you must include the customer_key in the data argument along with email.  For example:

api_web?r=myrealm&p=mypass&c=sub&list_id=5&format=99&force_sub=1&data=customer_key, email,first,last,custom_gender^11293,,Jane,Doe,female

If the Customer Key is not included, the command will fail.


The Subscribe command outputs either a SUCCESS or FAILURE message. 


The Subscribe command success message returns the SUCCESS message and includes information about the records processed.  The result format is:

SUCCESS: Total Records Processed [number_a], Total Subscriptions [number_b], Records Added [number_c], Records Updated [number_d], Records Ignored (Optout Error)[nuber_e], Records Failed Other Error [number_f]

The numbers reported in the results include the following:


Total Records Processed

Number of email addresses in the command

Total Subscriptions

Number of subscriptions added or updated

Records Added

Number of new Subscribers

Records Updated

Number of Subscribers that already existed and updated

Records Ignored Optout Error

Number of Subscribers not subscribed because an optout was encountered.  Can only be 0 if force_sub=1, or no optouts encountered.

Records Failed Other Error

Number of subscribers not subscribed because of some other error


A Subscribe command will fail for several reasons, such as if an invalid list is specified or an optout is encountered.  The result format is:

FAILURE: [Reason]  

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk