Update a label
curl --request PUT \
--url https://{host}/api/{session}/labels/{labelId} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Lead",
"colorHex": "#ff9485",
"color": null
}
'import requests
url = "https://{host}/api/{session}/labels/{labelId}"
payload = {
"name": "Lead",
"colorHex": "#ff9485",
"color": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Lead', colorHex: '#ff9485', color: null})
};
fetch('https://{host}/api/{session}/labels/{labelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/labels/{labelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Lead',
'colorHex' => '#ff9485',
'color' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/labels/{labelId}"
payload := strings.NewReader("{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/{session}/labels/{labelId}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/labels/{labelId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"label": {
"id": "label123",
"name": "Premium Clients",
"color": 3
}
}
Labels
Update Label
Update name and color of an existing label
PUT
/
api
/
{session}
/
labels
/
{labelId}
Update a label
curl --request PUT \
--url https://{host}/api/{session}/labels/{labelId} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Lead",
"colorHex": "#ff9485",
"color": null
}
'import requests
url = "https://{host}/api/{session}/labels/{labelId}"
payload = {
"name": "Lead",
"colorHex": "#ff9485",
"color": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Lead', colorHex: '#ff9485', color: null})
};
fetch('https://{host}/api/{session}/labels/{labelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/labels/{labelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Lead',
'colorHex' => '#ff9485',
'color' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/labels/{labelId}"
payload := strings.NewReader("{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/{session}/labels/{labelId}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/labels/{labelId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Lead\",\n \"colorHex\": \"#ff9485\",\n \"color\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"label": {
"id": "label123",
"name": "Premium Clients",
"color": 3
}
}
Description
This endpoint allows you to update information of an existing label, such as its name and color.URL Parameters
string
required
WhatsApp unique session ID
string
required
ID of the label to be updated
Request Body
string
required
New name of the label
number
required
New numeric code of the label color
Response
boolean
Indicates if the label was updated successfully
{
"success": true,
"label": {
"id": "label123",
"name": "Premium Clients",
"color": 3
}
}
Status Codes
200- Label updated successfully400- Invalid parameters401- Unauthorized404- Label not found
Usage Example
curl -X PUT https://api.wappfy.com.br/api/my-session/labels/label123 \
-H "Content-Type: application/json" \
-d '{
"name": "Premium Clients",
"color": 3
}'
const session = 'my-session';
const labelId = 'label123';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/labels/${labelId}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Premium Clients',
color: 3
})
});
const data = await response.json();
console.log(data);
import requests
session = 'my-session'
label_id = 'label123'
response = requests.put(
f'https://api.wappfy.com.br/api/{session}/labels/{label_id}',
json={
'name': 'Premium Clients',
'color': 3
}
)
data = response.json()
print(data)
Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Path Parameters
Body
application/json
⌘I
