Adding Subscribers with the API

Email subscribers can be subscribed to your publication with the Curated API. When a subscriber is added using this method they will still receive a welcome email just as if they subscribed using the web site.

Note: This API should only be used to integrate with sites and systems which have made it very clear to the end user that they are going to be subscribed to your list.

In order to interact with this API you will need to read Getting started with the Curated API.

Adding an email subscriber

This API is located at:

POST /email_subscribers

There is only one parameter, it should be sent as JSON in the post data:

  • email - The email address to subscribe to your list.

To test this API, you can use cURL:

curl -X POST https://api.curated.co/PUBLICATION_KEY/api/v1/email_subscribers -H 'Accept: application/json' -H 'Content-type: application/json' -H 'Authorization: Token token="API_KEY"' -d '{ "email" : "new_subscriber@example.com" }'

Return data

If the subscription was successful, you will receive:

{
  "success": true
}

If the subscription failed, you will receive:

{
  "success": false,
  "error_message": "Unable to subscribe new_subscriber@example.com.",
  "errors": [
    "Email address is already subscribed."
  ]
}

Details on why the call failed will be supplied in the error_message parameter as a formatted string including all reasons and also as an array containing a list of errors.

Adding other types of Subscribers

It is not possible to add Safari Push Notification subscribers using the API as a token must be generated by the subscriber’s browser when they subscribe.