Skip to main content
Version: FINAL-1.0.0

Errors

Bunny Studio API follows HTTP status code semantics.

200 codes indicate success, 400 mostly represent user errors, and 500 generally correspond to server errors. Error messages will return a JSON-encoded body that contains an object with information about the error. These will provide a specific error condition and a human-readable message to identify what caused the error.


An error will usually look like this:

{
status: XXX,
type: 'TYPE_OF_ERROR',
message: 'DESCRIPTION OF ERROR',
}

Success code

200 OK

Request completed successfully.

User error codes

These errors generally indicate a problem on the client side. If you encounter one of these errors, please check your code and the request details.

400 Bad request

The request encoding is invalid; the request can't be parsed as a valid JSON.

401 Unauthorized

You are trying to access a protected resource without authorization or with invalid credentials.

403 Forbidden

You are trying to access a protected resource with API credentials that don't have access to that resource.

404 Not found

The route or resource is not found. This error is returned when the request hits an undefined route or if the resource doesn't exist (e.g., has been deleted).

422 Unprocessable entity

The request was well-formed but could not be followed due to semantic errors.

Server error codes

These errors generally represent an error on our side.

500 Internal server error

The server encountered an unexpected condition.

502 Bad gateway

Bunny Studio's servers are restarting or an unexpected outage is in progress. Generally, you should not receive this error, and requests are safe to retry.

503 Service unavailable

The server could not process your request in time. It could be temporarily unavailable, or have timed out processing your request. You should retry the request with backoffs.

Authetication errors

If there's an issue with the token in a request that requires authentication, the API will return some of the following errors:

401 Not valid token

{
status: 401,
type: 'NOT_VALID_TOKEN',
message: 'Failed to authenticate token.',
}

401 Not token provided

{
status: 401,
type: 'NOT_TOKEN_PROVIDED',
message: 'Token is missing in headers',
}

401 User not found

{
status: 401,
type: 'USER_NOT_FOUND',
message: 'Please use a correct email and password',
}

401 User not API enabled

{
status: 401,
type: 'USER_NOT_API_ENABLED',
message: 'The user doesn't have API feature enabled',
}