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:
| Field | Type | Description |
|---|---|---|
slug | string | Unique identifier, 3-48 chars, lowercase alphanumeric + hyphens |
name | string | Display 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:
| Code | Meaning |
|---|---|
400 | Bad request - invalid input or validation error |
401 | Unauthorized - missing or invalid API key |
403 | Forbidden - tenant does not belong to your reseller account |
404 | Not found - tenant with the given slug does not exist |
409 | Conflict - slug is already taken |
422 | Unprocessable entity - validation errors (details in response body) |
429 | Too 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.