Atualizar endpoint de webhook
curl --request PATCH \
--url https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated callback",
"status": "active",
"subscribed_events": [
"webhook.test"
]
}
'import requests
url = "https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}"
payload = {
"name": "Updated callback",
"status": "active",
"subscribed_events": ["webhook.test"]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated callback',
status: 'active',
subscribed_events: ['webhook.test']
})
};
fetch('https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}', 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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}",
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' => 'Updated callback',
'status' => 'active',
'subscribed_events' => [
'webhook.test'
]
]),
CURLOPT_HTTPHEADER => [
"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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}"
payload := strings.NewReader("{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"consecutive_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"disabled_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "active",
"subscribed_events": [
"webhook.test"
],
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}Webhooks
Atualizar endpoint de webhook
Atualiza nome, URL, eventos assinados, ou status. Mudança de URL dispara validação SSRF antes de persistir.
PATCH
/
webhooks
/
endpoints
/
{endpoint_uuid}
Atualizar endpoint de webhook
curl --request PATCH \
--url https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated callback",
"status": "active",
"subscribed_events": [
"webhook.test"
]
}
'import requests
url = "https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}"
payload = {
"name": "Updated callback",
"status": "active",
"subscribed_events": ["webhook.test"]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated callback',
status: 'active',
subscribed_events: ['webhook.test']
})
};
fetch('https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}', 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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}",
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' => 'Updated callback',
'status' => 'active',
'subscribed_events' => [
'webhook.test'
]
]),
CURLOPT_HTTPHEADER => [
"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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}"
payload := strings.NewReader("{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.nlbs.ai/webhooks/endpoints/{endpoint_uuid}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlbs.ai/webhooks/endpoints/{endpoint_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated callback\",\n \"status\": \"active\",\n \"subscribed_events\": [\n \"webhook.test\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"consecutive_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"disabled_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "active",
"subscribed_events": [
"webhook.test"
],
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}{
"detail": "Resource not found."
}Path Parameters
UUID do endpoint de webhook.
Body
application/json
Novo nome legível do endpoint.
Required string length:
1 - 128Status do ciclo de vida do endpoint.
Available options:
active, disabled Example:
"active"
Lista substituta de eventos assinados.
Available options:
webhook.test, adverse_media.completed, adverse_media.failed Nova URL de destino HTTPS. Mudanças de URL passam por validação SSRF.
Required string length:
1 - 2048Response
Successful Response
Contagem atual de falhas de entrega consecutivas.
Timestamp de criação do endpoint.
Timestamp de quando o endpoint foi desativado.
Timestamp da última entrega com falha.
Timestamp da última entrega bem-sucedida.
Nome legível do endpoint de webhook.
Status do ciclo de vida do endpoint.
Available options:
active, disabled Tipos de evento assinados.
Available options:
webhook.test, adverse_media.completed, adverse_media.failed Timestamp da última atualização do endpoint.
URL de destino.
UUID do endpoint de webhook.

