Skip to Content
APIEndpointsEdit alignment suggestions

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/suggestions

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
updatesobject[], 1-200requiredOne entry per suggestion to edit
updates[].suggestion_iduuidrequiredFrom List alignment suggestions
updates[].suggested_promptstring, 1-500 charsoptionalNew prompt text
updates[].country_codesstring[], 1-20optionalReplaces the market codes

Request

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

{ "data": { "updated": ["e4a2c8f0-6b1d-4a9e-9c3f-1d8b5a2e7f60"] }, "request_id": "req_5b0e77d213a94f6a8ce1" }

Response fields

FieldTypeDescription
data.updateduuid[]required. Ids actually updated by this call, same order as updates
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestupdates 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
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
403insufficient_scopeThe key does not carry write:alignment
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 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.

Last updated on