Skip to Content
APIEndpointsAccept prompt suggestions

Accept prompt suggestions

Accepts one or more suggestions, creating a tracked prompt from each. A suggestion’s topic, funnel stage and language carry over, so the new prompt arrives already classified rather than waiting on background analysis. A suggestion whose text already matches an active prompt is linked to that prompt instead of creating a duplicate.

This is a billable action: each newly-created prompt consumes an active-prompt slot per market, exactly as Create prompt does. The check runs against the whole batch before anything is written — if the batch would not fit your remaining allowance, nothing in it is created.

Bulk-shaped only. There is no single-suggestion accept endpoint; send one id for the single-row case.

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

POST /v1/brands/{brand_id}/prompts/suggestions/accept

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
suggestion_idsuuid[], 1-200requiredFrom List prompt suggestions

Request

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

Response

{ "data": { "promoted": [ { "suggestion_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "prompt_id": "b71e3c04-95af-4d28-8a16-5c0f7e2d1a93", "deduped": false } ], "already_promoted": [], "quota": { "limit": 200, "used": 149, "remaining": 51 } }, "request_id": "req_5b0e77d213a94f6a8ce1" }

Response fields

FieldTypeDescription
data.promoted[].suggestion_iduuidrequired
data.promoted[].prompt_iduuidrequired. Use it with Get prompt
data.promoted[].dedupedbooleanrequired. true if this linked to a pre-existing prompt instead of creating one
data.already_promoted[].suggestion_iduuidrequired. Ids that were already decided before this call — a no-op
data.already_promoted[].prompt_iduuid | nullrequired
data.quotaobjectPresent only when at least one new prompt was created
data.quota.limitinteger | nullYour plan’s active-prompt limit, null if unlimited
data.quota.usedintegerIncluding this batch
data.quota.remainingintegerWhat is left after this call
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestsuggestion_ids is empty, over 200 entries, contains an id not found for this brand, or contains an id whose status is not proposed (and not already accepted/promoted)
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
403quota_exceededThe batch would exceed your active-prompt allowance. Nothing is created
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 60 requests per minute
503service_unavailableYour allowance could not be checked. Nothing is created. Retry shortly

Notes

Validation is all-or-nothing. An id that is missing, belongs to another brand, or has already been rejected refuses the entire call and names every offender — unlike the app’s own bulk accept, which reports per-row failures under a 200. Retry with the bad ids removed.

Replaying an already-accepted id is safe. If a suggestion was already promoted or accepted (by an earlier call, or by a human in the app) it comes back in already_promoted rather than causing an error — this endpoint is safe to retry after a timeout.

deduped: true means no new prompt was created. The suggestion’s text already matched an active prompt, so it was linked to that prompt rather than creating a duplicate. Deduped rows do not consume quota and are not included in data.quota.

Idempotency-Key matters more here than elsewhere. Reuse it when retrying and the original response is replayed rather than a second batch being processed. See Idempotency.

Last updated on