curl --request POST \
--url 'https://api.widgetic.com/v1/organizations/123e4567-e89b-12d3-a456-426614174000/translations' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}'import { OrganizationsApi } from '@widgetic/api-sdk-ts';
const organizationsApi = new OrganizationsApi(process.env.WIDGETIC_API_KEY!);
const result = await organizationsApi.createOrganizationTranslation({
orgId: '123e4567-e89b-12d3-a456-426614174000',
createWorkspaceTranslationRequest: {
name: 'Product Page Multi-language',
description: 'Translate product page for European markets',
rootCompositionId: '789e0123-e89b-12d3-a456-426614174002',
rootLanguage: 'en',
},
});
console.log(result);import os
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:
organizations_api = api_sdk_py.OrganizationsApi(api_client)
result = organizations_api.create_organization_translation(
org_id="123e4567-e89b-12d3-a456-426614174000",
create_workspace_translation_request={
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en",
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
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())
createWorkspaceTranslationRequestJSON := `{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}`
var createWorkspaceTranslationRequest widgetic.CreateWorkspaceTranslationRequest
if err := json.Unmarshal([]byte(createWorkspaceTranslationRequestJSON), &createWorkspaceTranslationRequest); err != nil {
log.Fatal(err)
}
result, _, err := client.OrganizationsAPI.CreateOrganizationTranslation(ctx, "123e4567-e89b-12d3-a456-426614174000").
CreateWorkspaceTranslationRequest(createWorkspaceTranslationRequest).
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.OrganizationsApi;
import com.widgetic.api.model.CreateWorkspaceTranslationRequest;
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"));
OrganizationsApi organizationsApi = new OrganizationsApi(client);
String createWorkspaceTranslationRequestJson = """
{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}
""";
CreateWorkspaceTranslationRequest createWorkspaceTranslationRequest = JSON.deserialize(createWorkspaceTranslationRequestJson, CreateWorkspaceTranslationRequest.class);
var result = organizationsApi.createOrganizationTranslation(
UUID.fromString("123e4567-e89b-12d3-a456-426614174000"),
createWorkspaceTranslationRequest,
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 organizationsApi = new OrganizationsApi(configuration);
var createWorkspaceTranslationRequest = JsonConvert.DeserializeObject<CreateWorkspaceTranslationRequest>("""
{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}
""")!;
var result = organizationsApi.CreateOrganizationTranslation(
orgId: Guid.Parse("123e4567-e89b-12d3-a456-426614174000"),
createWorkspaceTranslationRequest: createWorkspaceTranslationRequest
);
Console.WriteLine(result);require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
organizations_api = ApiSdkRb::OrganizationsApi.new
result = organizations_api.create_organization_translation(
'123e4567-e89b-12d3-a456-426614174000',
{
name: 'Product Page Multi-language',
description: 'Translate product page for European markets',
rootCompositionId: '789e0123-e89b-12d3-a456-426614174002',
rootLanguage: 'en'
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\OrganizationsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\CreateWorkspaceTranslationRequest;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$organizationsApi = new OrganizationsApi(new GuzzleHttp\Client(), $config);
$createWorkspaceTranslationRequestJson = '{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}';
$createWorkspaceTranslationRequest = ObjectSerializer::deserialize(json_decode($createWorkspaceTranslationRequestJson), CreateWorkspaceTranslationRequest::class);
$result = $organizationsApi->createOrganizationTranslation(
org_id: '123e4567-e89b-12d3-a456-426614174000',
create_workspace_translation_request: $createWorkspaceTranslationRequest,
);
print_r($result);{
"success": true,
"data": {},
"meta": null
}{
"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"
}
}{
"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"
}
}Create a translation
Create a new translation experiment in the organization.
Called for one managed user (X-Managed-User-Id or X-Managed-User-External-Id), the translation is filed under that
customer (managedUserId in the answer), the original composition has to be one of that customer’s, and the
composition made for each language is filed under the customer too: an original composition of another customer, or
one of your own account, answers 404 as if it did not exist. A customer may hold only so many translations
(details.limit says how many), and a customer that is switched off cannot be given a new one. The customer comes
from the header and nowhere else: a managedUserId in the body is not read.
curl --request POST \
--url 'https://api.widgetic.com/v1/organizations/123e4567-e89b-12d3-a456-426614174000/translations' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}'import { OrganizationsApi } from '@widgetic/api-sdk-ts';
const organizationsApi = new OrganizationsApi(process.env.WIDGETIC_API_KEY!);
const result = await organizationsApi.createOrganizationTranslation({
orgId: '123e4567-e89b-12d3-a456-426614174000',
createWorkspaceTranslationRequest: {
name: 'Product Page Multi-language',
description: 'Translate product page for European markets',
rootCompositionId: '789e0123-e89b-12d3-a456-426614174002',
rootLanguage: 'en',
},
});
console.log(result);import os
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:
organizations_api = api_sdk_py.OrganizationsApi(api_client)
result = organizations_api.create_organization_translation(
org_id="123e4567-e89b-12d3-a456-426614174000",
create_workspace_translation_request={
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en",
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
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())
createWorkspaceTranslationRequestJSON := `{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}`
var createWorkspaceTranslationRequest widgetic.CreateWorkspaceTranslationRequest
if err := json.Unmarshal([]byte(createWorkspaceTranslationRequestJSON), &createWorkspaceTranslationRequest); err != nil {
log.Fatal(err)
}
result, _, err := client.OrganizationsAPI.CreateOrganizationTranslation(ctx, "123e4567-e89b-12d3-a456-426614174000").
CreateWorkspaceTranslationRequest(createWorkspaceTranslationRequest).
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.OrganizationsApi;
import com.widgetic.api.model.CreateWorkspaceTranslationRequest;
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"));
OrganizationsApi organizationsApi = new OrganizationsApi(client);
String createWorkspaceTranslationRequestJson = """
{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}
""";
CreateWorkspaceTranslationRequest createWorkspaceTranslationRequest = JSON.deserialize(createWorkspaceTranslationRequestJson, CreateWorkspaceTranslationRequest.class);
var result = organizationsApi.createOrganizationTranslation(
UUID.fromString("123e4567-e89b-12d3-a456-426614174000"),
createWorkspaceTranslationRequest,
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 organizationsApi = new OrganizationsApi(configuration);
var createWorkspaceTranslationRequest = JsonConvert.DeserializeObject<CreateWorkspaceTranslationRequest>("""
{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}
""")!;
var result = organizationsApi.CreateOrganizationTranslation(
orgId: Guid.Parse("123e4567-e89b-12d3-a456-426614174000"),
createWorkspaceTranslationRequest: createWorkspaceTranslationRequest
);
Console.WriteLine(result);require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
organizations_api = ApiSdkRb::OrganizationsApi.new
result = organizations_api.create_organization_translation(
'123e4567-e89b-12d3-a456-426614174000',
{
name: 'Product Page Multi-language',
description: 'Translate product page for European markets',
rootCompositionId: '789e0123-e89b-12d3-a456-426614174002',
rootLanguage: 'en'
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\OrganizationsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\CreateWorkspaceTranslationRequest;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$organizationsApi = new OrganizationsApi(new GuzzleHttp\Client(), $config);
$createWorkspaceTranslationRequestJson = '{
"name": "Product Page Multi-language",
"description": "Translate product page for European markets",
"rootCompositionId": "789e0123-e89b-12d3-a456-426614174002",
"rootLanguage": "en"
}';
$createWorkspaceTranslationRequest = ObjectSerializer::deserialize(json_decode($createWorkspaceTranslationRequestJson), CreateWorkspaceTranslationRequest::class);
$result = $organizationsApi->createOrganizationTranslation(
org_id: '123e4567-e89b-12d3-a456-426614174000',
create_workspace_translation_request: $createWorkspaceTranslationRequest,
);
print_r($result);{
"success": true,
"data": {},
"meta": null
}{
"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"
}
}{
"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
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
What a new translation experiment needs, in a workspace: a name, the composition to translate
(rootCompositionId), the language it is written in (rootLanguage) and the languages to make a copy in
(selectedLanguages), written in camelCase like the rest of the API. All four are needed: a request without
the composition, the language or the languages is refused with 400 and the name of what is missing.
Response
Translation created successfully
A translation experiment that was just created or changed, with the gateway's message, in the { success, data } envelope.