Edit localization draft
Replaces the wording of a draft. The draft’s current version is read on the server, so a concurrent edit is refused rather than overwritten. A draft that is still generating cannot be edited.
Requires the write:localization scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/localization/previews/{item_id}Authorization
| 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 |
item_id | uuid | required | draft.item_id from List localization jobs |
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
text | string, 1-500 chars | required | The new wording |
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/localization/previews/{item_id}' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"text": "Was sind die besten GEO-Tools in den USA?"}'Response
200
{
"data": {
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e8f7a6b5c4d",
"version": 3,
"status": "ready",
"proposed_text": "Was sind die besten GEO-Tools in den USA?",
"locale_code": "de-DE"
},
"request_id": "req_2f7b90c14ae8471da3cd"
}Errors
| Status | Code | When |
|---|---|---|
| 409 | conflict | The draft is being generated, or it changed since it was read |
| 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