All Collections
API Overview
API Overview

An Overview of SmartrMail's API

Written by Peter Connolly
Updated over a week ago

API Intro

Base url

All URLs referenced in this documentation begin with the following url:

Required HTTP header fields

The Content-Type and Accept header fields must have a value of application/json.

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


SmartrMail uses tokens for API authentication. Your API token can be found by logging into your SmartrMail account and going to API.

You should provide an API token on each request using either the HTTP authorization header field or the token query string parameter.

HTTP authorization header field

Authorization: token YOUR_API_TOKEN

Token query string parameter


Response Status Codes

The following status codes are returned by API requests:

  • 200 - Success - Request was fulfilled 

  • 201 - Success - A new resource was created 

  • 400 - Error - The request cannot be fulfilled 

  • 404 - Error - Resource not found 

  • 422 - Error - Validation failure 

  • 500 - Error - An internal server error occurred 

Success Codes

Success codes have the following codes:

  • GET - Requests will return a “200 OK” response upon success.

  • POST - Requests to create a resource we will return a “201 Created” upon success.

  • POST - Requests which do not create a resource will return a “200 OK” upon success.

  • PUT - Requests to update a resource will return a “200 OK” response upon success.

  • DELETE - Requests to delete a resource will return a “200 OK” response upon success. 

Error Codes

If you make a request with an invalid API key you will receive a 401.

If you make a request with invalid parameters, you will receive a 400 with errors.

  "title": ["can"t be blank"]

If you try to request a resource that does not exist, you will receive a 404.

API Token

You can generate an API token within a SmartrMail account. You'll find your API token on the integrations page in dropdown menu under your store name.

If you're a developer – get started on a free trial and let us know to set your store as a development store by emailing [email protected]

Did this answer your question?