Skip to Content
APIEndpointsLocalize prompts

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/localize

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
prompt_idsuuid[], 1-200requiredSource prompts, any version of a family. From Market coverage
destinationsobject[], 1-20requiredApplied to every prompt
destinations[].country_codestringrequiredMarket to run the version in
destinations[].locale_codestringrequiredRegional locale of the new wording. Codes: Markets and Languages
destinations[].adaptationenumoptionalpreserve (default) or adapt_country
destinations[].wording_modeenumoptionaltranslate (default) or location_only
request_iduuidoptionalIdempotency key. Minted and returned when omitted

Request

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

{ "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

FieldTypeDescription
data.job_idsuuid[]required. One job per prompt and destination; a cell already in progress reuses its job
data.request_iduuidrequired. Send it again to replay
data.dispatchedbooleanrequired. false means the handoff to the worker is delayed; the jobs still run within minutes

Errors

StatusCodeWhen
400invalid_requestA prompt not found or inactive, a prompt without a locale_code, a duplicate destination, or an unsupported country or locale
409conflictrequest_id was already used with a different body
429rate_limitedOver 10 localize requests per minute
503service_unavailableYour allowance could not be checked. Nothing is queued. Retry shortly
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:localization
403plan_requiredThis workspace is not enabled for API writes
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver the per-minute limit for this endpoint
Last updated on