Delete webhook
curl --request DELETE \
--url https://developer.encrata.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks/{id}"
payload = { "id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>'})
};
fetch('https://developer.encrata.com/api/webhooks/{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://developer.encrata.com/api/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>'
]),
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://developer.encrata.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://developer.encrata.com/api/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>"
},
"message": "<string>"
}Webhooks
Delete webhook
Remove a webhook endpoint and stop its deliveries.
DELETE
/
api
/
webhooks
/
{id}
Delete webhook
curl --request DELETE \
--url https://developer.encrata.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks/{id}"
payload = { "id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>'})
};
fetch('https://developer.encrata.com/api/webhooks/{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://developer.encrata.com/api/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>'
]),
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://developer.encrata.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://developer.encrata.com/api/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>"
},
"message": "<string>"
}Deletes a webhook. Encrata stops delivering to it immediately.
The ID is also accepted in a JSON body sent to
Authentication
Send your API key as a bearer token.Authorization: Bearer enc_xxxxxxxxxxxx
Deleting a webhook requires the workspace
admin role. tech and readonly keys get 403.Request
Pass the webhook ID in the path.string
required
The webhook ID to delete.
DELETE /api/webhooks for backwards compatibility:
string
The webhook ID to delete. Used only when the path contains no ID.
Deleting a webhook removes the endpoint. Its delivery history is retained, but you can no longer read it: list deliveries returns
404 once the webhook is gone. Export anything you need first.Examples
curl -X DELETE https://developer.encrata.com/api/webhooks/360cb300-d885-4c18-af2c-d259f936bb38 \
-H "Authorization: Bearer enc_xxxxxxxxxxxx"
import requests
webhook_id = "360cb300-d885-4c18-af2c-d259f936bb38"
requests.delete(
f"https://developer.encrata.com/api/webhooks/{webhook_id}",
headers={"Authorization": "Bearer enc_xxxxxxxxxxxx"},
)
const webhookId = "360cb300-d885-4c18-af2c-d259f936bb38";
await fetch(`https://developer.encrata.com/api/webhooks/${webhookId}`, {
method: "DELETE",
headers: { Authorization: "Bearer enc_xxxxxxxxxxxx" },
});
curl -X DELETE https://developer.encrata.com/api/webhooks \
-H "Authorization: Bearer enc_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"id": "360cb300-d885-4c18-af2c-d259f936bb38"}'
Response
Returns200 OK.
boolean
true when the webhook was deleted.string
A human-readable summary.
Example response
{
"success": true,
"result": { "status": "deleted" },
"message": "Webhook deleted."
}
Errors
| Status | Code | When |
|---|---|---|
400 | bad_request | No ID was supplied, or the JSON body could not be parsed. |
401 | unauthorized | The API key is missing, revoked, or disabled. |
403 | forbidden | Your role is not admin. |
404 | not_found | No webhook with that ID exists in your workspace. Deleting twice returns 404 the second time. |
500 | internal | Encrata could not delete the webhook. Retry. |
Example error
{
"success": false,
"result": { "code": "not_found" },
"message": "That webhook no longer exists. It may have been deleted."
}
Next steps
Pause instead of delete
Set
is_active: false to stop deliveries reversibly.Create a webhook
Register a replacement endpoint.
List webhooks
Confirm what is left in the workspace.
Error reference
Every status code the API returns.
Was this page helpful?