Skip to main content

API overview

Base URL, authentication, your API token and response codes for the SmartrMail API.

Overview

The SmartrMail API lets your own code, or another app, work with your SmartrMail lists and profiles: create lists, add profiles to a list, and unsubscribe or resubscribe profiles. Each request uses your store’s API token. For the endpoints, see Manage subscriber lists and List subscribers.
​

Find your API token

  1. Click Settings at the bottom of the left sidebar, then click Integrations.

  2. Under API access, click Copy next to API token.

Important: Your API token gives full access to your store’s lists and profiles. Keep it private, and only paste it into apps you trust.

Base URL

All URLs in this documentation start with:

https://go.smartrmail.com/api/v1

Required HTTP headers

Send JSON and ask for JSON on every request:

Content-Type: application/json
Accept: application/json
User-Agent: <user agent>

Authentication

Send your API token on each request, either in the Authorization header or as the token query string parameter.

Authorization header

Authorization: token YOUR_API_TOKEN

Token query string parameter

curl https://go.smartrmail.com/api/v1/lists?token=YOUR_API_TOKEN

Lists and list IDs

The API identifies a list by its ID, which GET /lists returns as id. Use that value in URLs like /lists/LIST_ID/list_subscribers. GET /lists returns 50 lists a page; add page=2 for the next page.

Response status codes

  • 200: success. GET, PUT and DELETE requests, and POST requests that don’t create a list.

  • 201: success, a new list was created.

  • 401: the API token is missing or invalid.

  • 404: the list or profile doesn’t exist.

  • 422: validation failed. The response lists the errors.

  • 500: an internal server error occurred.

Errors

A request that fails validation returns 422 with the errors, for example:

{
"name": ["can't be blank"]
}

A request for a list or profile that doesn’t exist returns 404:

{
"error": "Not found"
}

Good to know: the API
​

Store domain: the API access card also shows your Store domain, which some apps ask for with the token.

Building an integration: if you’re a developer and need a test account, email [email protected].


Need a hand with the SmartrMail API?

Our team is happy to help. Book a 1:1 call with the SmartrMail team and we’ll set it up with you.

Did this answer your question?