Skip to main content

Errors

The CubeStack API uses standard HTTP status codes to indicate success or failure.

Error Response Format

{
  "error": "Error message describing what went wrong"
}

Common Status Codes

CodeDescription
200Success
201Created
400Bad Request — Invalid parameters or request body
401Unauthorized — Missing or invalid API key
403Forbidden — Insufficient permissions
404Not Found — Resource does not exist
409Conflict — Duplicate or constraint violation
429Too Many Requests — Rate limit exceeded
500Internal Server Error

Handling Errors

Always check the HTTP status code and parse the error message:
const response = await fetch(url, { headers });

if (!response.ok) {
  const { error } = await response.json();
  console.error(`API Error (${response.status}): ${error}`);
}
See Error Codes for a complete list of error codes.