Delete a tag
curl --request DELETE \
--url https://www.qwairy.co/api/v1/brands/{brandId}/tags/{tagId} \
--header 'Authorization: <authorization>' \
--header 'If-Match: <if-match>'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/tags/{tagId}"
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}/tags/{tagId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Tags
Delete a tag
Delete a tag label with the ETag you last read. Prompts, answers and history are retained, and the prompts are detached from the deleted tag.
DELETE
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
tags
/
{tagId}
Delete a tag
curl --request DELETE \
--url https://www.qwairy.co/api/v1/brands/{brandId}/tags/{tagId} \
--header 'Authorization: <authorization>' \
--header 'If-Match: <if-match>'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/tags/{tagId}"
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}/tags/{tagId}', 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.
You cannot delete the
See Error codes for authentication, plan, idempotency
and server errors. On
Branded or Non-branded system tag: in a workspace created from v1.21, Qwairy sets these two tags itself on prompts from their text.
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.
Response
Returns200 with deleted: true and tagId.
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 tag. This example assumes"4".
curl -X DELETE "https://www.qwairy.co/api/v1/brands/$BRAND_ID/tags/$TAG_ID" \
-H "Authorization: Bearer $QWAIRY_API_TOKEN" \
-H 'If-Match: "4"'
{
"deleted": true,
"tagId": "22222222-0000-4000-8000-000000000000"
}
Errors
| Status | Code | Cause |
|---|---|---|
| 400 | INVALID_REQUEST | The tag is the Branded or Non-branded system tag |
| 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.
