Skip to main content
The Meibel API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error due to the information provided (e.g., a required parameter was missing), and codes in the 5xx range indicate an error with our servers.

HTTP Status Codes

CodeDescription
200 - OKThe request was successful.
201 - CreatedThe resource was successfully created.
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter.
401 - UnauthorizedNo valid API key provided.
403 - ForbiddenThe API key doesn’t have permissions to perform the request.
404 - Not FoundThe requested resource doesn’t exist.
422 - Validation ErrorThe request was well-formed but was unable to be processed due to semantic errors.
429 - Too Many RequestsToo many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502, 503, 504 - Server ErrorsSomething went wrong on our end. (These are rare.)

Error Response Format

All API errors include a JSON response body:
{
  "message": "A human-readable error message",
  "detail": [
    {
      "loc": ["body", "field_name"],
      "msg": "Field required",
      "type": "value_error.missing"
    }
  ]
}

Error Handling in SDKs

from meibel import MeibelClient
from meibel.exceptions import ApiError, AuthenticationError, NotFoundError
import os

client = MeibelClient(api_key=os.getenv("MEIBEL_API_KEY"))

try:
    result = client.documents.get_document_result("nonexistent-id")
except AuthenticationError as e:
    print(f"Invalid API key: {e}")
except NotFoundError as e:
    print(f"Not found: {e}")
except ApiError as e:
    print(f"API error ({e.status_code}): {e}")

Tips for Error Handling

Always implement proper error handling in your application to provide a good user experience and facilitate debugging.
1

Handle expected errors

Handle common error cases (401, 404, 422, 429) gracefully in your application
2

Implement retry logic

Use exponential backoff for retrying failed requests, especially for rate limit errors (429)
3

Log errors

Log error details to help with troubleshooting
4

Provide user feedback

Translate API errors into helpful messages for your users

Getting Help

If you’re experiencing persistent errors:
  1. Ensure you have the complete error message
  2. Contact our support team at support@meibel.ai with details
  3. For SDK-specific issues, open an issue on GitHub