Skip to Content
APIEndpointsEdit prompt suggestions

Edit prompt suggestions

Changes one or more proposed suggestions’ text, market codes, tags, or topic 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:prompts scope.

PATCH /v1/brands/{brand_id}/prompts/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 prompt suggestions
updates[].suggested_promptstring, 5-500 charsoptionalNew prompt text
updates[].country_codesstring[], 1-10optionalReplaces the market codes
updates[].tag_idsuuid[], up to 20optionalReplaces the tag list. [] clears it
updates[].topic_iduuid | nulloptionalMove to this topic, or null to uncategorise

Request

curl --request PATCH \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/suggestions' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \ --header 'Content-Type: application/json' \ --data '{"updates": [{"suggestion_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "country_codes": ["US", "GB"]}]}'

Response

{ "data": { "updated": ["1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"] }, "request_id": "req_5b0e77d213a94f6a8ce1" }

Response fields

FieldTypeDescription
data.updateduuid[]required. Ids actually updated by this call, same order as updates minus duplicates
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 id not found for this brand, an id that is not proposed, over-length text, a malformed market code, or a tag_ids/topic_id not owned by this brand
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:prompts
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.

Omit a field to leave it unchanged; there is no way to “unset” text or markets. tag_ids: [] clears tags and topic_id: null uncategorises — those are the only fields with an explicit clear.

Only proposed suggestions are editable. Accepted, rejected or promoted suggestions are final; edit before you decide, not after.

Last updated on