You are here: Communications Cloud API v1 > Resources > Subscribers > Create a Subscriber
Create a Subscriber

POST to /api/account/ACCOUNT_CODE/subscribers.xml

Example Input
<subscriber>
    <email>EMAIL@ADDRESS.COM</email>
    <send-notifications type='boolean'>false</send-notifications>
    <digest-for>#</digest-for>
  </subscriber>

-- OR --

  <subscriber>
    <phone>###-###-####</phone>
    <country-code>#</country-code>
    <send-notifications type='boolean'>false</send-notifications>
  </subscriber>
Elements
Example Output
<?xml version='1.0' encoding='UTF-8'?>
<subscriber>
  <to-param>SUBSCRIBER_ID</to-param>
  <link rel="self" href="/api/account/ACCOUNT_CODE/subscribers/SUBSCRIBER_ID" />
</subscriber>
Example Curl Code

The example below uses curl.

curl -s -D- -X POST -u 'username':'password' -d@subscription_create.txt -H
'Content-Type: text/xml'
https://stage-api.govdelivery.com/api/account/<ACCOUNT_CODE>/subscriptions.xml
Troubleshooting

Reference subscriber error codes

 

Was this page helpful? Can't find what you need? Let us know