Error codes
If the server can’t complete an API request, it returns a JSON response containing an error code:
{"error":<code>}
For some errors, the response also contains the reason field which explains the cause of the error:
{"error":<code>,"reason":<text>}
General error codes
| Error code | Description | reason field value |
|---|---|---|
| -100 | Internal error (network timeout). | |
| -101 | Internal error (wrong network response). | |
| 0 | Successful operation (for example, for logging out it’s a successful exit). | |
| 1 | Invalid session. | |
| 2 | Invalid API service name. | |
| 3 | Invalid result. The type library plugin isn’t enabled, the AVL Server item isn’t found, or the file isn’t found. | |
| 4 | Invalid input. The request contains a wrong parameter value or a wrong combination of parameters, or an object ID doesn’t identify an existing object within a container the user can access. | VALIDATE_PARAMS_ERROR: <text>: the parameters don’t match the scheme expected by the method, where <text> is the expected scheme. Returned by the methods which use the general parameter check.PARAMS_ERROR: <text>: the parameter check of the method failed, where <text> describes the cause.DRIVER_NOT_FOUND: the specified driver isn’t found in the resource (resource/driver_actions_list, resource/driver_actions_cleanup, resource/driver_actions_register, resource/bind_unit_driver).ROUTE_NOT_FOUND or ORDER_NOT_FOUND: the specified route or order isn’t found (order/route_update, order/optimize, order/update). |
| 5 | Error performing request. | EVENTS_ARE_DISABLED: the event subsystem is disabled for the requested detector (events/get_last, events/load, unit/get_events, resource/get_driver_bindings).EVENTS_ARE_INITIALIZING: the event subsystem is still initializing (resource/get_driver_bindings).TWILIO_REQUEST_FAILED: the Twilio HTTP request failed (accounts/get_twilio_templates).PARSING_ERROR or UNKNOWN_ERROR: the file can’t be parsed (exchange/convert_file). |
| 6 | Unknown error. In many cases the response doesn’t contain the reason field. |
UNKNOWN_ERROR: the request fails for an unspecified reason (unit/create_task, unit/update_task, gis_get_route, gis_get_many_to_many_route, gis_get_one_to_many_route, gis_get_route_via_waypoints).Internal server error: an internal session, storage, or response-building operation failed (various handlers).GET_MESSAGES_UNKNOWN_ERROR: the message manager can’t return data (resource/driver_actions_list, resource/driver_actions_cleanup, resource/driver_actions_register, resource/bind_unit_driver).BATCH_SINGLE_RESPONSE_TOO_LARGE: one of the responses in core/batch exceeds the response size limit set on the server.BATCH_RESPONSE_TOO_LARGE: the whole core/batch response exceeds the response size limit set on the server.Large response: the batch response can’t be added because the batch size limit is disabled.ERROR_CREATING_RESOURCE_DUE_TO_BILLING_RULES: the resource can’t be created according to the billing restrictions (core/create_resource).Internal error (http service unavailable): the internal HTTP client service isn’t available while a third-party authorization token is verified (user/bind_auth_service).Internal error (failed to connect to remote service): a connection to the authorization provider can’t be opened (user/bind_auth_service).Internal error (bad http response <code>): the authorization provider returns an HTTP status other than 200, where <code> is that status (user/bind_auth_service).Failed to parse remote response: the response of the authorization provider isn’t valid JSON (user/bind_auth_service). |
| 7 | Access denied. The current user or token doesn’t have the required access to the target item or operation, or a billing service required by the endpoint is disabled. In most cases the response doesn’t contain the reason field. |
USER_DISABLED: the user is disabled (token/login).Access denied: a billing service required by the endpoint is disabled for the user, for example, videomonitoring for videostorage_config, or billing_by_codes for the unit/get_billing_code and codes/* methods.Unauthorized user: there is no current user in the session (chat and driver session endpoints).Other endpoint-specific reasons are documented on the respective method pages. |
| 8 | Invalid username or password. All the following reason values are returned by token/login. |
TOKEN_USER_NOT_FOUND: the user GUID in the token doesn’t match any user.INVALID_AUTH_TOKEN: the token payload can’t be parsed.INVALID_AUHT_TOKEN: the session can’t be initialized from the token. OPERATE_AS_USER_NOT_FOUND: <login>: the user specified in the operateAs parameter doesn’t exist.OPERATE_AS_USER_NO_ACCESS: <login>: the token owner has no OPERATE_AS access right to the specified user, or the user isn’t in the list of items available for the token.SOME_LOGIN_PROBLEMS: the session for the specified user can’t be created for an unspecified reason. |
| 9 | Authorization server unavailable. In many cases the response doesn’t contain the reason field. |
INTERNAL_ERROR: the top account of the current user can’t be found (user/share_billing_code, user/unshare_billing_code). |
| 10 | Too many requests of the same kind are processed at the same time, for example, 5 simultaneous recalculations. In core/batch, if the flags parameter is 1, the requests which follow the first error aren’t run. Each of them returns error 10 without the reason field. |
ERROR: simultaneous recalculations limit (<limit> simultaneuos recalculations) reached, where <limit> is the allowed number of recalculations (admin/recalculate_history). |
| 11 | Password reset error. In some cases the response doesn’t contain the reason field. All the following reason values are returned by core/reset_password_request. |
USER_OR_EMAIL_NOT_CORRECT: the user doesn’t exist, or the email address doesn’t match the one specified for the user.PASSWORD_IMMUTABLE: the password of the user can’t be changed.REQUEST_TOO_OFTEN: less than a minute passed since the previous password reset request. |
| 12 | Agro subsystem not loaded. | |
| 14 | A billing service required by the method isn’t available. | Video service is not available: the video service isn’t enabled for the account of the user or for its parent accounts (user/get_video_units). |
| 1001 | No messages for the selected interval. | |
| 1002 | The item can’t be created because an item with the same name already exists, because of the billing restrictions, or because the specified identifier is already in use. | NAME_ALREADY_EXISTS: an item with the same name already exists (core/create_resource, core/create_user).ERROR_CREATING_RESOURCE_DUE_TO_BILLING_RULES: the resource can’t be created because of the billing restrictions (core/create_resource).ERROR_CREATING_USER_DUE_TO_BILLING_RULES: the user can’t be created because of the billing restrictions (core/create_user).User already exists: the third-party authorization identifier is already bound to another user (user/bind_auth_service). |
| 1003 | A limit is reached, or the request can’t be processed at the moment. | LIMIT <rule_name>: the specified limit is reached, for example, LIMIT api_concurrent or LIMIT invalid_logins (avl_evts, core/login, core/use_auth_hash, core/check_unique, token/login, token/update, report/apply_report_result).LOCKER_ERROR: an internal error of the service which counts the limits. Returned by the same methods, as well as by user/update_password and user/verify_code.LAYERS_MAX_COUNT: the limit of 50 message layers is reached (render/create_messages_layer).NO_SESSION: a new session can’t be created (core/login, core/duplicate).Accept-Encoding is not gzip: the request doesn’t use gzip encoding (messages/load_interval). |
| 1004 | A message limit is reached. | LIMIT msgs_count: the limit of loaded messages is reached (messages/load_interval, render/create_messages_layer, report/apply_report_result).LIMIT msgs_activity: the limit of messages loaded within a period of time is reached (report/apply_report_result).EXCEEDS_LIMIT_MSGS_COUNT: the number of messages requested in the loadCount parameter exceeds the maximum allowed for the method (messages/get_task_messages). |
| 1005 | The report execution time exceeded the limit (report/exec_report), or the hardware configuration is wrong (unit/update_hw_params). |
|
| 1006 | A limit related to the password or to the two-factor authorization code is reached. | LIMIT <rule_name> for password update: too many attempts to update the password (user/update_password).LIMIT <rule_name> for verify code: too many attempts to enter the two-factor authorization code (user/verify_code). |
| 1011 | Your IP has changed, or the session has expired. |
Item transfer error codes
The following codes are returned when an item is moved to another resource or account. Codes 2001..2013 are returned by account/change_account.
| Error code | Description |
|---|---|
| 2001 | Wrong item or target_resource. |
| 2002 | The target_resource isn’t an account. |
| 2003 | Wrong target plugin. |
| 2004 | The target account is blocked. |
| 2005 | Invalid creator of the target_resource. |
| 2006 | The target_creator doesn’t have access to the item. |
| 2007 | Wrong source resource. |
| 2008 | The item is already in the target_resource. |
| 2009 | The target_resource is owned by a different top user. |
| 2010 | The target account doesn’t have enough resource quota to accept the item. |
| 2011 | Wrong item plugin. |
| 2012 | Error changing the billing account item to target_resource. |
| 2013 | Error changing the item creator. |
Other item and sensor errors
| Error code | Description |
|---|---|
| 2014 | The selected user is the creator of some system objects, so this user can’t be assigned to a new account (core/create_resource). |
| 2015 | The sensor can’t be deleted because it’s used in another sensor (as a validation sensor) or in advanced unit properties (motion state sensor, sensors colors, monitoring sensor) (unit/update_sensor). |