---
title: Translating content via REST
related:
  - https://docs.kentico.com/13/multilingual-websites/translating-content-using-external-services.md
  - https://docs.kentico.com/13/integrating-3rd-party-systems/xperience-rest-service.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Enterprise license required**
>
> Features described on this page require the **Kentico Xperience Enterprise** license.

Xperience provides a way to retrieve and submit translation data through [REST](http://en.wikipedia.org/wiki/Representational_state_transfer). This service allows you to manage page translations using HTTP request methods. You can utilize the REST service in the code of your [custom translation services](https://docs.kentico.com/13/multilingual-websites/developing-custom-translation-services.md) to transfer data in and out of the system.

Use the following root URL to access the REST translation service:

**\~/rest/translate/**

Replace the \~ character with the domain name and virtual directory of your Xperience administration application, for example: _http://localhost/MyWebSite/rest/translate/_

## Enabling the REST translation service

To set up your website for handling translation operations via the REST service:

1. Ensure that all REST [prerequisites](https://docs.kentico.com/13/integrating-3rd-party-systems/xperience-rest-service/configuring-the-rest-service.md#rest-prerequisites) are fulfilled on the machine hosting your website.
2. Configure your administration application's _web.config_ according to the instructions in [Configuring the REST service](https://docs.kentico.com/13/integrating-3rd-party-systems/xperience-rest-service/configuring-the-rest-service.md).
   - The settings in **Settings -> Integration -> REST** do _not_ affect the translation service. You can leave the general REST service disabled.
3. In the Xperience administration interface, open the **Settings** application.
4. Choose the **Content -> Translation services** category and select the **Enable REST translation service** check box.
5. Click **Save**.

## Retrieving translation data from the system

To retrieve page translation data, send an HTTP GET request to a URL in one of the following formats:

- **\~/rest/translate/content/currentsite/__/document/__**
- **\~/rest/translate/content/site/__/__/document/__**

Set the target language of the translation by adding the corresponding culture code into the **targetlanguage** URL parameter. The system automatically fills in the source language based on the language version of the specified page.

The request returns a response containing XLIFF data that you can use as the translation source. The REST service only supports retrieval of a single object per request.

**Examples**:

_\~/rest/translate/content/site/SampleSite/en-us/document/Services?targetlanguage=fr-fr\
\~/rest/translate/content/currentsite/fr-fr/document/Company/Careers?targetlanguage=cs-cz_

You can also use the following boolean parameters in the URL:

- **TranslateDocCoupledData** (true by default)\
  If true, the returned translation source data includes the content of the page's coupled data fields (i.e. the fields of the specific page type). The service only exports fields that have the _Translate field_ flag enabled in the page type's form definition.
- **TranslateAttachments** (false by default)\
  If true, the translation data includes [grouped attachments](https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-page-types/configuring-grouped-page-attachments.md), [unsorted attachments](https://docs.kentico.com/13/managing-website-content/working-with-files/page-attachments.md), and the content of the page's _File_ fields. The attachment [image variants](https://docs.kentico.com/13/developing-websites/managing-responsive-images.md) are not included. Attachment translation must also be allowed in the website's settings.

**See also**: [Configuring content for translation](https://docs.kentico.com/13/multilingual-websites/configuring-translation-services/configuring-content-for-translation.md)

## Submitting completed translations

To import a translation into the system, send a POST request to the root URL of the REST translation service:

**\~/rest/translate/**

Add the XLIFF content of the completed translation into the body of the request.

The root URL of the service is the only access point used for submitting translations. The system automatically identifies the target page based on the XLIFF data. When the system processes the request, it creates the appropriate language version of the page (if necessary) and inserts the translation data.

```xml title="Sample POST request"

POST http://localhost/MyWebSite/rest/translate/
User-Agent: REST client
Authorization: Basic <enter <username>:<password> encoded in Base64>
Host: localhost
Content-Type: text/xml

<xliff version="1.2">
  <file original="cms.document;9" source-language="en-US" target-language="fr-FR" datatype="htmlbody">
    <body>
      <trans-unit id="menuitemname">
        <source><![CDATA[Company]]></source>
        <target><![CDATA[Entreprise]]></target>
      </trans-unit>
      <trans-unit id="pagename">
        <source><![CDATA[Company]]></source>
        <target><![CDATA[Entreprise]]></target>
      </trans-unit>
    </body>
  </file>
</xliff>

```
