Docs · API reference

Sleekdocs Translate API

Every call, the scope it needs, its parameters, and what it answers.

Overview

Read and change translations from scripts, build pipelines and AI agents.

Sign requests with a personal API key, created on the API keys page in Sleekdocs Translate: Authorization: Bearer sdt_…. A key acts as the person who made it, with the scopes chosen for it, and never more than that person's role in the team allows. Each operation lists the scope it needs.

Texts written through the API land in the working copy, unpublished, as edits in the app do. Publish and deploy to release them.

Every answer is JSON. Data comes in {"data": …}; an error in {"errors": ["CODE"]}. Each key may make 120 requests a minute.

The paths under /v1 are stable: fields may be added, but nothing is removed or renamed without a /v2.

Every path below starts at https://translate.sleekdocs.com/api. Create a key on the API keys page in Sleekdocs Translate; the docs explain scopes and show a few calls end to end.

Machine-readable: the OpenAPI description this page is built from, for code generators and AI agents.

Errors

An error answers with an HTTP status and, where there is one, a code: {"errors": ["FORBIDDEN"]}.

Error statuses
StatusWhen
400The request is not valid: INVALID_PARAMETER, REQUIRED_PARAMETER_MISSING, INVALID_FILE_FORMAT, or KEY_LIMIT_REACHED when a project on the Free plan would get more than 1,000 keys.
401No API key, or one that is unknown, expired or revoked.
403The key lacks the scope, its owner the role or deploy right, or the project belongs to another team or is outside the key's project.
404No such project, language or key.
429More than 120 requests in a minute with this key. Wait and try again.

Account

Who the caller is and what the key may do.

Who am I

GET /v1/api/translate/me Any key

The caller, and for an API key its team, scopes, project limit and expiry. Use it to check what a key may do before trying.

Answer

{
  "data": {
    "user": {
      "uuid": "e8767d89-28db-4305-895e-4129f4f299b3",
      "email": "anna@example.com",
      "name": "Anna Berg"
    },
    "team": {
      "uuid": "1dd96084-3b09-4098-8bf1-b6348362e98e",
      "name": "Example AB"
    },
    "key": {
      "uuid": "e45739df-487b-4448-bdd4-af9359f5836d",
      "name": "CI pipeline",
      "scopes": [
        "read",
        "write"
      ],
      "projectUuid": "d6523c38-886e-47b4-9542-e7ba062d1078",
      "expiresAt": "2026-11-14T19:33:45Z"
    }
  }
}

Projects

The team's projects and their languages.

List projects

GET /v1/api/translate/projects Scope read

The projects in the caller's team, with how much of each language is translated. An API key lists its own team, or only its project if it is limited to one; a signed-in user names the team with team.

Parameters
ParameterInDescription
teamquery, optionalThe team, for a signed-in user. An API key always uses its own team.

Answer

{
  "data": [
    {
      "uuid": "d6523c38-886e-47b4-9542-e7ba062d1078",
      "name": "Storefront",
      "primaryLanguage": "en",
      "keys": 387,
      "languages": [
        {
          "code": "en",
          "name": "English",
          "primary": true,
          "translated": 387,
          "untranslated": 0
        },
        {
          "code": "sv",
          "name": "Swedish",
          "primary": false,
          "translated": 382,
          "untranslated": 5
        }
      ]
    }
  ]
}

Get a project

GET /v1/api/translate/projects/{projectUuid} Scope read

A project's languages and counts, each language's latest revision and unpublished changes, and which revision is deployed in each environment.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.

Answer

{
  "data": {
    "uuid": "d6523c38-886e-47b4-9542-e7ba062d1078",
    "name": "Storefront",
    "primaryLanguage": "en",
    "fileFormat": "JSON_FLAT",
    "keys": 387,
    "languages": [
      {
        "code": "en",
        "name": "English",
        "primary": true,
        "translated": 387,
        "untranslated": 0,
        "latestRevision": 18,
        "unpublishedChanges": 0,
        "deployed": {
          "DEV": 18,
          "TEST": 18,
          "PROD": 17
        }
      },
      {
        "code": "sv",
        "name": "Swedish",
        "primary": false,
        "translated": 382,
        "untranslated": 5,
        "latestRevision": 10,
        "unpublishedChanges": 3,
        "deployed": {
          "DEV": 10,
          "TEST": 10,
          "PROD": 10
        }
      }
    ]
  }
}

Keys and texts

Read and change keys and texts in the working copy.

List keys and texts

GET /v1/api/translate/projects/{projectUuid}/keys Scope read

Every key with its texts in the working copy, optionally filtered by language, status and a search.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.
langquery, optionalLanguage codes to include, comma-separated, such as en,sv. Default: all.
statusquery, optionalOnly keys that are untranslated, the same as the primary language, or changed since the latest publish, in at least one of the languages. Values: untranslated, same-as-primary, changed.
qquery, optionalOnly keys whose name or texts contain this, ignoring case.

Answer

{
  "data": [
    {
      "key": "checkout.title",
      "values": {
        "en": "Checkout",
        "sv": "Kassa"
      }
    },
    {
      "key": "checkout.pay_now",
      "values": {
        "en": "Pay now",
        "sv": null
      }
    }
  ]
}

Add or update keys and texts

PATCH /v1/api/translate/projects/{projectUuid}/keys Scope write

Adds or updates up to 1,000 keys and their texts in the working copy, in one call. upsert adds new keys and changes texts; create-only adds new keys and leaves existing ones alone. With dryRun nothing is written and the answer says what would change. A null text leaves that language as it is. Adding keys also needs the keys scope.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.

Request body

{
  "mode": "upsert",
  "dryRun": false,
  "items": [
    {
      "key": "checkout.title",
      "values": {
        "en": "Checkout",
        "sv": "Kassa"
      }
    },
    {
      "key": "cart.empty",
      "values": {
        "sv": "Din varukorg är tom"
      }
    }
  ]
}

Answer

{
  "data": {
    "dryRun": false,
    "created": [
      "checkout.title"
    ],
    "updated": [
      "cart.empty"
    ],
    "unchanged": [
      "account.sign_out"
    ],
    "skipped": []
  }
}

Rename a key

POST /v1/api/translate/projects/{projectUuid}/keys/rename Scope keys

Renames a key in every language, keeping its texts.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.

Request body

{
  "from": "checkout.title",
  "to": "checkout.heading"
}

Answer

{
  "data": {
    "key": "checkout.heading"
  }
}

Delete a key

DELETE /v1/api/translate/projects/{projectUuid}/keys/{key} Scope keys

Deletes a key and its texts in every language.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.
keypath, requiredThe key, URL-encoded.

Answer

{
  "data": null
}

Files and revisions

Whole language files, imports and comparisons.

Download a file

GET /v1/api/translate/projects/{projectUuid}/languages/{languageCode}/file Scope read

A language as a JSON file, the same shape your app loads from the CDN. By default the working copy in the project's file format.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.
languageCodepath, requiredA language code in the project, such as sv.
formatquery, optionalflat or nested. Default: the project's file format. Values: flat, nested.
revisionquery, optionalworking (the default), latest for the latest published revision, or a revision number.

Answer

{
  "checkout.title": "Kassa",
  "checkout.pay_now": "Betala nu"
}

Import a file

PUT /v1/api/translate/projects/{projectUuid}/languages/{languageCode}/file Scope write

Imports a JSON file, nested or flat, into a language's working copy. update changes the texts in the file and leaves the rest; replace also removes texts for keys the file doesn't have. With dryRun nothing is written. The answer lists the changes. A file that adds keys also needs the keys scope.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.
languageCodepath, requiredA language code in the project, such as sv.
modequery, optionalupdate (the default) or replace. Values: update, replace.
dryRunquery, optionalOnly report what would change.

Request body

{
  "checkout": {
    "title": "Kassa",
    "pay_now": "Betala nu"
  }
}

Answer

{
  "data": {
    "dryRun": false,
    "mode": "UPDATE",
    "changes": {
      "nCreated": 1,
      "nUpdated": 0,
      "nDeleted": 0,
      "nUnchanged": 1,
      "nNewKeys": 1,
      "created": [
        {
          "key": "checkout.title",
          "oldValue": "",
          "newValue": "Kassa",
          "newKey": true
        }
      ],
      "updated": [],
      "deleted": []
    }
  }
}

Compare revisions

GET /v1/api/translate/projects/{projectUuid}/languages/{languageCode}/diff Scope read

What was added, changed and removed between two revisions of a language, or between a revision and the working copy. By default, from the latest published revision to the working copy: what publishing would release.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.
languageCodepath, requiredA language code in the project, such as sv.
fromquery, optionalworking, latest (the default) or a revision number.
toquery, optionalworking (the default), latest or a revision number.

Answer

{
  "data": {
    "nCreated": 1,
    "nUpdated": 1,
    "nDeleted": 0,
    "nUnchanged": 380,
    "nNewKeys": 0,
    "created": [
      {
        "key": "account.orders",
        "oldValue": "",
        "newValue": "Mina beställningar",
        "newKey": false
      }
    ],
    "updated": [
      {
        "key": "checkout.pay_now",
        "oldValue": "Betala",
        "newValue": "Betala nu",
        "newKey": false
      }
    ],
    "deleted": []
  }
}

Releases

Publish revisions and deploy them to the CDN.

Publish languages

POST /v1/api/translate/projects/{projectUuid}/publish Scope publish

Saves each chosen language's working copy as its next revision. "changed" (the default) publishes every language with unpublished changes; or list language codes. Languages without changes are skipped. The key's owner also needs a deploy right in the team.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.

Request body

{
  "languages": "changed"
}

Answer

{
  "data": {
    "published": [
      {
        "language": "sv",
        "revision": 11
      }
    ],
    "skipped": [
      {
        "language": "en",
        "reason": "NO_CHANGES"
      }
    ]
  }
}

Deploy languages

POST /v1/api/translate/projects/{projectUuid}/deploy Scope deploy:<env>

Puts a revision of each chosen language on the CDN for one environment, at https://cdn.sleekdocs.com/<project>/<env>/<language>.json, in the project's file format. languages is "all" (the default) or a list of codes; revision is "latest" (the default) or a number, which needs exactly one language. A language already at that revision is skipped (ALREADY_DEPLOYED), one never published too (NEVER_PUBLISHED). A failed upload is reported in failed and doesn't undo the others. Needs the deploy:<env> scope and the owner's deploy right for that environment.

Parameters
ParameterInDescription
projectUuidpath, requiredThe project's ID, from List projects or the project page in Translate.

Request body

{
  "env": "test",
  "languages": "all",
  "revision": "latest"
}

Answer

{
  "data": {
    "env": "TEST",
    "deployed": [
      {
        "language": "sv",
        "revision": 11
      }
    ],
    "skipped": [
      {
        "language": "en",
        "reason": "ALREADY_DEPLOYED"
      }
    ],
    "failed": []
  }
}