Error Handling in Sheet2DB API

When making requests to the Sheet2DB API, if something goes wrong, the API will return a structured error response. This helps you understand what went wrong and how to fix it.

All error responses follow a consistent format and include:

{
  "success": false,
  "error": "<error message>"
}

📘 Error Response Format

FieldTypeDescription
successBooleanAlways false for error responses
errorStringA human-readable message describing the error

📑 Types of Errors

1. HTTP Errors (Status Codes: 4xx, 5xx)

If you send an invalid request (e.g., a missing resource or unauthorized access), you may receive an HTTP error response.

Example:

GET /d/invalid-id

Response:

{
  "success": false,
  "error": "Not Found"
}

These errors will carry the appropriate HTTP status code, such as 400, 401, 404, etc.


2. Validation Errors (Status Code: 400)

If your request body or query parameters are invalid (e.g., missing required fields or incorrect data types), the API will return a 400 Bad Request with details from the validation.

Example:

{
  "success": false,
  "error": "Field 'name' is required, Field 'email' must be a valid email"
}

3. Internal Server Errors (Status Code: 500)

If something goes wrong on our end, you’ll receive a 500 Internal Server Error.

Response:

{
  "success": false,
  "error": "Internal Server Error"
}

💡 Tip: If you encounter this type of error repeatedly, please contact our support team.

📞 Need Help?

If you're not sure how to fix an error, feel free to contact our support with the full error response. We're here to help!