Guides
Error Handling
How to handle errors from the Home Plate API.
The Home Plate API uses standard HTTP status codes and returns consistent error responses.
Error response format
All errors return a JSON response with a statusMessage field:
{
"statusCode": 401,
"statusMessage": "Unauthorized - Invalid or revoked API key"
}
HTTP status codes
| Code | Meaning | When it happens |
|---|---|---|
200 | Success | Request completed successfully |
401 | Unauthorized | Missing API key, invalid key, or revoked key |
402 | Payment Required | Your subscription has lapsed — premium is required for API access |
404 | Not Found | The requested resource doesn't exist |
500 | Internal Server Error | Something went wrong on our end |
Common error scenarios
No API key provided
curl https://www.homeplatemeal.com/api/meal-plans/v1/current
{
"statusCode": 401,
"statusMessage": "Unauthorized - No API key provided. Include an X-API-Key header."
}
Invalid or revoked key
{
"statusCode": 401,
"statusMessage": "Unauthorized - Invalid or revoked API key"
}
Fix: Check your key is correct, or generate a new one from the your profile page page.
Subscription expired
{
"statusCode": 402,
"statusMessage": "API access requires a Premium subscription"
}
Fix: Renew your subscription at homeplatemeal.com.
Best practices
- Always check the HTTP status code before parsing the response body
- Handle
401errors by prompting the user to check their API key - Handle
402errors by linking to the subscription page - For
500errors, implement retry logic with exponential backoff