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/acceptAuthorization
| 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 |
|---|---|---|---|
suggestion_ids | uuid[], 1-200 | required | From List prompt suggestions |
Request
cURL
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
200
{
"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
| Field | Type | Description |
|---|---|---|
data.promoted[].suggestion_id | uuid | required |
data.promoted[].prompt_id | uuid | required. Use it with Get prompt |
data.promoted[].deduped | boolean | required. true if this linked to a pre-existing prompt instead of creating one |
data.already_promoted[].suggestion_id | uuid | required. Ids that were already decided before this call — a no-op |
data.already_promoted[].prompt_id | uuid | null | required |
data.quota | object | Present only when at least one new prompt was created |
data.quota.limit | integer | null | Your plan’s active-prompt limit, null if unlimited |
data.quota.used | integer | Including this batch |
data.quota.remaining | integer | What is left after this call |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | suggestion_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) |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 403 | insufficient_scope | The key does not carry write:prompts |
| 403 | plan_required | This workspace is not enabled for API writes |
| 403 | quota_exceeded | The batch would exceed your active-prompt allowance. Nothing is created |
| 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 |
| 503 | service_unavailable | Your 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.