Response Codes

These are the most common server responses you will encounter when using the Fleetio API.

Status Code

Description

200 OK

Everything went as expected! Used on index and show actions.

201 Created

Used on create actions. A 201 means that a record was created successfully. Check the location header for the url of the newly created object.

204 No Content

Denotes that an action was successful, but the API does not need to return any data. Used on update and delete actions.

401 Unauthorized

Your credentials syntax is not correct, or your credentials are invalid. The response body will be "HTTP Token: Access denied". If you are getting this error, please review the Getting Started guide.

403 Forbidden

You are trying to access an endpoint for which the user associated with your API key does not have permissions to access. There will not be anything in the response body. If you are getting this error, please check that the endpoint is correct and check the permissions of the user and be sure they can actually do the action you are attempting. You can learn more in the Help Center article about User Roles & Permissions as well as the Full Permissions Reference.

422 Unprocessable Entity

This is returned if a record cannot be created or updated, usually due to validation errors. If you receive this response code check the response body for error messages.

This hash will have one key for each field with errors. Each field will have an array of human readable error messages, as shown below:

{
  "errors": {
    "name": [
      "can't be blank"
    ],
    "meter_unit": [
      "can't be blank",
      "is not a valid value. Please specify one of the predefined values for this field."
    ]
  }
}

429 Too Many Requests

The Fleetio API implements a simple throttle of 20 requests per minute. Large customers can request an increase to this throttle limit if their data set warrants the need for more requests each minute. Exceeding the set limit will result in this response code. The response body will be "Too many requests detected from your IP. Please try again later. If you believe this is an error, please contact Fleetio Support at [email protected]". The response will also include a Retry-After header whose value represents the number of seconds until the rate limit has been lifted. For example, Retry-After: 60 means that you need to wait 60 seconds before making another request to the Fleetio API.

500 Internal Server Error

Ideally you should never see this, but if you do, you've probably found a bug. Yes it's true, we make bugs too. We have automated monitoring of these errors, and we try to fix them proactively, but if its a problem and its messing up your day, please tell us about it. It is also possible that our servers are down, so be sure to check out our System Status page for information about our servers and their current health.