Skip to main content

api v2 error handling

API V2 uses following HTTP status codes to indicate success or failures:

Status code Explanation
200 OK Success.
400 Bad Request Missing or invalid request parameters.
401 Unauthorized Authorization is required but no API key provided.
403 Forbidden Invalid API key, no permissions to given resource (e.g. it belongs to another user), resource disabled by administrator.
404 Not Found Resource does not exists.
405 Method Not Allowed Resource exists but given method cannot be used on it, e.g. POST to a read-only trading pairs list, using an endpoint that cancels a withdrawal on transaction that is a deposit or internal transfer.
406 Not Acceptable Request parameters are valid but cannot be accepted, e.g. trying to withdraw coin using valid network, but not associated with given coin, trying to withdraw greater amount than account balance.
409 Conflict There is a conflict of data that should be unique, e.g. trying to create API key with the same name as existing one.
500 Internal Server Error

Internal error on the Infinex backend. Please try the request again, preferably with some delay.

504 Gateway Timeout

One of the backend services received your request but did not respond in any way. The execution status is unknown and could have been a failure as good as a success. This should be verified preferably after some time has passed.

511 Network Authentication Required

2FA is required. You should repeat the request with identical parameters and 2FA code attached.

For any status except 200, the response body contains the error payload like this:

{
    "error": {
        "code": "INTERNAL_SERVER_ERROR",
        "msg": "Internal server error"
    }
}

The code field contains an unique, constant error code which can be used to catch the specific error.

TheĀ msg field contains a human-readable error message, which may be updated by Infinex developers without any notice, so it should not be parsed or used for any purposes other than displaying it to the user in unmodified form.