curl --request PUT \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"translations": {},
"enabled": true
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
payload = {
"translations": {},
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({translations: {}, enabled: true})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'translations' => [
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
payload := strings.NewReader("{\n \"translations\": {},\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"translations\": {},\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"translations\": {},\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "contentVersionLocalization",
"versionId": "<string>",
"code": "<string>",
"name": "<string>",
"enabled": true,
"stats": {
"total": 123,
"missing": 123,
"outdated": 123
},
"units": [
{
"path": "<string>",
"source": "<string>",
"translation": "<string>",
"optional": true,
"outdated": true
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Update a translation
Write translations by unit path and/or switch delivery on or off. Only an editable draft accepts translations — fork a published version first (the fork carries every translation with it). Translations merge onto the stored ones server-side; the response is the full translation as now stored. The code is one of the project’s non-default locales — see List localizations.
curl --request PUT \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"translations": {},
"enabled": true
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
payload = {
"translations": {},
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({translations: {}, enabled: true})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'translations' => [
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}"
payload := strings.NewReader("{\n \"translations\": {},\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"translations\": {},\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"translations\": {},\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "contentVersionLocalization",
"versionId": "<string>",
"code": "<string>",
"name": "<string>",
"enabled": true,
"stats": {
"total": 123,
"missing": 123,
"outdated": 123
},
"units": [
{
"path": "<string>",
"source": "<string>",
"translation": "<string>",
"optional": true,
"outdated": true
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project ID
Content ID
Content version ID
Localization code (not the default locale)
Body
Unit path → translated text. Only the listed units change; a blank value keeps the existing translation. Every path must be one the version currently has (read them first) — unknown paths are rejected, not dropped. Saving re-bases the WHOLE translation's drift tracking on the current source text, so send every unit you intend to fix for this locale in ONE request.
Show child attributes
Show child attributes
Deliver this translation (true) or fall back to the source language (false). Sent alone it only flips the switch and leaves the translation untouched.
Response
Updated translation
contentVersionLocalization Whether this translation is delivered. A disabled (or missing) translation means users of that locale see the source language.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
When the translation was last saved; null when it was never saved.