Skip to main content

Error handling

This page covers how the Zooza API communicates errors and how to troubleshoot common issues.


Response format

When an error occurs, the API returns a JSON response with error details. Example:

{
"error": "unauthorized",
"message": "Invalid or expired token"
}

HTTP status codes

Status codeMeaningDescription
200OKRequest succeeded
400Bad requestInvalid request body or parameters
401UnauthorizedMissing or invalid authentication headers
403ForbiddenValid credentials but insufficient permissions
404Not foundResource does not exist
422Unprocessable entityRequest is well-formed but contains invalid data
429Too many requestsRate limit exceeded
500Internal server errorSomething went wrong on Zooza's side

Common error scenarios

Authentication errors

SymptomCauseSolution
401 on every requestMissing X-ZOOZA-API-KEY headerAdd your API key header to all requests
401 after working previouslyToken expired or invalidatedRe-authenticate to obtain a new token
401 on API endpointsUsing a widget API key instead of a REST API keyWidget keys cannot be used for REST API calls — contact support for a REST API key
403 on specific endpointsUser role lacks permissionCheck user permissions, use an Owner-role account for full access
401 with valid credentialsWrong API regionVerify your base URL matches your account's region (see API regions)

Widget errors

Common widget integration issues:

  • Widget not loading: Check that the API key is correct and the script tag is properly embedded.
  • CORS errors in browser console: Ensure your domain is registered in the widget group settings.
  • Widget shows no data: Verify that your Zooza account has active programmes and classes.

Registration errors

Registration and booking errors may occur when:

  • The class is at full capacity
  • The registration period has closed
  • Required customer fields are missing
  • Payment validation fails

Debugging tips

  1. Check browser DevTools (for widgets) — look at the Network tab for failed requests and their response bodies.
  2. Log full response bodies — error messages often contain specific details about what went wrong.
  3. Verify your API region — make sure your base URL matches your account's region (see regions).
  4. Check application type — Widget keys cannot access admin endpoints. Verify your key type matches the endpoints you're calling.
  5. Test with cURL first — isolate whether the issue is in your code or in the API request itself.