Update a topic
curl --request PATCH \
--url https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"text": "<string>"
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}"
payload = { "text": "<string>" }
headers = {
"Authorization": "<authorization>",
"If-Match": "<if-match>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: '<authorization>',
'If-Match': '<if-match>',
'Content-Type': 'application/json'
},
body: JSON.stringify({text: '<string>'})
};
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
Update a topic
Rename a topic using the ETag you last read in If-Match. Prompt associations and retained answers are preserved when the name of the topic changes.
PATCH
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
keywords
/
{keywordId}
Update a topic
curl --request PATCH \
--url https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"text": "<string>"
}
'import requests
url = "https://www.qwairy.co/api/v1/brands/{brandId}/keywords/{keywordId}"
payload = { "text": "<string>" }
headers = {
"Authorization": "<authorization>",
"If-Match": "<if-match>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: '<authorization>',
'If-Match': '<if-match>',
'Content-Type': 'application/json'
},
body: JSON.stringify({text: '<string>'})
};
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));Renames one topic. Its prompt associations and retained answers are preserved.
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 a topic object in the same shape as
Get a topic and a new ETag. The mutation response has no
top-level success field. Treat versions as opaque values, not counters.
Synthetic request and response
Read the current topic first. This example assumes its ETag is"4".
curl -X PATCH "https://www.qwairy.co/api/v1/brands/$BRAND_ID/keywords/$TOPIC_ID" \
-H "Authorization: Bearer $QWAIRY_API_TOKEN" \
-H 'If-Match: "4"' \
-H "Content-Type: application/json" \
-d '{"text":"Pricing and plans"}'
{
"topic": {
"id": "11111111-0000-4000-8000-000000000000",
"text": "Pricing and plans",
"version": 5,
"createdAt": "2026-09-01T09:00:00.000Z",
"updatedAt": "2026-09-01T10:00:00.000Z"
}
}
Errors
| Status | Code | Cause |
|---|---|---|
| 400 | INVALID_REQUEST | Invalid topic fields |
| 404 | RESOURCE_NOT_FOUND | Workspace or topic is missing or inaccessible |
| 409 | CONFLICT | Another topic already uses this name |
| 412 | PRECONDITION_FAILED | The ETag is stale or invalid |
| 428 | PRECONDITION_REQUIRED | If-Match is missing |
429, honor Retry-After; writes can return
503 SERVICE_UNAVAILABLE if the write limiter is unavailable.
