Set prompt locales
Relabels which regional locale prompts are written in, without changing their wording; the way to repair a brand before localizing it. Every market a prompt is tracked in gains the language. Refused when the same wording already exists in that language on the brand; then nothing is changed. For a single prompt, Update prompt takes locale_code too. Codes: Markets and Languages.
Requires the write:localization scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/localization/localesAuthorization
| 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 |
|---|---|---|---|
updates | object[], 1-200 | required | One entry per prompt |
updates[].prompt_id | uuid | required | From List prompts |
updates[].locale_code | string | required | A regional locale such as en-GB or de-DE, never a bare language |
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/localization/locales' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"updates": [{"prompt_id": "7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852", "locale_code": "en-GB"}]}'Response
200
{
"data": {
"updated": 1,
"unchanged": 0,
"market_locales_added": 1,
"warnings": []
},
"request_id": "req_2f7b90c14ae8471da3cd"
}Response fields
| Field | Type | Description |
|---|---|---|
data.updated | integer | required. Prompts whose locale changed |
data.unchanged | integer | required. Prompts already in that locale |
data.warnings | object[] | required. { prompt_id, code }; family_locale_exists means another version of the family already uses the language |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A duplicate prompt_id, a prompt not of this brand, or a locale outside the catalog |
| 409 | conflict | The same wording already exists in that language on this brand. Nothing is changed |
| 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 |
Last updated on