Authentication & Rate limiting

On this page:

Authentication to the Mailcoach API is done by using a Bearer token. You can create a new token in your account.

Authentication

You can use the user endpoint to get the details of the currently logged-in user.

$ MAILCOACH_TOKEN="your API token"
$ curl https://<your-mailcoach-domain>/api/user \
    -H "Authorization: Bearer $MAILCOACH_TOKEN" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

As a result, you will get the details of the user that this token belongs to.

{
  "data": {
    "id": 1,
    "email": "john@doe.com",
    "created_at": "2020-08-06T12:08:25.000000Z",
    "updated_at": "2020-08-06T12:08:25.000000Z"
  }
}

Rate limiting

Requests to the API are rate-limited by a token. This means that after a certain number of requests in a given time period, the API will return a 429 Too Many Requests response. Regular responses will include two headers: X-RateLimit-Limit (the number of allowed requests in a time period) and X-RateLimit-Remaining (the number of remaining requests in the time period).

If the limit is exceeded, the Retry-After header will be supplied with the number of seconds to wait until the request can be tried again.

These are the limits on the API endpoints.

  • Authenticated endpoints: 5 requests/second
  • Transactional email endpoints: 50 requests/second
  • Unauthenticated endpoints: 60 requests/minute per IP
Email lists
Using an SDK