Errors and status codes
In this guide, we will talk about what happens when something goes wrong while you work with the API. Let's look at some status codes and error types you might encounter.
You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging.
Categories
Here is a list of the different categories of status codes returned by SheetDB. Use these to understand if a request was successful.
- Name
2xx- Type
- Description
A 2xx status code indicates a successful response.
- Name
4xx- Type
- Description
A 4xx status code indicates a client error — this means it's a you problem.
- Name
5xx- Type
- Description
A 5xx status code indicates a server error — you shouldn't be seeing these.
Status codes
- Name
200 OK- Type
- Description
The request has succeeded for GET, PATCH and DELETE requests.
- Name
201 Created- Type
- Description
The request has succeeded for POST requests.
- Name
400 Bad Request- Type
- Description
The API could not understand the request. There is probably something wrong with the data format. Each endpoint has its own guidelines.
- Name
401 Unauthorized- Type
- Description
An error with Google account authentication or you have entered an incorrect Barer token / Basic Auth credentials.
- Name
402 Payment Required- Type
- Description
Payment is required to process the request. Occurs when you try to make a request that requires a higher plan.
- Name
403 Forbidden- Type
- Description
Action is forbidden.
- Name
404 Not Found- Type
- Description
The server did not find anything matching the request. Possible responses:
{"error": "Wrong API id"}- the API ID in the URL does not exist.{"error": "Sheet not found."}- thesheetattribute points to a sheet (tab) that does not exist, see Multiple sheets.{"error": "Undefined column: x"}- the column used in a search, update or delete query does not exist in the first row.{"error": "No results found"}- an update or delete query did not match any row. Search returns an empty array with status 200 in this case.
- Name
405 Method Not Allowed- Type
- Description
You are probably using the wrong method for url endpoint.
- Name
429 Too Many Requests- Type
- Description
You have exceeded either the request limit of your plan or the rate limit of the API (90 requests per minute, shared by all clients of that API). Learn more about both limits here.
- Name
500 Internal Server Error- Type
- Description
We had a problem. Try again later.
- Name
1015 Rate limit- Type
- Description
An error page from Cloudflare, shown when one client sends an abnormal burst of requests. Wait a minute and try again. The rate limit of the API itself returns
429, see above.