Mettre à jour un 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
Mettre à jour un Topic
Renommez un Topic avec l’ETag lu en dernier dans If-Match. Les associations aux prompts et les réponses conservées sont préservées quand le nom change.
PATCH
https://www.qwairy.co
/
api
/
v1
/
brands
/
{brandId}
/
keywords
/
{keywordId}
Mettre à jour un 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));Renomme un Topic. Ses associations aux prompts et ses réponses conservées sont préservées.
Nécessite une offre Business, Agency Business ou Enterprise active. Utilisez un jeton d’API dont l’accès en écriture est activé. Consultez Écrire des données pour l’idempotence, les requêtes conditionnelles et la gestion des erreurs.
Consultez Codes d’erreur pour les erreurs d’authentification, d’offre, d’idempotence et de serveur. Sur
Réponse
Renvoie200 avec un objet topic de la même forme que Obtenir un Topic et un nouvel ETag. La réponse de mutation n’a pas de champ success au premier niveau. Traitez les versions comme des valeurs opaques, et non comme des compteurs.
Requête et réponse synthétiques
Lisez d’abord le Topic actuel. Cet exemple suppose que son ETag est"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"
}
}
Erreurs
| Statut | Code | Cause |
|---|---|---|
| 400 | INVALID_REQUEST | Champs du Topic invalides |
| 404 | RESOURCE_NOT_FOUND | Workspace ou Topic absent ou inaccessible |
| 409 | CONFLICT | Un autre Topic utilise déjà ce nom |
| 412 | PRECONDITION_FAILED | L’ETag est périmé ou invalide |
| 428 | PRECONDITION_REQUIRED | If-Match est absent |
429, respectez Retry-After ; les écritures peuvent renvoyer 503 SERVICE_UNAVAILABLE si le limiteur d’écriture est indisponible.
