Delete a topic
curl --request DELETE \
--url https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId} \
--header 'Authorization: <authorization>' \
--header 'If-Match: <if-match>'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}"
headers = {
"Authorization": "<authorization>",
"If-Match": "<if-match>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'If-Match': '<if-match>'}
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Topics
Delete a topic
Delete a topic label with the ETag you last read. Prompts, answers and history are retained, and the prompts are detached from the deleted topic.
DELETE
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
keywords
/
{keywordId}
Delete a topic
curl --request DELETE \
--url https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId} \
--header 'Authorization: <authorization>' \
--header 'If-Match: <if-match>'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}"
headers = {
"Authorization": "<authorization>",
"If-Match": "<if-match>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'If-Match': '<if-match>'}
};
fetch('https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Deletes the label and detaches it from prompts. Prompts and their retained answers
are preserved. The operation requires no request body.
Requires an active Business, Agency Business or Enterprise plan. Use an API token with write access enabled. See Writing data for
idempotency, conditional requests and error handling.
See Error codes for authentication, plan, idempotency
and server errors. On
Response
Returns200 with deleted: true and topicId.
Deleting an already absent label in an accessible workspace also succeeds.
For an existing label, a stale ETag returns 412 without deleting it.
Synthetic request and response
Use the ETag from Get a topic. This example assumes"4".
curl -X DELETE "https://www.qwairy.co/api/v1/brands/$BRAND_ID/keywords/$TOPIC_ID" \
-H "Authorization: Bearer $QWAIRY_API_TOKEN" \
-H 'If-Match: "4"'
{
"deleted": true,
"topicId": "11111111-0000-4000-8000-000000000000"
}
Errors
| Status | Code | Cause |
|---|---|---|
| 404 | RESOURCE_NOT_FOUND | Workspace is missing or inaccessible |
| 412 | PRECONDITION_FAILED | The existing label changed since your read |
| 428 | PRECONDITION_REQUIRED | If-Match is missing |
429, honor Retry-After; writes can return
503 SERVICE_UNAVAILABLE if the write limiter is unavailable.
