Atualiza um webhook
curl --request PATCH \
--url https://api.zapsterapi.com/v1/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "Meu Webhook",
"url": "https://webhook.example.com/receive"
}
'import requests
url = "https://api.zapsterapi.com/v1/webhooks/{webhook_id}"
payload = {
"enabled": True,
"name": "Meu Webhook",
"url": "https://webhook.example.com/receive"
}
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({enabled: true, name: 'Meu Webhook', url: 'https://webhook.example.com/receive'})
};
fetch('https://api.zapsterapi.com/v1/webhooks/{webhook_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.zapsterapi.com/v1/webhooks/{webhook_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([
'enabled' => true,
'name' => 'Meu Webhook',
'url' => 'https://webhook.example.com/receive'
]),
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.zapsterapi.com/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\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.zapsterapi.com/v1/webhooks/{webhook_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapsterapi.com/v1/webhooks/{webhook_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 \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2025-03-12T23:12:19.448Z",
"enabled": true,
"id": "3nsnz68l0xbf0m3uu9tfo",
"name": "Meu Webhook",
"test_url": null,
"url": "https://webhook.mydomain.com"
}Webhooks
Atualizar Webhook
PATCH
/
webhooks
/
{webhook_id}
Atualiza um webhook
curl --request PATCH \
--url https://api.zapsterapi.com/v1/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "Meu Webhook",
"url": "https://webhook.example.com/receive"
}
'import requests
url = "https://api.zapsterapi.com/v1/webhooks/{webhook_id}"
payload = {
"enabled": True,
"name": "Meu Webhook",
"url": "https://webhook.example.com/receive"
}
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({enabled: true, name: 'Meu Webhook', url: 'https://webhook.example.com/receive'})
};
fetch('https://api.zapsterapi.com/v1/webhooks/{webhook_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.zapsterapi.com/v1/webhooks/{webhook_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([
'enabled' => true,
'name' => 'Meu Webhook',
'url' => 'https://webhook.example.com/receive'
]),
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.zapsterapi.com/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\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.zapsterapi.com/v1/webhooks/{webhook_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapsterapi.com/v1/webhooks/{webhook_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 \"enabled\": true,\n \"name\": \"Meu Webhook\",\n \"url\": \"https://webhook.example.com/receive\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2025-03-12T23:12:19.448Z",
"enabled": true,
"id": "3nsnz68l0xbf0m3uu9tfo",
"name": "Meu Webhook",
"test_url": null,
"url": "https://webhook.mydomain.com"
}Utilize este endpoint quando precisar atualizar dados do webhook.
Atenção: Toda e qualquer modificação utilizando este endpoint afetará todas as instâncias conectadas a este webhook.
Autorizações
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parâmetros de caminho
Identificador único do webhook.
Corpo
application/json
Resposta
201 - application/json
Webhook registrado com sucesso.
Resposta ao registrar um webhook.
Data e hora de criação do webhook.
Exemplo:
"2025-03-12T23:12:19.448Z"
Indica se o webhook está ativado.
Exemplo:
true
Identificador único do webhook.
Exemplo:
"3nsnz68l0xbf0m3uu9tfo"
Nome do webhook configurado.
Exemplo:
"Meu Webhook"
URL de teste do webhook, se configurada. Caso contrário, será null.
⚠️ Por enquanto esta propriedade sempre será
nullpois o controle de webhook de teste é feito através do endpoint direcionado para webhooks da instância.
Exemplo:
null
URL para onde os eventos do webhook serão enviados.
Exemplo:
"https://webhook.mydomain.com"