Skip to main content
The Doozy API is currently in closed beta. To request access, please email [email protected].

Error Response Format

When an error occurs, the API returns a JSON response with an error object containing a code and message:
{
  "error": {
    "code": "invalid_key",
    "message": "Invalid API key."
  }
}

Error Codes

HTTP StatusError CodeDescription
400bad_requestThe request was malformed or missing required parameters
401invalid_keyThe API key is missing, invalid, or has been revoked
403forbiddenThe API key doesn’t have permission to access this resource
404not_foundThe requested resource doesn’t exist or you don’t have access to it
429rate_limitedYou’ve exceeded the rate limit of 1,000 requests per hour
500internal_errorAn unexpected error occurred on our servers

Handling Errors

Invalid API Key (401)

{
  "error": {
    "code": "invalid_key",
    "message": "Invalid API key."
  }
}
Causes:
  • The API key is missing from the request
  • The API key format is incorrect
  • The API key has been revoked or deleted
Solution: Verify your API key is correct and included in the x-api-key header.

Forbidden (403)

{
  "error": {
    "code": "forbidden",
    "message": "You do not have permission to access this resource."
  }
}
Causes:
  • Your user account doesn’t have permission to access this resource
  • You were removed as an admin/manager from the quiz or survey
Solution: Check your permissions in the Doozy dashboard. If you were recently removed from a resource, you’ll need to be re-added to regain API access.

Not Found (404)

{
  "error": {
    "code": "not_found",
    "message": "Resource not found."
  }
}
Causes:
  • The resource ID is incorrect
  • The resource has been deleted
  • You don’t have access to view this resource
Solution: Verify the resource ID and your permissions.

Rate Limited (429)

{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Please try again later."
  }
}
Causes:
  • You’ve exceeded 1,000 requests per hour
Solution: Wait before making additional requests. Implement exponential backoff in your integration:
async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);
    
    if (response.status === 429) {
      // Wait 60 seconds before retrying
      const waitTime = 60 * 1000 * Math.pow(2, attempt);
      await new Promise(resolve => setTimeout(resolve, waitTime));
      continue;
    }
    
    return response;
  }
  throw new Error('Max retries exceeded');
}
If you consistently hit rate limits, consider caching responses or reducing request frequency. Contact [email protected] if you need higher limits.

Internal Error (500)

{
  "error": {
    "code": "internal_error",
    "message": "An unexpected error occurred."
  }
}
Causes:
  • An unexpected error on our servers
Solution: Retry the request after a short delay. If the issue persists, contact [email protected].