Errors

Overview

The API returns two categories of errors with different response shapes: HTTP errors and GraphQL errors.

HTTP errors

HTTP errors are returned before GraphQL execution with a standard JSON body. The id field identifies the error type.

401 Unauthorized

Returned when the request is missing credentials or the API key is invalid, expired, or revoked.

{
  "title": "Unauthorized. Please include your API credentials",
  "id": "unauthorized",
  "status": 401
}

429 Too Many Requests

Returned when the rate limit is exceeded. Check the Retry-After header for when to retry.

{
  "title": "Too many requests",
  "id": "too_many_requests",
  "detail": "Too many requests",
  "status": 429
}

GraphQL errors

GraphQL errors are returned in the response errors array.

400 Bad request

Returned when the request body is not valid JSON.

{
  "errors": [
    {
      "message": "json request body could not be decoded: invalid character 'n' looking for beginning of object key string body:{not json"
    }
  ],
  "data": null
}

422 Validation error

Returned when the query references a field that does not exist.

{
  "errors": [
    {
      "message": "Cannot query field \"example\" on type \"Network\".",
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ],
  "data": null
}

422 Empty query

Returned when the query string is empty.

{
  "errors": [
    {
      "message": "no operation provided",
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ],
  "data": null
}

200 Unauthorized error

Returned when the query references a resource that does not exist or that you do not have access to.

{
  "errors": [
    {
      "message": "",
      "extensions": {
        "code": "UNAUTHORIZED"
      }
    }
  ],
  "data": null
}

Need help?

If you run into any issues or have questions, please reach out to our Support Engineering team by opening a ticket via the Dashboard: https://dashboard.meter.com/support

Was this helpful?