All API requests will respond with an appropriate HTTP status code.
Your API client should handle each response class differently:
- 2XX codes are successful responses.
- 4XX codes are client error responses, meaning there was an error with the way the request was submitted, such as a missing parameter or invalid value. You should modify requests before retrying.
- 5XX codes are server error responses. There may be a temporary issue on the Samsara side, so you may want to retry after some delay. Please use exponential backoff as a retry model - see here for an example algorithm.
Here is a table of error codes that may help you debug. The error response body may include an error message, but do not hard-code against this message. We reserve the right to change the error message without auto-incrementing the API version. Only use error messages for debugging purposes.
|400||Bad Request - General client error, possibly malformed data.|
|401||Unauthenticated - The API key is missing or invalid.|
|404||Not Found - The API endpoint is invalid or a path parameter is missing or invalid (e.g. |
|405||Method Not Allowed - The API endpoint does not accept that HTTP method.|
|429||Too Many Requests - The client has reached or exceeded a rate limit, or the server is overloaded. See Rate Limits for suggestions on retry patterns.|
|5XX||Internal Server errors - something went wrong with Samsara's servers. These responses are likely momentary errors (e.g., temporary unavailability), and as a result, requests should be retried using exponential backoff. Note that the body of these responses will be strings and not JSON encoded.|
The API has a global timeout of 90 seconds.
Updated 5 months ago