curl --request POST \
--url 'https://api.widgetic.com/v1/translations/123e4567-e89b-12d3-a456-426614174000/languages' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header "Idempotency-Key: $(uuidgen)" \
--header 'Content-Type: application/json' \
--data '{
"languages": [
"es",
"fr"
],
"revision": 1
}'import { TranslationsApi } from '@widgetic/api-sdk-ts';
import { randomUUID } from 'node:crypto';
const translationsApi = new TranslationsApi(process.env.WIDGETIC_API_KEY!);
const result = await translationsApi.addLanguagesToTranslation({
id: '123e4567-e89b-12d3-a456-426614174000',
idempotencyKey: randomUUID(),
addLanguagesToTranslationRequest: {
languages: ['es', 'fr'],
revision: 1,
},
});
console.log(result);import os
import uuid
import api_sdk_py
configuration = api_sdk_py.Configuration(access_token=os.environ["WIDGETIC_API_KEY"])
with api_sdk_py.ApiClient(configuration) as api_client:
translations_api = api_sdk_py.TranslationsApi(api_client)
result = translations_api.add_languages_to_translation(
id="123e4567-e89b-12d3-a456-426614174000",
idempotency_key=str(uuid.uuid4()),
add_languages_to_translation_request={
"languages": ["es", "fr"],
"revision": 1,
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"github.com/google/uuid"
widgetic "github.com/widgetic/api-sdk-go"
)
func main() {
ctx := context.WithValue(context.Background(), widgetic.ContextAccessToken, os.Getenv("WIDGETIC_API_KEY"))
client := widgetic.NewAPIClient(widgetic.NewConfiguration())
addLanguagesToTranslationRequestJSON := `{
"languages": [
"es",
"fr"
],
"revision": 1
}`
var addLanguagesToTranslationRequest widgetic.AddLanguagesToTranslationRequest
if err := json.Unmarshal([]byte(addLanguagesToTranslationRequestJSON), &addLanguagesToTranslationRequest); err != nil {
log.Fatal(err)
}
result, _, err := client.TranslationsAPI.AddLanguagesToTranslation(ctx, "123e4567-e89b-12d3-a456-426614174000").
IdempotencyKey(uuid.NewString()).
AddLanguagesToTranslationRequest(addLanguagesToTranslationRequest).
Execute()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(result)
}import com.widgetic.api.ApiClient;
import com.widgetic.api.ApiException;
import com.widgetic.api.Configuration;
import com.widgetic.api.JSON;
import com.widgetic.api.api.TranslationsApi;
import com.widgetic.api.model.AddLanguagesToTranslationRequest;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws ApiException {
ApiClient client = Configuration.getDefaultApiClient();
client.setBearerToken(System.getenv("WIDGETIC_API_KEY"));
TranslationsApi translationsApi = new TranslationsApi(client);
String addLanguagesToTranslationRequestJson = """
{
"languages": [
"es",
"fr"
],
"revision": 1
}
""";
AddLanguagesToTranslationRequest addLanguagesToTranslationRequest = JSON.deserialize(addLanguagesToTranslationRequestJson, AddLanguagesToTranslationRequest.class);
var result = translationsApi.addLanguagesToTranslation(
"123e4567-e89b-12d3-a456-426614174000",
UUID.randomUUID().toString(),
addLanguagesToTranslationRequest,
null,
null
);
System.out.println(result);
}
}using System;
using Newtonsoft.Json;
using Widgetic.ApiSdk.Cs.Api;
using Widgetic.ApiSdk.Cs.Client;
using Widgetic.ApiSdk.Cs.Model;
var configuration = new Configuration
{
AccessToken = Environment.GetEnvironmentVariable("WIDGETIC_API_KEY")!,
};
var translationsApi = new TranslationsApi(configuration);
var addLanguagesToTranslationRequest = JsonConvert.DeserializeObject<AddLanguagesToTranslationRequest>("""
{
"languages": [
"es",
"fr"
],
"revision": 1
}
""")!;
var result = translationsApi.AddLanguagesToTranslation(
id: "123e4567-e89b-12d3-a456-426614174000",
idempotencyKey: Guid.NewGuid().ToString(),
addLanguagesToTranslationRequest: addLanguagesToTranslationRequest
);
Console.WriteLine(result);require 'securerandom'
require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
translations_api = ApiSdkRb::TranslationsApi.new
result = translations_api.add_languages_to_translation(
'123e4567-e89b-12d3-a456-426614174000',
SecureRandom.uuid,
{
languages: ['es', 'fr'],
revision: 1
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\TranslationsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\AddLanguagesToTranslationRequest;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$translationsApi = new TranslationsApi(new GuzzleHttp\Client(), $config);
$addLanguagesToTranslationRequestJson = '{
"languages": [
"es",
"fr"
],
"revision": 1
}';
$addLanguagesToTranslationRequest = ObjectSerializer::deserialize(json_decode($addLanguagesToTranslationRequestJson), AddLanguagesToTranslationRequest::class);
$result = $translationsApi->addLanguagesToTranslation(
id: '123e4567-e89b-12d3-a456-426614174000',
idempotency_key: bin2hex(random_bytes(16)),
add_languages_to_translation_request: $addLanguagesToTranslationRequest,
);
print_r($result);{
"success": true,
"data": {
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Homepage Multi-language",
"description": "Multi-language homepage for global audience",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"managedUserId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"managedUserExternalId": "Example managedUserExternalId",
"rootLanguage": "en",
"status": "active",
"revision": 2,
"embedCode": "tr_123456",
"selectedLanguages": [
"en",
"es",
"fr",
"de"
],
"totalViews": 1500,
"createdAt": "2024-01-15T09:00:00Z",
"updatedAt": "2024-01-15T09:00:00Z",
"origin": "manual",
"syncStatus": "current",
"lastSyncedAt": "2026-01-15T09:30:00.000Z",
"variants": [
"Example TranslationVariant"
]
},
"message": "<string>"
},
"meta": {
"page": 1,
"size": 20,
"total": 135,
"limit": 20,
"offset": 0,
"hasNextPage": true,
"hasPreviousPage": false,
"nextCursor": "<string>",
"warnings": [
"<string>"
]
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}Add languages to a translation
Add new languages to an existing translation experiment and start translation. The translation is found by its id, in the workspace it belongs to: you must be a member of that workspace (and, with an API key, the key must belong to it), otherwise the answer is 404.
Called for one managed user (X-Managed-User-Id or X-Managed-User-External-Id), it reaches only that customer’s translations: one of another customer, or one made for your own account, answers 404 as if it did not exist. The copies for the new languages are filed under the same customer, so a customer that is switched off cannot add any (409 MANAGED_USER_INACTIVE).
The translation is at data.data, and data.message says what was done.
curl --request POST \
--url 'https://api.widgetic.com/v1/translations/123e4567-e89b-12d3-a456-426614174000/languages' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header "Idempotency-Key: $(uuidgen)" \
--header 'Content-Type: application/json' \
--data '{
"languages": [
"es",
"fr"
],
"revision": 1
}'import { TranslationsApi } from '@widgetic/api-sdk-ts';
import { randomUUID } from 'node:crypto';
const translationsApi = new TranslationsApi(process.env.WIDGETIC_API_KEY!);
const result = await translationsApi.addLanguagesToTranslation({
id: '123e4567-e89b-12d3-a456-426614174000',
idempotencyKey: randomUUID(),
addLanguagesToTranslationRequest: {
languages: ['es', 'fr'],
revision: 1,
},
});
console.log(result);import os
import uuid
import api_sdk_py
configuration = api_sdk_py.Configuration(access_token=os.environ["WIDGETIC_API_KEY"])
with api_sdk_py.ApiClient(configuration) as api_client:
translations_api = api_sdk_py.TranslationsApi(api_client)
result = translations_api.add_languages_to_translation(
id="123e4567-e89b-12d3-a456-426614174000",
idempotency_key=str(uuid.uuid4()),
add_languages_to_translation_request={
"languages": ["es", "fr"],
"revision": 1,
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"github.com/google/uuid"
widgetic "github.com/widgetic/api-sdk-go"
)
func main() {
ctx := context.WithValue(context.Background(), widgetic.ContextAccessToken, os.Getenv("WIDGETIC_API_KEY"))
client := widgetic.NewAPIClient(widgetic.NewConfiguration())
addLanguagesToTranslationRequestJSON := `{
"languages": [
"es",
"fr"
],
"revision": 1
}`
var addLanguagesToTranslationRequest widgetic.AddLanguagesToTranslationRequest
if err := json.Unmarshal([]byte(addLanguagesToTranslationRequestJSON), &addLanguagesToTranslationRequest); err != nil {
log.Fatal(err)
}
result, _, err := client.TranslationsAPI.AddLanguagesToTranslation(ctx, "123e4567-e89b-12d3-a456-426614174000").
IdempotencyKey(uuid.NewString()).
AddLanguagesToTranslationRequest(addLanguagesToTranslationRequest).
Execute()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(result)
}import com.widgetic.api.ApiClient;
import com.widgetic.api.ApiException;
import com.widgetic.api.Configuration;
import com.widgetic.api.JSON;
import com.widgetic.api.api.TranslationsApi;
import com.widgetic.api.model.AddLanguagesToTranslationRequest;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws ApiException {
ApiClient client = Configuration.getDefaultApiClient();
client.setBearerToken(System.getenv("WIDGETIC_API_KEY"));
TranslationsApi translationsApi = new TranslationsApi(client);
String addLanguagesToTranslationRequestJson = """
{
"languages": [
"es",
"fr"
],
"revision": 1
}
""";
AddLanguagesToTranslationRequest addLanguagesToTranslationRequest = JSON.deserialize(addLanguagesToTranslationRequestJson, AddLanguagesToTranslationRequest.class);
var result = translationsApi.addLanguagesToTranslation(
"123e4567-e89b-12d3-a456-426614174000",
UUID.randomUUID().toString(),
addLanguagesToTranslationRequest,
null,
null
);
System.out.println(result);
}
}using System;
using Newtonsoft.Json;
using Widgetic.ApiSdk.Cs.Api;
using Widgetic.ApiSdk.Cs.Client;
using Widgetic.ApiSdk.Cs.Model;
var configuration = new Configuration
{
AccessToken = Environment.GetEnvironmentVariable("WIDGETIC_API_KEY")!,
};
var translationsApi = new TranslationsApi(configuration);
var addLanguagesToTranslationRequest = JsonConvert.DeserializeObject<AddLanguagesToTranslationRequest>("""
{
"languages": [
"es",
"fr"
],
"revision": 1
}
""")!;
var result = translationsApi.AddLanguagesToTranslation(
id: "123e4567-e89b-12d3-a456-426614174000",
idempotencyKey: Guid.NewGuid().ToString(),
addLanguagesToTranslationRequest: addLanguagesToTranslationRequest
);
Console.WriteLine(result);require 'securerandom'
require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
translations_api = ApiSdkRb::TranslationsApi.new
result = translations_api.add_languages_to_translation(
'123e4567-e89b-12d3-a456-426614174000',
SecureRandom.uuid,
{
languages: ['es', 'fr'],
revision: 1
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\TranslationsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\AddLanguagesToTranslationRequest;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$translationsApi = new TranslationsApi(new GuzzleHttp\Client(), $config);
$addLanguagesToTranslationRequestJson = '{
"languages": [
"es",
"fr"
],
"revision": 1
}';
$addLanguagesToTranslationRequest = ObjectSerializer::deserialize(json_decode($addLanguagesToTranslationRequestJson), AddLanguagesToTranslationRequest::class);
$result = $translationsApi->addLanguagesToTranslation(
id: '123e4567-e89b-12d3-a456-426614174000',
idempotency_key: bin2hex(random_bytes(16)),
add_languages_to_translation_request: $addLanguagesToTranslationRequest,
);
print_r($result);{
"success": true,
"data": {
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Homepage Multi-language",
"description": "Multi-language homepage for global audience",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"managedUserId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"managedUserExternalId": "Example managedUserExternalId",
"rootLanguage": "en",
"status": "active",
"revision": 2,
"embedCode": "tr_123456",
"selectedLanguages": [
"en",
"es",
"fr",
"de"
],
"totalViews": 1500,
"createdAt": "2024-01-15T09:00:00Z",
"updatedAt": "2024-01-15T09:00:00Z",
"origin": "manual",
"syncStatus": "current",
"lastSyncedAt": "2026-01-15T09:30:00.000Z",
"variants": [
"Example TranslationVariant"
]
},
"message": "<string>"
},
"meta": {
"page": 1,
"size": 20,
"total": 135,
"limit": 20,
"offset": 0,
"hasNextPage": true,
"hasPreviousPage": false,
"nextCursor": "<string>",
"warnings": [
"<string>"
]
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}Authorizations
Send your API key as a bearer token: Authorization: Bearer <your API key>. Make a key in the dashboard under Settings → API keys; a workspace key starts with wdg_org_ and works in the workspace it was made in. See API keys and Authentication.
Headers
Required: a call without it is refused with 400. A key of your own that names this one request; a UUID is ideal. It is 8 to 50 characters of letters, digits, - and _. Send the same key again when you retry (after a timeout, a dropped connection or a 5xx) and the call is carried out once: the retry gets the first answer back, marked X-Idempotency-Cached: true. The same key with a different body is refused with 422, and a retry that arrives while the first call is still running with 409 (see Retry-After).
8 - 50^[a-zA-Z0-9_-]{8,50}$"9b2d6f0a-3c41-4e5a-8d77-1f2e3a4b5c6d"
The id Widgetic gave the managed user (POST /managed-users). Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions, workflows, A/B tests and translations: a list shows only theirs, one the call makes is filed under them, and one of another user, or one that does not exist, answers 404 (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers 404 with MANAGED_USER_NOT_FOUND. An empty, repeated or malformed header is 400 with MANAGED_USER_SCOPE_INVALID; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with 403 and MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE: send it without the header. Only a partner's API key can send it, because only a partner has managed users: a call that is not made with an API key is refused with 403 and MANAGED_USER_SCOPE_NOT_ALLOWED, and an API key that is not a partner's finds no managed user (404 with MANAGED_USER_NOT_FOUND). The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An Idempotency-Key is kept apart for each managed user.
"3f2b8c1e-7a4d-4e0b-9c55-2d1a6b7e8f90"
Your own id for the managed user (its externalId), when you do not keep Widgetic's. Makes this call for one of your managed users, so that a mistake in your own code cannot reach another customer's work. Send this header, or the other one, never both. Left out, the call works on your whole account, as it always has. With it, the call reaches only that user's compositions, workflows, A/B tests and translations: a list shows only theirs, one the call makes is filed under them, and one of another user, or one that does not exist, answers 404 (the same answer, so the call cannot be used to find out what another customer has). A managed user that is not yours answers 404 with MANAGED_USER_NOT_FOUND. An empty, repeated or malformed header is 400 with MANAGED_USER_SCOPE_INVALID; an empty header is never read as no header. A call that is about the whole account, such as the list of your managed users, is refused with 403 and MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE: send it without the header. Only a partner's API key can send it, because only a partner has managed users: a call that is not made with an API key is refused with 403 and MANAGED_USER_SCOPE_NOT_ALLOWED, and an API key that is not a partner's finds no managed user (404 with MANAGED_USER_NOT_FOUND). The header is a limit the call asks for: whoever holds the key can leave it out, so for a credential that a customer's browser holds, use an editor session. An Idempotency-Key is kept apart for each managed user.
1 - 255"customer-1042"
Body
Response
Languages added successfully