Errors

This guide outlines potential issues when interacting with the API and their corresponding status codes. Errors can occur, often on the user's end. We'll explore various error types you may come across.

Receive a clear indication of your request's success through the status code in an API response. Unsuccessful responses are accompanied by an error type and message, aiding in initial troubleshooting efforts.


Status codes

The BREVIAN API status codes are indicators of your request's outcome. Utilize them to gauge the success of each call.

  • Name
    2xx
    Description

    A 2xx status code indicates a successful response.

  • Name
    4xx
    Description

    A 4xx status code signals an issue with the client's request regarding API Key usage, typically implying incorrect usage or an error on the client's side.

  • Name
    5xx
    Description

    A 5xx status code signals a server issue. Reach out to [email protected] if you encounter this.


Error types

In the event of a request not going through, expect the BREVIAN API to deliver an error response, complete with an error type and a message to guide you through the resolution process. Rest assured, the error messages are designed to be clear and useful, aiding you in taking corrective action.

Here is a list of the two error types supported by the BREVIAN API — use these to understand what you have done wrong.

  • Name
    Missing JWT Token
    Description

    Indicates that the JWT token was not provided in the request.

  • Name
    Invalid JWT Token
    Description

    Signifies that the provided JWT token could not be verified.

  • Name
    JWT Token Missing fields
    Description

    Indicates that the decoded JWT token is missing required fields (audience or subject). The JWT token was most likely tampered with.

  • Name
    JWT Token expired
    Description

    Denotes that the JWT token has expired.

  • Name
    Invalid jti value
    Description

    Suggests that the jti value in the JWT token does not match any valid API key.

  • Name
    Rate limit exceeded
    Description

    Indicates that the request has exceeded the rate limit associated with the API key.

  • Name
    Invalid permissions
    Description

    Indicates that the API key does not have the necessary permissions to perform the requested action.

Error response

{
  "error": "Invalid permissions.",
}

Was this page helpful?