Skip to main content
POST
/
webhooks
/
delete
Deletar um webhook
curl --request POST \
  --url https://api.abacatepay.com/v2/webhooks/delete \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "webh_abc123xyz"
}
'
import requests

url = "https://api.abacatepay.com/v2/webhooks/delete"

payload = { "id": "webh_abc123xyz" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 'webh_abc123xyz'})
};

fetch('https://api.abacatepay.com/v2/webhooks/delete', 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.abacatepay.com/v2/webhooks/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'webh_abc123xyz'
]),
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.abacatepay.com/v2/webhooks/delete"

payload := strings.NewReader("{\n \"id\": \"webh_abc123xyz\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.abacatepay.com/v2/webhooks/delete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"webh_abc123xyz\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.abacatepay.com/v2/webhooks/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"webh_abc123xyz\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "webh_abc123xyz",
    "name": "Webhook de Pagamentos",
    "endpoint": "https://meusite.com/webhooks/abacatepay",
    "events": [
      "checkout.completed",
      "subscription.renewed"
    ],
    "devMode": false,
    "v2": true,
    "createdAt": "2025-01-01T00:00:00.000Z",
    "updatedAt": "2025-01-01T00:00:00.000Z"
  },
  "error": null,
  "success": true
}
{
"error": "Token de autenticação inválido ou ausente."
}
{
"error": "Webhook não encontrado."
}

Requer a permissão WEBHOOK:DELETE.

Authorizations

Authorization
string
header
required

Todas as requisições devem incluir sua chave de API no header Authorization usando o formato Bearer <abacatepay-api-key>. Sem esse header a requisição será rejeitada.

Saiba mais sobre como criar e usar chaves de API na documentação de autenticação.

Body

application/json
id
string
required

Identificador único do webhook a ser deletado

Example:

"webh_abc123xyz"

Response

Webhook deletado com sucesso.

data
object

Os dados do webhook.

error
string | null
Example:

null

success
boolean

Se a requisição obteve sucesso ou não.

Example:

true