All API responses follow a consistent envelope format:
Success
json
{
"success": true,
"data": { ... }
}Error
json
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "File not found"
}
}Common HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request (invalid parameters) |
401 | Unauthorized (missing or invalid auth) |
403 | Forbidden (insufficient permissions) |
404 | Not Found |
409 | Conflict (duplicate file, alias already exists) |
413 | Payload Too Large |
500 | Internal Server Error |
All errors return a consistent JSON envelope:
json
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "filename is required"
}
}Error Codes
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid authentication |
FORBIDDEN | 403 | Insufficient permissions |
NOT_FOUND | 404 | Resource does not exist |
VALIDATION_ERROR | 400 | Invalid request parameters |
DUPLICATE | 409 | Resource already exists |
PAYLOAD_TOO_LARGE | 413 | File exceeds upload size limit |
INTERNAL_ERROR | 500 | Server error |
Rate Limiting
OwnMediaHost is self-hosted and does not enforce rate limits by default. If you deploy behind a reverse proxy (Caddy, Nginx), you can configure rate limiting at the proxy level.