Create a Subscriber

This page contains information on how to use the Marketing Cloud SOAP API to create a subscriber in your Marketing Cloud account.

Why Use the SOAP API to Create a Subscriber

You can use the SOAP API to automate the addition of subscribers to your Marketing Cloud account as part of activities performed outside of Marketing Cloud. For example, you can use API calls to add subscribers from information gathered from your corporate website.

How to Use the SOAP API to Create a Subscriber

Create a subscriber through the SOAP API using a create request and the sample code listed below. You can optionally pass in a list as a location to add the subscriber. Otherwise, the subscriber resides on the All Subscribers list.

Follow the steps below to create a subscriber using the SOAP API:

  1. Create a Subscriber object.
  2. Populate the appropriate parameters (leaving ID null), including email address or subscriber key.
  3. Issue a Create request using the SOAP API.

The returned subscriber object includes a populated ID variable (which may be of use in future calls).

The attribute to which you pass values for your new subscriber must already exist.

Sample Code

Use the sample code below to create a subscriber and create a subscriber with more attributes.

Sample .NET Code - Create a Subscriber

Sample PHP Code

The code below can be used to create a subscriber as well as upsert more attribute information:

Sample Ruby on Rails Code

Sample Java Code (Axis 1.4)

The sample code below creates a new subscriber if none exists and updates the subscriber if found:

Sample Java Code (Axis 2.0)

Sample Java Code (CXF)

The sample code below creates the subscriber if the subscriber does not exist and adds that subscriber to multiple lists:

The sample code below adds subscribers only and does not add the subscriber to any lists:

Sample SOAP Envelope - Create a Subscriber with Attributes

Sample SOAP Envelope - Create a Subscriber for an On Your Behalf Account

Subscriber Object