Skip to main content
A translation is the value of a specific key in a specific language. Every translation goes through a status workflow: untranslatedtranslatedreviewedapproved. Each status change is recorded in version history, and any previous value can be restored with the revert endpoint. Translations are scoped to a project and a key. All translation write endpoints require both :projectId and :keyId path parameters.

Endpoints

GET    /api/projects/:projectId/translations/:language
PUT    /api/projects/:projectId/keys/:keyId/translations/:language
PATCH  /api/projects/:projectId/keys/:keyId/translations/:language/status
POST   /api/projects/:projectId/keys/:keyId/translations/:language/revert
POST   /api/projects/:projectId/keys/:keyId/translations/:language/revert/:historyId
GET    /api/projects/:projectId/keys/:keyId/translations/:language/history
GET    /api/projects/:projectId/keys/:keyId/translations

Get All Translations for a Language

Returns all translations in a given language for the entire project. Useful for building export workflows or analytics dashboards.
curl "https://api.nt3.io/api/projects/proj_6abc123def456/translations/fr?page=1&limit=50" \
  -H "X-API-Key: entri_your_token_here"
Response:
{
  "data": [
    {
      "keyId": "key_abc123",
      "key": "nav.home",
      "value": "Accueil",
      "status": "approved",
      "language": "fr"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 1,
    "totalPages": 1
  }
}

Upsert a Translation

Creates the translation if it does not exist, or updates it if it does. The PUT method is used for idempotent upsert behavior.
curl -X PUT \
  https://api.nt3.io/api/projects/proj_6abc123def456/keys/key_abc123/translations/fr \
  -H "X-API-Key: entri_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "Accueil",
    "source": "human"
  }'
The source field indicates who produced the value. Valid values are human and ai. When source is ai, you may also include aiConfidence (0–100) to record the confidence score.

Change Translation Status

Advance or roll back a translation through the workflow without changing the value:
curl -X PATCH \
  https://api.nt3.io/api/projects/proj_6abc123def456/keys/key_abc123/translations/fr/status \
  -H "X-API-Key: entri_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"status": "approved"}'
Valid status values: untranslated, translated, reviewed, approved.

Revert to Previous Version

Reverts the translation to the most recent previous value:
curl -X POST \
  https://api.nt3.io/api/projects/proj_6abc123def456/keys/key_abc123/translations/fr/revert \
  -H "X-API-Key: entri_your_token_here"
To revert to a specific historical version, include the history entry ID:
curl -X POST \
  https://api.nt3.io/api/projects/proj_6abc123def456/keys/key_abc123/translations/fr/revert/hist_789 \
  -H "X-API-Key: entri_your_token_here"

Get Version History

Returns the full change history for a translation, ordered newest first:
curl https://api.nt3.io/api/projects/proj_6abc123def456/keys/key_abc123/translations/fr/history \
  -H "X-API-Key: entri_your_token_here"
Response:
[
  {
    "_id": "hist_789",
    "previousValue": "Page d'accueil",
    "newValue": "Accueil",
    "previousStatus": "translated",
    "newStatus": "approved",
    "changedBy": "user_xyz",
    "changedByName": "Alice Martin",
    "source": "human",
    "created": "2025-03-02T09:15:00.000Z"
  },
  {
    "_id": "hist_456",
    "previousValue": null,
    "newValue": "Page d'accueil",
    "previousStatus": "untranslated",
    "newStatus": "translated",
    "changedBy": "ai",
    "changedByName": null,
    "source": "ai",
    "created": "2025-03-01T14:30:00.000Z"
  }
]

Key Notes

  • The source field on a translation helps you distinguish human edits from AI-generated values.
  • History entries record both previousValue and newValue, giving you a full diff of every change. The changedByName field contains the display name of the user who made the change.
  • The translations list endpoint (GET /api/projects/:projectId/translations/:language) supports page and limit query parameters for offset-based pagination.