Common error codes in API

When an API request fails, TrainerCentral returns an error code to help you identify the cause of the failure. The error codes listed below are common across TrainerCentral APIs. Use these codes to identify and handle errors in your application. API-specific error codes are listed on the respective API documentation pages.

Error response format

When an API request fails, TrainerCentral returns a JSON response containing an error object. Use the code field to identify the error, as the HTTP status code and error message may change.

KeyDescription
uriRequest URI that failed.
codeStrError code name, for example MISSING_PARAMETER.
messageHuman-readable error message.
paramNameParameter that failed validation. Returned only for parameter errors.

Sample: parameter error

{
  "error": {
    "uri": "/tc/api/v1/trainer/courses.json",
    "codeStr": "MISSING_PARAMETER",
    "message": "The parameter course is missing",
    "paramName": "course"
  }
}

Sample: authentication error

{
  "error": {
    "uri": "/tc/api/v1/trainer/courses.json",
    "codeStr": "GENERAL_FAILURE",
    "message": "Sorry, we encountered an unexpected error. Please reload the page or try again later. If you continue to experience this problem, please contact \"support@trainercentral.com\"."
  }
}

Sample: server error

{
  "error": {
    "uri": "/tc/api/v1/trainer/courses.json",
    "codeStr": "GENERAL_FAILURE",
    "message": "Sorry, we encountered an unexpected error. Please reload the page or try again later. If you continue to experience this problem, please contact \"support@trainercentral.com\"."
  }
}

Error codes and reason

Error codeHTTP statusReasonSolution
GENERAL_FAILURE500An unexpected server error occurred.Retry the request. If the issue persists, contact support with the request details.
REMOTE_IP_LOCKED500Requests are temporarily blocked because the rate limit was exceeded repeatedly.Stop sending requests and retry after some time.
UNAUTHORISED_ACCESS500The user does not have permission to perform the requested operation.Ensure the user has the required permissions in the academy.
ACADEMY_OFFLINE500The academy is offline.Contact the academy admin to bring the academy online.
LOGIN_REQUIRED500Authentication is required to perform the requested operation.Authenticate the user and retry the request.
JSON_PARSE_ERROR400The request contains invalid JSON.Correct the JSON syntax and retry the request.
LESS_THAN_MIN_OCCURANCE400A parameter contains fewer entries than required.Provide at least the minimum number of entries required.
MISSING_PARAMETER400A required parameter is missing from the request.Include all the required parameters for the requested operation.
PATTERN_NOT_MATCHED400A parameter value is not in the expected type or format.Send the value in the type and format given in the API documentation.
EXTRA_KEY_FOUND_IN_JSON400The JSON body has a key that the API does not accept.Remove keys that are not listed in the API documentation.
LESS_THAN_MIN_LENGTH400A parameter value is shorter than the minimum allowed length.Provide a value that meets the minimum length requirement.
MORE_THAN_MAX_LENGTH400A parameter value exceeds the maximum allowed length.Shorten the value to meet the maximum length requirement.
MORE_THAN_MAX_OCCURANCE400A parameter contains more entries than allowed.Reduce the number of entries to the allowed limit.
EMPTY_VALUE_NOT_ALLOWED400A parameter contains an empty value.Provide a non-empty value or omit the parameter if it is optional.
INVALID_METHOD400The HTTP method used is not supported by the request URL.Use the HTTP method specified in the API documentation.
URL_RULE_NOT_CONFIGURED400The request URL is not a valid API endpoint.Verify the request URL against the API documentation.
FILE_SIZE_MORE_THAN_ALLOWED_SIZE400The uploaded file exceeds the allowed file size.Upload a file that meets the file size limit.
INVALID_VALUE_NOT_ALLOWED400A parameter contains a value that is not supported.Use one of the allowed values specified in the API documentation.
INVALID_OAUTHTOKEN401The OAuth access token is missing, invalid, or has expired.Generate a new access token and retry the request.
INVALID_OAUTHSCOPE401The access token does not have the scope required to access the API.Generate an access token with the scope specified in the API documentation.
THRESHOLD_LIMIT_EXCEED429The request limit for the API has been exceeded.Retry after 10 minutes and reduce the frequency of requests.
INVALID_PORTAL500The academy is disabled, closed, or does not exist.Provide the ID of an active academy.
INACTIVE_USER302The user is inactive in the academy.Activate the user in the academy or use an active user.
TRIAL_EXPIRED302The academy's trial period has expired.Upgrade to a paid plan.
FEATURE_NOT_AVAILABLE500The requested feature is not available under the current subscription plan or user role.Upgrade to a plan that supports the feature or use a user account with the required role.
PLAN_NOT_SUFFICIENT500The academy's subscription plan has been downgraded and no longer supports the requested operation.Upgrade to a subscription plan that supports the requested operation.
LIVE_THROTTLE_ERROR_COMMON500The same request was sent again while the previous request was still being processed.Wait for the previous request to finish processing before retrying.