Skip to content

Exceptions and Errors

In addition to the 40x and 50x headers, error responses come with the name of the exception generated internally by the API server. You can define corresponding exceptions in your language or library, and raise them by doing a switch on the returned exception name.

Example

HTTP/1.1 500 Server error
Content-Type: application/json

{
  "Status": "Failed",
  "message": "Error message",
  "errorType": "GeneralException"
}

Exceptions

Value Description
TokenException Preceded by a 403 header, this indicates the expiry or invalidation of an authenticated session. This can be caused by the user logging out, a natural expiry, or the user logging into another Kite instance. When you encounter this error, you should clear the user's session and re-initiate a login.
UserException Represents user account related errors
OrderException Represents order related errors such placement failures, a corrupt fetch etc
InputException Represents missing required fields, bad values for parameters etc.
NetworkException Represents a network error where the API was unable to communicate with the OMS (Order Management System)
DataException Represents an internal system error where the API was unable to understand the response from the OMS to in turn respond to a request
GeneralException Represents an unclassified error. This should only happen rarely

Common HTTP error codes

Codes Description
400 Missing or bad request parameters or values
403 Session expired or invalidate. Must relogin
404 Request resource was not found
405 Request method (GET, POST etc.) is not allowed on the requested endpoint
410 The requested resource is gone permanently
429 Too many requests to the API (rate limiting)
500 Something unexpected went wrong
502 The backend OMS is down and the API is unable to communicate with it
503 Service unavailable; the API is down
504 Gateway timeout; the API is unreachable

API Rate Limit

Coming Soon