HTTP Response Status Codes
Overview
This document provides a comprehensive overview of the HTTP response status codes return by Memfault's API, including their meanings, causes, and recommended client handling.
HTTP Codes
Status Code | Name | Description | Retry Behavior |
---|---|---|---|
2xx Success Codes | |||
200 | Success | The request was successful. If an action was requested, it was performed synchronously. Data has been returned. | Do not retry |
202 | Accepted | The request was successful. If an action was requested, it is performed asynchronously. | Do not retry |
204 | No Content | The request was successful. If an action was requested, it was performed synchronously. There is no data returned. | Do not retry | 4xx Error Codes |
400 | Bad Request | The server can not process the request due to a client error. Please refer to API documentation, or contact us. | Do not retry |
401 | Unauthorized | The client is not authenticated or has missing credentials in the request. | Do not retry |
403 | Forbidden | Access to this resource has not been granted. Can also be a result of a quota limit or Memfault plan. | Do not retry |
405 | Method Not Allowed | The route or method implementation does not exist. | Do not retry |
409 | Conflict | A duplicate resource exists. | Do not retry |
429 | Too Many Requests | The rate limit has been hit. | Do not retry. If | 5xx Success Codes |
500 | Internal Server Error | This shouldn't happen! If seen, please contact us. | Do not retry |
502 | Bad Gateway | This shouldn't happen! If seen, please contact us. | Retry with exponential backoff |
503 | Service Unavailable | Memfault is down for maintenance. | Retry with exponential backoff |
504 | Gateway Timeout | The request took too long. If seen, please contact us. | Retry with exponential backoff |
Retries With Exponential Backoff
For HTTP requests identified for retry in the table above, Memfault recommends up to five retry attempts with an exponential backoff of seconds between attempts (where is the retry number). The example retry strategy follows.
Retry Attempt | Wait Time (seconds) |
---|---|
1 | 8 |
2 | 64 |
3 | 512 |
4 | 4096 |
5 | 32,768 |