Open or update market
Opens a country as a market, or replaces the list of languages the market tracks. Re-opening a removed country revives it. A language that still has tracked versions in the market cannot be dropped, so send the full list you want. Markets also open on their own when a prompt is first tracked in a country; use this to add languages before localizing.
Requires the write:localization scope, and the workspace must be enabled for API writes.
POST /v1/brands/{brand_id}/localization/marketsAuthorization
| 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 |
|---|---|---|---|
country_code | string | required | The market, e.g. DE |
locale_codes | string[], 1-20 | required | The regional locales the market tracks. Replaces the list. Codes: Markets and Languages |
Request
cURL
curl --request POST \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/localization/markets' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"country_code": "DE", "locale_codes": ["de-DE", "en-US"]}'Response
200
{
"data": {
"market_id": "9c1e5c1a-0b7c-4a2e-8e11-2f5c0c9d7a41",
"country_code": "DE",
"country_name": "Germany",
"locale_codes": [
"de-DE",
"en-US"
]
},
"request_id": "req_2f7b90c14ae8471da3cd"
}Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | An unsupported country, a locale outside the catalog, an empty or over-20 list, or a duplicate |
| 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