Get API Key
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

CodeMeaningWhen it happens
200SuccessRequest completed successfully
401UnauthorizedMissing API key, invalid key, or revoked key
402Payment RequiredYour subscription has lapsed — premium is required for API access
404Not FoundThe requested resource doesn't exist
500Internal Server ErrorSomething 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 401 errors by prompting the user to check their API key
  • Handle 402 errors by linking to the subscription page
  • For 500 errors, implement retry logic with exponential backoff