Data and Errors

Standard success and error formats

When interacting with the Drift API, we'll follow some standardized conventions for success and error responses.

Success 👍

Happiness, money, fame, and more? The Drift API will return a top-level data field for successful responses. Sometimes we'll return metadata fields like "pagination" on the top-level as well, but generally the objects you care about will be inside data.

  "data": {

Errors 👎

Whether we've made a mistake or you've made a mistake, any errors should be inside a top-level error field. This field has a type which is one of several defined types and a message which is human readable.

  "error": {
    "type": some_error,
    "message": "Oh no!"

Here are the errors you can expect to receive from the Drift API:

TypeHTTP codeDescription
validation_error 400One or more fields are invalid
authentication_error403Missing proper authorization
not_found404The requested resource was not found
internal_error500Something went wrong in our system
rate_limit429You have maxed your number of API calls for the provided time window