Errors
MisarBlog API error codes and how to handle them.
Errors
The MisarBlog API uses standard HTTP status codes and returns a consistent JSON error body.
Error Format
{ "error": "Human-readable message" }
All errors include a single error field with a description of what went wrong.
HTTP Status Codes
| Status | Meaning |
|--------|---------|
| 400 Bad Request | Invalid request body or query parameters |
| 401 Unauthorized | Missing or invalid API key |
| 403 Forbidden | Key lacks permission for this resource |
| 404 Not Found | Resource does not exist or belongs to another user |
| 409 Conflict | Duplicate slug or resource already exists |
| 422 Unprocessable Entity | Valid JSON but fails business logic validation |
| 429 Too Many Requests | Rate limit exceeded |
| 500 Internal Server Error | Unexpected server error |
Rate Limit Errors
When you exceed your plan's rate limit, the API returns 429 with rate limit headers:
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1712345678
Back off and retry after the X-RateLimit-Reset timestamp (Unix epoch).
Common Errors
401 — Invalid API key
{ "error": "Invalid API key" }
Ensure your key starts with mbk_ and hasn't been revoked in Dashboard → Settings → API Keys.
404 — Article not found
{ "error": "Article not found" }
Confirm the slug exists and is published (or use /drafts for unpublished content).
409 — Slug conflict
{ "error": "An article with this slug already exists" }
Choose a different slug or omit the field to let the API auto-generate one from the title.
422 — Validation error
{ "error": "Title is required and must be at least 5 characters" }
Fix the field described in the error message and retry.
Retries
Safe to retry on 429 (after back-off) and 500. Do not retry 4xx errors — they indicate a problem with the request that won't resolve on its own.