Skip to main content

Authorization

To use the easymail API, you need to authenticate your requests using an API token.

Getting Your API Token

  1. Go to https://cart.easy.tools/creator/email/settings/developer
  2. Generate a new API token
  3. Copy and securely store your token

Using the API

Base URL

All API requests should be made to:

https://email.easy.tools/api/v1

Authentication

Include your API token in the Authorization header using Bearer authentication:

Authorization: Bearer YOUR_API_TOKEN

It's important to also include these headers in all requests:

Content-Type: application/json
Accept: application/json

Example Request

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
https://email.easy.tools/api/v1/contacts

Rate Limiting

The API enforces rate limiting per tenant:

  • 100 requests per 60 seconds

Rate Limit Headers

All responses include rate limit information:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window

When rate limited, additional headers are included:

HeaderDescription
X-RateLimit-RemainingRequests remaining (always 0 when limited)
Retry-AfterSeconds until the rate limit resets

Rate Limit Error (429 Too Many Requests)

{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Please retry after 60 seconds."
}
}

Response Formats

Success Response

All successful responses wrap data in a data key:

{
"data": { ... }
}

Error Response

All error responses follow this format:

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}

Validation errors include additional details field with field-specific messages:

{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid",
"details": {
"email": ["The email field is required."]
}
}
}

Date/Time Format

All timestamps use ISO 8601 format in UTC: YYYY-MM-DDTHH:mm:ssZ

Example: 2025-01-15T10:30:00Z

Common Error Codes

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API token
404RESOURCE_NOT_FOUNDRequested resource does not exist
409DUPLICATE_RESOURCEResource already exists (e.g., duplicate email)
422VALIDATION_ERRORInvalid input data
429RATE_LIMITEDToo many requests
500SERVER_ERRORUnexpected server error