curl --request POST \
--url https://api.wachap.com/v1/whatsapp/labels/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "account_123",
"labelId": "label_vip",
"phone": "+2290100000000"
}
'{
"success": true,
"label": {
"id": "<string>",
"userId": "<string>",
"accountId": "<string>",
"labelId": "<string>",
"name": "<string>",
"color": 123,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
},
"assignment": {
"accountId": "<string>",
"labelId": "<string>",
"conversationJid": "<string>",
"phone": "<string>",
"labeled": true,
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
}
}Étiquettes WhatsApp
Appliquer une étiquette
Associez une étiquette à une conversation WhatsApp
POST
/
whatsapp
/
labels
/
apply
curl --request POST \
--url https://api.wachap.com/v1/whatsapp/labels/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "account_123",
"labelId": "label_vip",
"phone": "+2290100000000"
}
'{
"success": true,
"label": {
"id": "<string>",
"userId": "<string>",
"accountId": "<string>",
"labelId": "<string>",
"name": "<string>",
"color": 123,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
},
"assignment": {
"accountId": "<string>",
"labelId": "<string>",
"conversationJid": "<string>",
"phone": "<string>",
"labeled": true,
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
}
}Endpoint
Body Parameters
string
requis
Identifiant du compte WhatsApp.
string
Identifiant d’une étiquette existante.
string
Nom d’une étiquette existante lorsque vous ne disposez pas de
labelId.boolean
Crée l’étiquette
labelName si elle n’existe pas. Ce champ est facultatif et vaut false par défaut.integer
Couleur utilisée uniquement si l’étiquette doit être créée.
string
JID complet de la conversation. Fournissez
conversationJid ou phone.string
Numéro au format international lorsque le JID n’est pas connu.
Exemple avec création automatique
curl -X POST https://api.wachap.com/v1/whatsapp/labels/apply \
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d '{
"accountId": "account_123",
"labelName": "Nouveau prospect",
"createIfMissing": true,
"color": 3,
"phone": "+2290100000000"
}'
Réponse
{
"success": true,
"label": {
"labelId": "label_prospect",
"name": "Nouveau prospect",
"color": 3,
"deleted": false
},
"assignment": {
"accountId": "account_123",
"labelId": "label_prospect",
"conversationJid": "2290100000000@s.whatsapp.net",
"phone": "2290100000000",
"labeled": true,
"source": "api"
}
}
Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/json
