Lokalise uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 3xx indicate redirects. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Lokalise servers (these are rare).

200 - OKEverything worked as expected.
208 - Already ReportedThe posted resource was already added.
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter.
401 - UnauthorizedNo valid API key provided.
403 - ForbiddenAuthenticated user is not granted to perform requested action.
404 - Not FoundThe requested resource does not exist.
406 - Not AcceptableThe posted resource is malformed or broken.
409 - ConflictThe request conflicts with another request (perhaps due to using the same idempotent key).
429 - Too Many RequestsToo many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502, 503, 504 - Server ErrorsSomething went wrong on Lokalise end. (These are rare.)

The Error object

Regular API endpoints return an error object with the following fields:

  • code (number) — error code.
  • message (string) — custom error message providing additional information.

For example:

    "message": "Not Found",
    "code": 404

Some bulk actions may return errors in a slightly different format. For example, if you are creating multiple translation keys, and one of the keys could not be created, you'll get the following response:

  "project_id": "803826145ba90b42d5d860.46800099",
  "keys": [
    // ...
  "errors": [
      "message": "This key name is already taken",
      "code": 400,
      "key_name": {
        "ios": "searching:results:nothing_found",
        "android": "searching:results:nothing_found",
        "web": "searching:results:nothing_found",
        "other": "searching:results:nothing_found"

OTA endpoints

Please note that the OTA endpoints return a slightly different object:

  • errorCode (string) — machine-readable code, allowing to uniquely identify the type of an error that has occurred.
  • message (string) — human-readable error message providing additional information.
  • details (object) — optional field and may contain any subfields, providing additional information about the error.

Here's an example of a single error returned by the OTA endpoints:

  message: 'Token has expired',
  errorCode: '002_TOKEN_EXPIRED',
  details: {
    someDetails: 'Some additional info if you need it'

Multiple errors:

  message: 'This is a human-readable error message',
  errorCode: '001_INVALID_PARAMS',
  details: {
    errors: [
        fieldName: "userPhoneNr"
        error: "VALUE_TOO_SHORT"