Skip to main content
DELETE
/
api
/
v2
/
webhooks
/
{webhook_id}
Delete a webhook
curl --request DELETE \
  --url https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://agp.eu.hcompany.ai/api/v2/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://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://agp.eu.hcompany.ai/api/v2/webhooks/{webhook_id}")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
Deletes a webhook. Deliveries to its URL stop immediately. Returns 204 No Content on success.

Path parameters

webhook_id
string
required
The webhook’s id (UUID).

Examples

curl -X DELETE https://agp.eu.hcompany.ai/api/v2/webhooks/f47ac10b-58cc-4372-a567-0e02b2c3d479 \
  -H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client

client = Client()

client.webhooks.delete_webhook(webhook_id="f47ac10b-58cc-4372-a567-0e02b2c3d479")
import { HaiAgentsClient } from "hai-agents";

const client = new HaiAgentsClient();

await client.webhooks.deleteWebhook({ webhookId: "f47ac10b-58cc-4372-a567-0e02b2c3d479" });

Errors

StatusCause
404Webhook not found or you don’t have access.