Skip to Content
APIEndpointsAccept localization drafts

Accept localization drafts

Turns ready drafts into tracked prompts, as versions of their source family, in one transaction: every draft lands or none does. Each accepted version consumes one active-prompt slot and starts executing immediately. Jobs that are not ready, or whose source wording changed since the draft was made, are skipped and listed; queue those again.

Each accepted version inherits its source prompt’s tags, as chosen when the drafts were made with Localize prompts. Pass copy_tags or exclude_tag_ids only to override that choice for every draft in the call. Copying only adds tags; a version keeps any tags it already has.

Short of tracking slots? Delete the prompts you no longer need with Delete prompts first, then accept. Drafts stay acceptable when the prompt they were made from is deleted.

Requires the write:localization scope, and the workspace must be enabled for API writes.

POST /v1/brands/{brand_id}/localization/accept

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
job_idsuuid[], 1-200requiredReady jobs. From List localization jobs
copy_tagsbooleanoptionalOverrides the choice made when localizing. Omit to keep it
exclude_tag_idsuuid[], up to 500optionalOverrides the tags left out when localizing. From List tags. Omit to keep them

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/localization/accept' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \ --header 'Content-Type: application/json' \ --data '{"job_ids": ["e1c2b3a4-5d6e-4f70-8192-a3b4c5d6e7f8"]}'

Response

{ "data": { "accepted_prompt_ids": [ "b6a0c2d4-1e3f-4a5b-8c7d-9e0f1a2b3c4d" ], "accepted": 1, "added_slots": 1, "tags_copied": 2, "runs": 1, "skipped": [], "dispatched": true }, "request_id": "req_2f7b90c14ae8471da3cd" }

Response fields

FieldTypeDescription
data.accepted_prompt_idsuuid[]required. The new tracked versions
data.added_slotsintegerrequired. Active-prompt slots consumed
data.tags_copiedintegerrequired. Tag assignments added to the accepted versions
data.skippedobject[]required. { job_id, reason } for jobs that were not accepted

Errors

StatusCodeWhen
400invalid_requestNone of the jobs is ready; the message lists each with its reason
403quota_exceededAccepting would exceed your active-prompt allowance. Nothing is accepted
409conflictThe source, draft or market coverage changed since it was read
503service_unavailableYour allowance could not be checked. Nothing is accepted. 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