Reseller API Reference

Authentication

All API requests must include your reseller API key in the Authorization header using the Bearer scheme:

Authorization: Bearer your-api-key-here

Requests without a valid API key receive a 401 Unauthorized response. Your API key is scoped to your reseller account - you can only manage tenants that belong to you.

Base URL

All endpoints are available under:

https://api.easymailarchive.com/api/reseller/tenants

If you use a custom base domain, the API is still accessed through the main Easy Mail Archive API endpoint, not your custom domain.

List Tenants

Retrieve all tenants under your reseller account.

curl -X GET https://api.easymailarchive.com/api/reseller/tenants \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Accept: application/json"

Response (200):

{
  "data": [
    {
      "slug": "acme-corp",
      "name": "Acme Corporation",
      "status": "active",
      "users_count": 25,
      "storage_bytes": 5368709120,
      "created_at": "2025-06-15T10:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "total": 1
  }
}

Create a Tenant

Provision a new tenant with a unique slug.

curl -X POST https://api.easymailarchive.com/api/reseller/tenants \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "slug": "acme-corp",
    "name": "Acme Corporation"
  }'

Required fields:

FieldTypeDescription
slugstringUnique identifier, 3-48 chars, lowercase alphanumeric + hyphens
namestringDisplay name for the tenant

Response (201):

{
  "data": {
    "slug": "acme-corp",
    "name": "Acme Corporation",
    "status": "active",
    "created_at": "2025-06-15T10:30:00Z"
  }
}

Show a Tenant

Retrieve details for a specific tenant.

curl -X GET https://api.easymailarchive.com/api/reseller/tenants/acme-corp \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Accept: application/json"

Response (200):

{
  "data": {
    "slug": "acme-corp",
    "name": "Acme Corporation",
    "status": "active",
    "users_count": 25,
    "storage_bytes": 5368709120,
    "messages_count": 142857,
    "created_at": "2025-06-15T10:30:00Z"
  }
}

Update a Tenant

Update the display name of an existing tenant.

curl -X PUT https://api.easymailarchive.com/api/reseller/tenants/acme-corp \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Acme Corp International"
  }'

Response (200):

{
  "data": {
    "slug": "acme-corp",
    "name": "Acme Corp International",
    "status": "active"
  }
}

Suspend a Tenant

Suspend a tenant to block user access while retaining all data.

curl -X POST https://api.easymailarchive.com/api/reseller/tenants/acme-corp/suspend \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Accept: application/json"

Response (200):

{
  "data": {
    "slug": "acme-corp",
    "status": "suspended"
  }
}

Unsuspend a Tenant

Restore access to a previously suspended tenant.

curl -X POST https://api.easymailarchive.com/api/reseller/tenants/acme-corp/unsuspend \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Accept: application/json"

Response (200):

{
  "data": {
    "slug": "acme-corp",
    "status": "active"
  }
}

Usage Statistics

Retrieve usage statistics for a specific tenant.

curl -X GET https://api.easymailarchive.com/api/reseller/tenants/acme-corp/usage \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Accept: application/json"

Response (200):

{
  "data": {
    "slug": "acme-corp",
    "users_count": 25,
    "storage_bytes": 5368709120,
    "messages_count": 142857
  }
}

Error Responses

The API returns standard HTTP status codes:

CodeMeaning
400Bad request - invalid input or validation error
401Unauthorized - missing or invalid API key
403Forbidden - tenant does not belong to your reseller account
404Not found - tenant with the given slug does not exist
409Conflict - slug is already taken
422Unprocessable entity - validation errors (details in response body)
429Too many requests - rate limit exceeded

Validation errors return a JSON body with field-level error messages:

{
  "message": "The slug has already been taken.",
  "errors": {
    "slug": ["The slug has already been taken."]
  }
}

Rate Limits

API requests are rate-limited to 60 requests per minute per API key. If you exceed this limit, you will receive a 429 response. The Retry-After header indicates how many seconds to wait before making another request.

We use cookies to analyze site traffic and optimize your experience. No tracking occurs without your consent. Privacy Policy