Lists
Covers all your list management needs. From creating lists and managing custom fields to accessing active subscribers, anyone who has unsubscribed from the list and more.
Creating a list
Creates a new list into which subscribers can be added or imported. Set the list title, landing pages and confirmation setting.
Request:
POST
http://api.createsend.com/api/v3/lists/{clientid}.{xml|json}
Route Values:
{clientid}
The ID of the client for whom the list should be created. See here for more details.
Expected Request Body: JSON XML
{
"Title": "Website Subscribers",
"UnsubscribePage": "http://www.example.com/unsubscribed.html",
"ConfirmedOptIn": true,
"ConfirmationSuccessPage": "http://www.example.com/joined.html"
}
Expected Response: JSON XML
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
"a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
250: Duplicate list title
Cannot create a list with the same title as another.
251: List Title Empty
The list title cannot be empty.
List details
A basic summary for each list in your account including the name, ID, type of list (single or confirmed opt-in) and any custom unsubscribe and confirmation URL you've specified.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}.{xml|json}
Route Values:
{listid}
The ID of the list you want the details for.
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"ConfirmedOptIn": true,
"Title": "Website Subscribers",
"UnsubscribePage": "http://www.example.com/unsubscribed.html",
"ListID": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"ConfirmationSuccessPage": "http://www.example.com/joined.html"
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
List stats
Comprehensive summary statistics for each list in your account including subscriber counts across active, unsubscribed, deleted and bounced as well as time-based data like new subscribers today, yesterday, this week, month and year.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/stats.{xml|json}
Route Values:
{listid}
The ID of the list you want the stats for.
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"TotalActiveSubscribers": 6,
"NewActiveSubscribersToday": 0,
"NewActiveSubscribersYesterday": 8,
"NewActiveSubscribersThisWeek": 8,
"NewActiveSubscribersThisMonth": 8,
"NewActiveSubscribersThisYear": 8,
"TotalUnsubscribes": 2,
"UnsubscribesToday": 0,
"UnsubscribesYesterday": 2,
"UnsubscribesThisWeek": 2,
"UnsubscribesThisMonth": 2,
"UnsubscribesThisYear": 2,
"TotalDeleted": 0,
"DeletedToday": 0,
"DeletedYesterday": 0,
"DeletedThisWeek": 0,
"DeletedThisMonth": 0,
"DeletedThisYear": 0,
"TotalBounces": 0,
"BouncesToday": 0,
"BouncesYesterday": 0,
"BouncesThisWeek": 0,
"BouncesThisMonth": 0,
"BouncesThisYear": 0
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
List custom fields
Returns all the custom fields for a given list in your account, including the type of field and any additional field options you've specified.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/customfields.{xml|json}
Route Values:
{listid}
The ID of the list you want the custom fields for.
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"FieldName": "website",
"Key": "[website]",
"DataType": "Text",
"FieldOptions": []
},
{
"FieldName": "age",
"Key": "[age]",
"DataType": "Number",
"FieldOptions": []
},
{
"FieldName": "subscription date",
"Key": "[subscriptiondate]",
"DataType": "Date",
"FieldOptions": []
}
{
"FieldName": "newsletterformat",
"Key": "[newsletterformat]",
"DataType": "MultiSelectOne",
"FieldOptions": [
"HTML",
"Text"
]
]
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
List segments
Returns all the segments you have created for this list including the name, segment and list ID. You can also create your own segments and manage your own segment rules via the API.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/segments.{xml|json}
Route Values:
{listid}
The ID of the list you want the segments for.
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"ListID": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"SegmentID": "b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1",
"Title": "Segment One"
},
{
"ListID": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"SegmentID": "c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1",
"Title": "Segment Two"
}
]
]]>
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
Active subscribers
Contains a paged result representing all the active subscribers for a given list. This includes their email address, name, date subscribed and any custom field data. You have complete control over how results should be returned including page sizes, sort order and sort direction.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/active.{xml|json}?date={YYYY-MM-DD}&page={pagenumber}&pagesize={pagesize}&orderfield={email|name|date}&orderdirection={asc|desc}
Route Values:
{listid}
The ID of the list you want the active subscribers for.
{date}
Subscribers which became active on or after the Date value specified will be returned. Must be in the format YYYY-MM-DD. Required
{page}
The results page to retrieve. Default: 1
{pagesize}
The number of records to retrieve per results page. Default: 1000
{orderfield}
The field which should be used to order the results. Default: date
{orderdirection}
The direction in which results should be ordered. Default: asc
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Results": [
{
"EmailAddress": "subs+7t8787Y@example.com",
"Name": "Person One",
"Date": "2010-10-25 10:28:00",
"State": "Active",
"CustomFields": [
{
"Key": "website",
"Value": "http://example.com"
},
{
"Key": "age",
"Value": "24"
},
{
"Key": "subscription date",
"Value": "2010-03-09"
}
]
},
{
"EmailAddress": "subs+7878787y8ggg@example.com",
"Name": "Person Two",
"Date": "2010-10-25 12:17:00",
"State": "Active",
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
}
]
},
{
"EmailAddress": "subs+7890909i0ggg@example.com",
"Name": "Person Three",
"Date": "2010-10-25 12:52:00",
"State": "Active",
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
}
]
},
{
"EmailAddress": "subs@example.com",
"Name": "Person Four",
"Date": "2010-10-27 13:13:00",
"State": "Active",
"CustomFields": []
},
{
"EmailAddress": "joey@example.com",
"Name": "Person Five",
"Date": "2010-10-27 13:13:00",
"State": "Active",
"CustomFields": []
}
],
"ResultsOrderedBy": "email",
"OrderDirection": "asc",
"PageNumber": 1,
"PageSize": 1000,
"RecordsOnThisPage": 5,
"TotalNumberOfRecords": 5,
"NumberOfPages": 1
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
800: Invalid page number
The page number you have provided is invalid.
801: Invalid page size
The page size must be between 10 and 1000.
802: Invalid order field
The order field must be either email, name or date
803: Invalid order direction
The order direction must be either asc or desc
5: Invalid Date
The date must be provided and in the format YYYY-MM-DD
Unsubscribed subscribers
Contains a paged result representing all the unsubscribed subscribers for a given list. This includes their email address, name, date unsubscribed and any custom field data. You have complete control over how results should be returned including page sizes, sort order and sort direction.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/unsubscribed.{xml|json}?date={YYYY-MM-DD}&page={pagenumber}&pagesize={pagesize}&orderfield={email|name|date}&orderdirection={asc|desc}
Route Values:
{listid}
The ID of the list you want the unsubscribed subscribers for.
{date}
Subscribers which unsubscribed on or after the Date value specified will be returned. Must be in the format YYYY-MM-DD. Required
{page}
The results page to retrieve. Default: 1
{pagesize}
The number of records to retrieve per results page. Default: 1000
{orderfield}
The field which should be used to order the results. Default: date
{orderdirection}
The direction in which results should be ordered. Default: asc
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Results": [
{
"EmailAddress": "subscriber@example.com",
"Name": "Unsub One",
"Date": "2010-10-25 13:11:00",
"State": "Unsubscribed",
"CustomFields": []
},
{
"EmailAddress": "subscriberone@example.com",
"Name": "Subscriber",
"Date": "2010-10-25 13:04:00",
"State": "Unsubscribed",
"CustomFields": [
{
"Key": "website",
"Value": "http://google.com"
}
]
},
{
"EmailAddress": "example+1@example.com",
"Name": "Example One",
"Date": "2010-10-26 10:56:00",
"State": "Unsubscribed",
"CustomFields": []
},
{
"EmailAddress": "example+2@example.com",
"Name": "Example Two",
"Date": "2010-10-26 10:56:00",
"State": "Unsubscribed",
"CustomFields": []
},
{
"EmailAddress": "example+3@example.com",
"Name": "Example Three",
"Date": "2010-10-26 10:56:00",
"State": "Unsubscribed",
"CustomFields": []
}
],
"ResultsOrderedBy": "email",
"OrderDirection": "asc",
"PageNumber": 1,
"PageSize": 1000,
"RecordsOnThisPage": 5,
"TotalNumberOfRecords": 5,
"NumberOfPages": 1
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
800: Invalid page number
The page number you have provided is invalid.
801: Invalid page size
The page size must be between 10 and 1000.
802: Invalid order field
The order field must be either email, name or date
803: Invalid order direction
The order direction must be either asc or desc
5: Invalid Date
The date must be provided and in the format YYYY-MM-DD
Bounced subscribers
Contains a paged result representing all the bounced subscribers for a given list. This includes their email address, name, date bounced and any custom field data. You have complete control over how results should be returned including page sizes, sort order and sort direction.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/bounced.{xml|json}?date={YYYY-MM-DD}&page={pagenumber}&pagesize={pagesize}&orderfield={email|name|date}&orderdirection={asc|desc}
Route Values:
{listid}
The ID of the list you want the bounced subscribers for.
{date}
Subscribers which bounced on or after the Date value specified will be returned. Must be in the format YYYY-MM-DD. Required
{page}
The results page to retrieve. Default: 1
{pagesize}
The number of records to retrieve per results page. Default: 1000
{orderfield}
The field which should be used to order the results. Default: date
{orderdirection}
The direction in which results should be ordered. Default: asc
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Results": [
{
"EmailAddress": "bouncedsubscriber@example.com",
"Name": "Bounced One",
"Date": "2010-10-25 13:11:00",
"State": "Bounced",
"CustomFields": []
}
],
"ResultsOrderedBy": "email",
"OrderDirection": "asc",
"PageNumber": 1,
"PageSize": 1000,
"RecordsOnThisPage": 1,
"TotalNumberOfRecords": 1,
"NumberOfPages": 1
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
800: Invalid page number
The page number you have provided is invalid.
801: Invalid page size
The page size must be between 10 and 1000.
802: Invalid order field
The order field must be either email, name or date
803: Invalid order direction
The order direction must be either asc or desc
5: Invalid Date
The date must be provided and in the format YYYY-MM-DD
Deleted subscribers
Contains a paged result representing all the deleted subscribers for a given list. This includes their email address, name, date deleted and any custom field data. You have complete control over how results should be returned including page sizes, sort order and sort direction.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/deleted.{xml|json}?date={YYYY-MM-DD}&page={pagenumber}&pagesize={pagesize}&orderfield={email|name|date}&orderdirection={asc|desc}
Route Values:
{listid}
The ID of the list you want the deleted subscribers for.
{date}
Subscribers which were deleted on or after the Date value specified will be returned. Must be in the format YYYY-MM-DD. Required
{page}
The results page to retrieve. Default: 1
{pagesize}
The number of records to retrieve per results page. Default: 1000
{orderfield}
The field which should be used to order the results. Default: date
{orderdirection}
The direction in which results should be ordered. Default: asc
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Results": [
{
"EmailAddress": "deleted+1@example.com",
"Name": "Deleted Subscriber",
"Date": "2010-10-25 13:04:00",
"State": "Deleted",
"CustomFields": [
{
"Key": "website",
"Value": "http://google.com"
}
]
},
{
"EmailAddress": "deleted+2@example.com",
"Name": "Example Two",
"Date": "2010-10-26 10:56:00",
"State": "Deleted",
"CustomFields": []
}
],
"ResultsOrderedBy": "email",
"OrderDirection": "asc",
"PageNumber": 1,
"PageSize": 1000,
"RecordsOnThisPage": 2,
"TotalNumberOfRecords": 2,
"NumberOfPages": 1
}
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
800: Invalid page number
The page number you have provided is invalid.
801: Invalid page size
The page size must be between 10 and 1000.
802: Invalid order field
The order field must be either email, name or date
803: Invalid order direction
The order direction must be either asc or desc
5: Invalid Date
The date must be provided and in the format YYYY-MM-DD
Updating a List
Update the basic settings for any list in your account including the name, type and any subscribe and unsubscribe confirmation pages.
Request:
PUT
http://api.createsend.com/api/v3/lists/{listid}.{xml|json}
Route Values:
{listid}
The ID of the list you want to update.
Expected Request Body: JSON XML
{
"Title": "Website Subscribers",
"UnsubscribePage": "http://www.example.com/unsubscribed.html",
"ConfirmedOptIn": true,
"ConfirmationSuccessPage": "http://www.example.com/joined.html"
}
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
250: Duplicate list title
Cannot create a list with the same title as another.
251: List Title Empty
The list title cannot be empty.
Creating a custom field
Creates a new custom field for the provided list into which subscriber data can be added. Set the Custom Field name (from which the Key will be generated) and Data Type.
Available Data Types are Text, Number, MultiSelectOne, MultiSelectMany, Date, Country and USState. For Multi-Valued fields (MultiSelectOne and MultiSelectMany) the possible options must also be provided. In the case of Country and USState fields the options will be automatically generated and made available when getting the lists custom fields.
Request:
POST
http://api.createsend.com/api/v3/lists/{listid}/customfields.{xml|json}
Route Values:
{listid}
The ID of the list you want to create the custom field on.
Expected Request Body: JSON XML
{
"FieldName": "Newsletter Format",
"DataType": "MultiSelectOne",
"Options": [ "HTML", "Text" ]
}
Expected Response: JSON XML
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
"[NewsletterFormat]"
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
254: Invalid Field Name
The FieldName provided was not valid.
255: The Field Key already exists
A Custom Field using the Key generated from the Field Name already exists.
256: Options defined for Text or Number Field
The Options property was neither null or empty for a Text, Number, Date, Country or USState based field
257: No options defined for Multi-Valued field
There were no options defined for a Multi-Valued Custom Field (i.e MultiSelectOne or MultiSelectMany)
259: Data type must be one of (Text|Number|MultiSelectOne|MultiSelectMany|Country|USState|Date)
The provided Data Type was not one of the valid options
Updating custom field options
Updates the available options for an existing Multi-Valued custom field (MultiSelectOne or MultiSelectMany). Existing options may be maintained or discarded based on the value of the KeepExistingOptions property.
Request:
PUT
http://api.createsend.com/api/v3/lists/{listid}/customfields/{customfieldkey}/options.{xml|json}
Route Values:
{listid}
The ID of the list for the custom field you want to change the options for.
{customfieldkey}
The key of the custom field you want to change the options for. This key is provided for each field returned when getting list custom fields.
Expected Request Body: JSON XML
{
"KeepExistingOptions": true,
"Options": [ "First Option", "Second Option", "Third Option" ]
}
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
257: No options defined for Multi-Valued field
There were no options defined for a Multi-Valued Custom Field (i.e MultiSelectOne or MultiSelectMany)
253: Invalid Key. Keys must be surrounded with [ ]
The provided field key was either not valid, did not exist or was not a Multi-Valued Custom Field.
Deleting a custom field
Deletes a specific custom field from a list.
Request:
DELETE
http://api.createsend.com/api/v3/lists/{listid}/customfields/{customfieldkey}.{xml|json}
Route Values:
{listid}
The ID of the list for the custom field you want to delete.
{customfieldkey}
The key of the custom field you want to delete. This key is provided for each field returned when getting list custom fields.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
253: Invalid Key. Keys must be surrounded with [ ]
The provided field key was either not valid or did not exist.
Deleting a list
Deletes a subscriber list from your account.
Request:
DELETE
http://api.createsend.com/api/v3/lists/{listid}.{xml|json}
Route Values:
{listid}
The ID of the list you want to delete.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors which may be included in the body of the response:
252: Cannot delete a list attached to at least one campaign draft
The specified list is being used by a draft campaign.
List webhooks
Returns all the webhooks you have created for this list. For each webhook, the response includes its ID, URL, status, payload format and the events on which the webhook will be invoked.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/webhooks.{xml|json}
Route Values:
{listid}
The ID of the subscriber list for which webhooks should be retrieved.
Expected Response: JSON XML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"WebhookID": "ee1b3864e5ca61618q98su98qsu9q",
"Events": [
"Subscribe"
],
"Url": "http://example.com/subscribe",
"Status": "Active",
"PayloadFormat": "Json"
},
{
"WebhookID": "89d8quw98du9qw8ud9q8wud8u98u8",
"Events": [
"Deactivate"
],
"Url": "http://example.com/deactivate",
"Status": "Active",
"PayloadFormat": "Json"
}
]
]]>
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
Creating a webhook
Creates a new webhook for the provided list. Valid events are Subscribe, Deactivate,
and Update. Valid payload formats are json, and xml.
Request:
POST
http://api.createsend.com/api/v3/lists/{listid}/webhooks.{xml|json}
Route Values:
{listid}
The ID of the list for which the webhook should be created.
Expected Request Body: JSON XML
{
"Events": [ "Subscribe" ],
"Url": "http://example.com/subscribe",
"PayloadFormat": "json"
}
Expected Response: JSON XML
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
"982u981u298u298u2e9u289e"
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors
which may be included in the body of the response:
601: Invalid Webhook URL
The URL provided for the webhook is invalid
602: Invalid Webhook Format
The payload format provided for the webhook is invalid. Supported formats are json and xml.
603: Invalid Webhook Event
At least one of the webhook events you have provided are invalid. Valid events are
Subscribe, Deactivate, and Update.
Testing a webhook
Attempts to post a webhook payload to the endpoint specified for that webhook. If multiple events are subscribed to for that webhook, the payload will contain an example for each event as part of a batch response. Valid payload formats are json, and xml.
Request:
GET
http://api.createsend.com/api/v3/lists/{listid}/webhooks/{webhookid}/test.{xml|json}
Route Values:
{listid}
The ID of the list to which the webhook belongs.
Route Values:
{webhookid}
The ID of the webhook for which the test should be sent.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
If you receive a "400 Bad Request" response for this request, these are the possible errors
which may be included in the body of the response:
610: The webhook request has failed
The attempt to post the webhook request to the provided URL has failed. Check the ResultData object for more detail.
Deleting a webhook
Deletes a specific webhook associated with a list.
Request:
DELETE
http://api.createsend.com/api/v3/lists/{listid}/webhooks/{webhookid}.{xml|json}
Route Values:
{listid}
The ID of the list from which the webhook should be deleted.
{webhookid}
The ID of the webhook you want to delete. This ID is provided for each webhook returned when getting list webhooks.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
Activating a webhook
Activate a webhook associated with a list.
Note that despite the fact that this is a PUT request, the body of the request should just be empty.
Request:
PUT
http://api.createsend.com/api/v3/lists/{listid}/webhooks/{webhookid}/activate.{xml|json}
Route Values:
{listid}
The ID of the list with which the webhook you want to activate is associated.
{webhookid}
The ID of the webhook to be activated.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.
Deactivating a webhook
Deactivate a webhook associated with a list.
Note that despite the fact that this is a PUT request, the body of the request should just be empty.
Request:
PUT
http://api.createsend.com/api/v3/lists/{listid}/webhooks/{webhookid}/deactivate.{xml|json}
Route Values:
{listid}
The ID of the list with which the webhook you want to deactivate is associated.
{webhookid}
The ID of the webhook to be deactivated.
Expected Response (both XML and JSON):
HTTP/1.1 200 OK
Error Responses:
Please see our response status codes documentation for details of potential error responses for any API request.