Enregistrer les prompts d’un audit de prospection
curl --request PATCH \
--url https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"prompts": [
{}
]
}
'import requests
url = "https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts"
payload = { "prompts": [{}] }
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({prompts: [{}]})
};
fetch('https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Audits de prospection
Enregistrer les prompts d’un audit de prospection
Remplacez le brouillon de relecture des prompts d’un audit de prospection avec l’ETag de la dernière lecture, sans écraser une modification concurrente.
PATCH
https://www.qwairy.co
/
api
/
v1
/
pitch-audits
/
{auditId}
/
prompts
Enregistrer les prompts d’un audit de prospection
curl --request PATCH \
--url https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"prompts": [
{}
]
}
'import requests
url = "https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts"
payload = { "prompts": [{}] }
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({prompts: [{}]})
};
fetch('https://www.qwairy.co/api/v1/pitch-audits/{auditId}/prompts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Remplace l’ensemble des prompts tant qu’un audit de prospection est en
Chaque prompt contient :
AWAITING_PROMPTS et dans la phase PROMPT_REVIEW. Lisez d’abord l’audit et écrivez avec son ETag actuel pour qu’une modification du tableau de bord ou de l’API ne soit pas écrasée en silence.
ETag renvoyé par la dernière réponse de Obtenir un audit de prospection.Ensemble de remplacement complet contenant de 20 à 100 prompts. Les identifiants de prompts doivent être uniques. Un draft inchangé créé avant cette règle garde son nombre de prompts.
| Champ | Type | Contrat |
|---|---|---|
id | string | Identifiant unique, 50 caractères au maximum |
text | string | Texte du prompt, 1000 caractères au maximum |
category | string | TOFU, MOFU ou BOFU |
topic | string | Libellé du Topic, 120 caractères au maximum |
Requête synthétique
curl -X PATCH "https://www.qwairy.co/api/v1/pitch-audits/$AUDIT_ID/prompts" \
-H "Authorization: Bearer $QWAIRY_API_TOKEN" \
-H 'If-Match: "1788350400000"' \
-H "Content-Type: application/json" \
-d '{"prompts":[{"id":"p1","text":"Which platform fits a growing revenue team?","category":"MOFU","topic":"Platform selection"}]}'
Réponse
Renvoie200 avec les prompts enregistrés, la nouvelle revision et un nouvel ETag. Utilisez cette nouvelle valeur si une autre modification de prompts est nécessaire.
Erreurs
| Statut | Code | Cause |
|---|---|---|
404 | RESOURCE_NOT_FOUND | L’audit est absent ou appartient à une autre équipe |
409 | INVALID_STATE_TRANSITION | L’audit n’attend plus la relecture des prompts |
412 | PRECONDITION_FAILED | L’audit a changé après l’ETag fourni |
428 | PRECONDITION_REQUIRED | If-Match est absent |

