Skip to content
localisyncDocs
Open panel

Create a translation key

Owner, Admin or Editor in an active workspace/project. Creates no value rows. No language value is required. Content is scoped to the explicit branch. Branch archives are read-only; current workspace roles still apply. Optional gitTarget assigns the key to an enabled mapping and file group in this branch in the same transaction; it never starts a provider write.

POST /api/v1/workspaces/{workspaceId}/projects/{projectId}/branches/{branchId}/keys

Operation: createTranslationKey · Download OpenAPI

Requires an authenticated Localisync panel session. The API checks current membership and permissions for workspace operations. See authentication and request rules.

sessionCookie

{
"type": "apiKey",
"in": "cookie",
"name": "__Host-localisync-session",
"description": "Opaque server session. Local HTTP development uses its explicitly configured development cookie name."
}
Name Location Required Description
workspaceId path Yes
projectId path Yes
Origin header Yes Must exactly match the configured panel origin.
X-CSRF-Token header Yes Token bound to the current opaque server session.
Idempotency-Key header Yes Retry the same payload with the same key. A changed payload requires a new key.
branchId path Yes Explicit branch UUID in this project. No implicit main selection.
{
"type": "string",
"format": "uuid"
}
{
"type": "string",
"format": "uuid"
}
{
"type": "string"
}
{
"type": "string"
}
{
"type": "string",
"format": "uuid"
}
{
"type": "string",
"format": "uuid"
}

Required: Yes.

Schema reference: CreateKey.

Field Type Required Constraints / description
name string Yes Case-sensitive letters, digits, underscore, hyphen or period. Unique in the project, including archived keys.; minLength: 1; maxLength: 200
format plain, icu No default: "plain"
parameters Array of object No maxItems: 32; default: []
gitTarget object No —
{
"$ref": "#/components/schemas/CreateKey"
}

Example payload (illustrative):

{
"name": "checkout_success",
"format": "plain",
"parameters": []
}

Committed result. Responses are private and Cache-Control: no-store.

Content type: application/json Schema reference: TranslationKey.

Field Type Required Constraints / description
name string Yes Case-sensitive letters, digits, underscore, hyphen or period. Unique in the project, including archived keys.; minLength: 1; maxLength: 200
format plain, icu Yes default: "plain"
parameters Array of object Yes maxItems: 32; default: []
id string Yes format: "uuid"
workspaceId string Yes format: "uuid"
projectId string Yes format: "uuid"
version integer Yes minimum: 1; maximum: 2147483646
archivedAt string or null Yes format: "date-time"
createdAt string Yes format: "date-time"
tags Array of object No maxItems: 20
{
"$ref": "#/components/schemas/TranslationKey"
}

Invalid request or ICU value; field and locale issues may be included.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Sign in to continue.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Current role cannot perform this action.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Project or key is not visible in the current workspace.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Stale version, reserved key name, archive or inactive-language conflict. Compare current data before retrying.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Mutation exceeds 1 MiB.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Request limit exceeded.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

A required service is unavailable; no successful change is claimed.

Content type: application/json Schema reference: Error.

Field Type Required Constraints / description
error string Yes —
message string Yes —
requestId string No —
details object No —
statusCode integer No May be included by HTTP-level request limits.
{
"$ref": "#/components/schemas/Error"
}

Request errors and safe retries · Troubleshooting

Cookie preferences

Your choice applies to localisync.com and docs.localisync.com. You can change it at any time using Cookie settings.