Instances
Update instance settings
Updates instance settings such as name, webhook URL, or Cloud API credentials. Only the provided fields are modified.
PATCH
/
api
/
instances
/
{id}
Update instance settings
curl --request PATCH \
--url https://api.wappfy.io/api/instances/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "+5511999999999",
"cloud_phone_number_id": "1234567890",
"cloud_waba_id": "9876543210",
"cloud_access_token": "<string>",
"webhook_url": "https://example.com/webhook"
}
'import requests
url = "https://api.wappfy.io/api/instances/{id}"
payload = {
"name": "<string>",
"phone_number": "+5511999999999",
"cloud_phone_number_id": "1234567890",
"cloud_waba_id": "9876543210",
"cloud_access_token": "<string>",
"webhook_url": "https://example.com/webhook"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '+5511999999999',
cloud_phone_number_id: '1234567890',
cloud_waba_id: '9876543210',
cloud_access_token: '<string>',
webhook_url: 'https://example.com/webhook'
})
};
fetch('https://api.wappfy.io/api/instances/{id}', 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://api.wappfy.io/api/instances/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'phone_number' => '+5511999999999',
'cloud_phone_number_id' => '1234567890',
'cloud_waba_id' => '9876543210',
'cloud_access_token' => '<string>',
'webhook_url' => 'https://example.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.wappfy.io/api/instances/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.wappfy.io/api/instances/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wappfy.io/api/instances/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"name": "<string>",
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"phone_number": "<string>",
"display_name": "<string>",
"session_name": "<string>",
"phone_number_id": "<string>",
"waba_id": "<string>",
"access_token": "<string>",
"webhook_url": "<string>",
"profile_picture_url": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Instance ID
Body
application/json
Optional display name for the instance
Available options:
waha, cloud_api Phone number in international format (e.g., +5511999999999)
Example:
"+5511999999999"
Cloud API Phone Number ID (from Meta Business)
Example:
"1234567890"
Cloud API WhatsApp Business Account ID
Example:
"9876543210"
Cloud API permanent access token from Meta
Custom webhook URL for this instance
Example:
"https://example.com/webhook"
Response
Instance updated
Available options:
waha, cloud_api Available options:
created, starting, scan_qr, connected, disconnected, failed WhatsApp display name (pushName)
Was this page helpful?
⌘I
Update instance settings
curl --request PATCH \
--url https://api.wappfy.io/api/instances/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "+5511999999999",
"cloud_phone_number_id": "1234567890",
"cloud_waba_id": "9876543210",
"cloud_access_token": "<string>",
"webhook_url": "https://example.com/webhook"
}
'import requests
url = "https://api.wappfy.io/api/instances/{id}"
payload = {
"name": "<string>",
"phone_number": "+5511999999999",
"cloud_phone_number_id": "1234567890",
"cloud_waba_id": "9876543210",
"cloud_access_token": "<string>",
"webhook_url": "https://example.com/webhook"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '+5511999999999',
cloud_phone_number_id: '1234567890',
cloud_waba_id: '9876543210',
cloud_access_token: '<string>',
webhook_url: 'https://example.com/webhook'
})
};
fetch('https://api.wappfy.io/api/instances/{id}', 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://api.wappfy.io/api/instances/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'phone_number' => '+5511999999999',
'cloud_phone_number_id' => '1234567890',
'cloud_waba_id' => '9876543210',
'cloud_access_token' => '<string>',
'webhook_url' => 'https://example.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.wappfy.io/api/instances/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.wappfy.io/api/instances/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wappfy.io/api/instances/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"+5511999999999\",\n \"cloud_phone_number_id\": \"1234567890\",\n \"cloud_waba_id\": \"9876543210\",\n \"cloud_access_token\": \"<string>\",\n \"webhook_url\": \"https://example.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"name": "<string>",
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"phone_number": "<string>",
"display_name": "<string>",
"session_name": "<string>",
"phone_number_id": "<string>",
"waba_id": "<string>",
"access_token": "<string>",
"webhook_url": "<string>",
"profile_picture_url": "<string>"
}