Accept prompt suggestions
curl --request POST \
--url https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"suggestionIds": [
"<string>"
]
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept"
payload = { "suggestionIds": ["<string>"] }
headers = {
"Authorization": "<authorization>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({suggestionIds: ['<string>']})
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Prompt suggestions
Accept prompt suggestions
Create prompts from up to 20 suggestions of the latest generation. Accepted prompts are monitored by default; use dryRun to preview the daily credit cost.
POST
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
prompt-suggestions
/
accept
Accept prompt suggestions
curl --request POST \
--url https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"suggestionIds": [
"<string>"
]
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept"
payload = { "suggestionIds": ["<string>"] }
headers = {
"Authorization": "<authorization>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({suggestionIds: ['<string>']})
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/prompt-suggestions/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Creates prompts from up to 20 suggestions of the latest generation. Accepted
prompts are monitored by default, which adds a recurring credit consumption
reported in
Inspect every item: the HTTP status alone does not mean every suggestion was accepted.
See Error codes for authentication, plan, idempotency and server errors. A token without write access returns
dailyCredits. Set dryRun to true to preview the outcomes and
that consumption without creating anything.
Requires an active Business, Agency Business or Enterprise plan, and an API token with write access enabled by an Owner or Manager. See Writing data for activation, idempotency, conditional requests and error handling.
Unique key for this operation, at most 255 characters. Completed responses replay for 24 hours.
Between 1 and 20 suggestion identifiers from Get prompt suggestions.
Each identifier has at most 200 characters. IDs are opaque and bind to content and taxonomy. Read them again after regeneration. A replaced suggestion returns
not_found instead of accepting different content.Response
Returns200 with dryRun, dailyCredits and items.
| Field | Meaning |
|---|---|
dryRun | Whether nothing was created |
dailyCredits | Average credits per day added by the accepted monitored prompts |
items[].outcome | created, already_tracked, not_found or invalid |
items[].promptId | The created prompt, or null |
already_tracked means that an equivalent prompt is already active and
monitored, or that an earlier suggestion of the same request has the same text.
A suggestion equivalent to an archived or paused prompt reactivates that prompt
and reports created, as in the dashboard Studio. The import rewrites its text,
funnel stage and topic, clears its countries, and resets its personas and models
to the workspace defaults. Its frequency, boost and last collection are kept.
Accepting starts no collection itself. On a LIVE workspace, it can make
monitored prompts due at the next scheduler pass, which runs on the hour and on
the half hour (UTC): a new prompt when automatic answers are on, or a
reactivated prompt whose last collection is older than its frequency. That first
collection uses credits once, on top of dailyCredits. This response, dryRun
included, does not report that amount. The preview of the
accept_prompt_suggestions
MCP tool does.
Synthetic request and response
curl -X POST "https://www.qwairy.co/api/v1/brands/$BRAND_ID/prompt-suggestions/accept" \
-H "Authorization: Bearer $QWAIRY_API_TOKEN" \
-H "Idempotency-Key: accept-suggestions-001" \
-H "Content-Type: application/json" \
-d '{"suggestionIds":["cccccccc-0000-4000-8000-000000000000","dddddddd-0000-4000-8000-000000000000"],"dryRun":true}'
{
"dryRun": true,
"dailyCredits": 0.6,
"items": [
{
"suggestionId": "cccccccc-0000-4000-8000-000000000000",
"outcome": "created",
"promptId": null
},
{
"suggestionId": "dddddddd-0000-4000-8000-000000000000",
"outcome": "already_tracked",
"promptId": null
}
]
}
Errors
| Status | Code | Cause |
|---|---|---|
400 | INVALID_REQUEST | The list is empty, has more than 20 suggestions, or a value is invalid |
404 | RESOURCE_NOT_FOUND | The workspace, topic or tag is missing or inaccessible |
409 | CONFLICT | The request conflicts with the current state |
403 API_KEY_READ_ONLY. On 429, honor Retry-After. If the write limiter is unavailable or writes are suspended, the request returns 503 SERVICE_UNAVAILABLE and nothing changes.
