Authentication
All endpoints except /signup, /login, /regions, and /errors require an API key.
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Authentication Errors
{
"success": false,
"error": "Authorization header required"
}
Error Codes
All error responses use a standard code field. Use these codes for programmatic error handling instead of parsing error messages.
| Code | HTTP Status | Description |
| ok |
200 |
Request succeeded |
| created |
201 |
Resource was created |
| bad_request |
400 |
Invalid input or missing required fields |
| auth_required |
401 |
Authorization header missing |
| unauthorized |
401 |
Invalid API key |
| forbidden |
403 |
Tier limit reached, wrong project, or operation not allowed for isolation level |
| not_found |
404 |
Resource does not exist |
| conflict |
409 |
Resource already exists, or operation conflicts with current state |
| rate_limited |
429 |
Too many requests |
| internal_error |
500 |
Server error |
Example Error Responses
{
"success": false,
"http_status": 409,
"code": "conflict",
"error": "Tenant 'acme' is in trash. Use POST /tenants/acme/restore or DELETE /tenants/acme?hard=true"
}
{
"success": false,
"http_status": 403,
"code": "forbidden",
"error": "PITR is only available for L2 (dedicated) tenants"
}
Rate Limits
Rate limits protect shared infrastructure and ensure fair usage. Limits are applied in layers — from IP-level DDoS protection to tier-based API quotas.
IP Rate Limiting
All requests are rate-limited by IP address before authentication. This protects against abuse and DDoS. Exceeding the limit repeatedly results in a temporary ban.
| Parameter | Value | Description |
| Requests per second |
100 |
Maximum requests per second from a single IP address |
| Ban threshold |
5 violations |
After 5 rate limit violations, the IP is temporarily banned |
| Ban duration |
5 minutes |
Banned IPs receive 429 for all requests during this period |
Tier-Based Limits
After authentication, API requests are counted against your project's tier. Backup requests have a separate hourly limit. Dedicated tenants bypass the backup rate limit since backups run on their own server.
| Limit | Window | Scope | Description |
| API requests |
Per minute |
Project |
Limit varies by tier. Upgrade at tenantsdb.com/billing. |
| Backup requests |
Per hour |
Project |
Limits manual backup frequency. Dedicated tenants are exempt. |
Response
Rate-limited requests return HTTP 429 Too Many Requests with a Retry-After header indicating when to retry (1 second for rate limits, 300 seconds for bans).
Retry-After: 1
Content-Type: application/json
{
"success": false,
"error": "rate limit exceeded: max 60 requests per minute"
}
IP bans apply across both the API and database proxy connections. A ban from excessive API requests also blocks proxy connections from the same IP, and vice versa.
List available cloud regions for dedicated tenant provisioning. This endpoint is public and does not require authentication.
Shared databases are hosted in EMEA. For region selection, create or migrate tenants to dedicated isolation.
Request
curl -s https://api.tenantsdb.com/regions
Response
{
"regions": [
{
"zone": "eu-central",
"label": "Europe",
"is_default": true
},
{
"zone": "ap-southeast",
"label": "Asia Pacific"
},
{
"zone": "us-east",
"label": "US East"
},
{
"zone": "us-west",
"label": "US West"
}
]
}
Use the zone value when creating dedicated tenants or migrating to a specific region. If no region is specified, the default region is used.
List all error codes and their HTTP status mappings. Public endpoint — no authentication required. Useful for building client libraries.
Request
curl -s https://api.tenantsdb.com/errors
Response
{
"codes": {
"ok": { "status": 200, "description": "Request succeeded" },
"created": { "status": 201, "description": "Resource was created" },
"bad_request": { "status": 400, "description": "Invalid input or missing fields" },
"auth_required": { "status": 401, "description": "Authorization header missing" },
"unauthorized": { "status": 401, "description": "Invalid API key" },
"forbidden": { "status": 403, "description": "Tier limit reached or wrong project" },
"not_found": { "status": 404, "description": "Resource does not exist" },
"conflict": { "status": 409, "description": "Already exists or operation in progress" },
"rate_limited": { "status": 429, "description": "Too many requests" },
"internal_error": { "status": 500, "description": "Server error" }
}
}