Edit alignment suggestions
Changes one or more proposed alignment suggestions’ text and/or market codes before you decide on
them. Only allowed while a suggestion is still proposed — edit before you
accept or
reject, not after.
Bulk-shaped only, and each entry in updates can change different fields — this is not “apply
one change to many suggestions”, it is “apply N independent edits in one call”.
Requires the write:alignment scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/alignment/suggestionsAuthorization
| 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 suggestion to edit |
updates[].suggestion_id | uuid | required | From List alignment suggestions |
updates[].suggested_prompt | string, 1-500 chars | optional | New prompt text |
updates[].country_codes | string[], 1-20 | optional | Replaces the market codes |
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/suggestions' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"updates": [{"suggestion_id": "e4a2c8f0-6b1d-4a9e-9c3f-1d8b5a2e7f60", "country_codes": ["US", "GB"]}]}'Response
200
{
"data": {
"updated": ["e4a2c8f0-6b1d-4a9e-9c3f-1d8b5a2e7f60"]
},
"request_id": "req_5b0e77d213a94f6a8ce1"
}Response fields
| Field | Type | Description |
|---|---|---|
data.updated | uuid[] | required. Ids actually updated by this call, same order as updates |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | updates is empty, over 200 entries, contains a duplicate suggestion_id, an entry with neither suggested_prompt nor country_codes, an id not found for this brand, an id that is not proposed, over-length text, or a malformed market code |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 403 | insufficient_scope | The key does not carry write:alignment |
| 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 60 requests per minute |
Notes
Validation is all-or-nothing, across the whole batch. One malformed field anywhere in
updates refuses every edit in the call and names every offender — unlike the app’s own bulk
edit, which applies whatever validates and reports the rest as per-row failures under a 200.
Nothing in the batch is written unless everything validates.
Each entry needs at least one of suggested_prompt or country_codes. An entry with neither
is rejected; omit a field entirely to leave it unchanged, there is no way to “unset” either one.
Only proposed suggestions are editable. Accepted, rejected or promoted suggestions are
final; edit before you decide, not after.
No category fields here. Unlike Add alignment suggestion,
this endpoint cannot change category_id or the proposed category. Reject the suggestion and add
a new one if it needs a different category.