Localize prompts
Generates a localized version of each prompt for each destination, in the background. A destination is a market (country) and a regional locale for the new wording; adaptation keeps every place name (preserve) or swaps the target-market country in (adapt_country); wording_mode: location_only keeps the wording and only tracks it in the new market.
Asynchronous and platform-billed. Returns job_ids to poll with List localization jobs. Nothing is tracked, and no active-prompt slot is used, until drafts are accepted. Sending the same request_id again replays the earlier result instead of queueing twice; a replay with a different body is refused. Every prompt must already carry a locale_code; set it with Set prompt locales first.
Requires the write:localization scope, and the workspace must be enabled for API writes.
POST /v1/brands/{brand_id}/localization/localizeAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Idempotency-Key | string | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
prompt_ids | uuid[], 1-200 | required | Source prompts, any version of a family. From Market coverage |
destinations | object[], 1-20 | required | Applied to every prompt |
destinations[].country_code | string | required | Market to run the version in |
destinations[].locale_code | string | required | Regional locale of the new wording. Codes: Markets and Languages |
destinations[].adaptation | enum | optional | preserve (default) or adapt_country |
destinations[].wording_mode | enum | optional | translate (default) or location_only |
request_id | uuid | optional | Idempotency key. Minted and returned when omitted |
Request
cURL
curl --request POST \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/localization/localize' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"prompt_ids": ["7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852"], "destinations": [{"country_code": "DE", "locale_code": "de-DE", "adaptation": "preserve"}]}'Response
200
{
"data": {
"batch_id": "c4d5e6f7-0819-4a2b-9c3d-4e5f6a7b8c9d",
"request_id": "5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa",
"job_ids": [
"e1c2b3a4-5d6e-4f70-8192-a3b4c5d6e7f8"
],
"queued": 1,
"cells": 1,
"dispatched": true,
"status": "queued"
},
"request_id": "req_2f7b90c14ae8471da3cd"
}Response fields
| Field | Type | Description |
|---|---|---|
data.job_ids | uuid[] | required. One job per prompt and destination; a cell already in progress reuses its job |
data.request_id | uuid | required. Send it again to replay |
data.dispatched | boolean | required. false means the handoff to the worker is delayed; the jobs still run within minutes |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A prompt not found or inactive, a prompt without a locale_code, a duplicate destination, or an unsupported country or locale |
| 409 | conflict | request_id was already used with a different body |
| 429 | rate_limited | Over 10 localize requests per minute |
| 503 | service_unavailable | Your allowance could not be checked. Nothing is queued. Retry shortly |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 403 | insufficient_scope | The key does not carry write:localization |
| 403 | plan_required | This workspace is not enabled for API writes |
| 404 | not_found | The brand does not exist, or this key is not allowed to reach it |
| 429 | rate_limited | Over the per-minute limit for this endpoint |