Delete Webhook - Mem0

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.


Delete a Webhook Using Different SDKs

Python

# To use the Python SDK, install the package:
# pip install mem0ai

from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key")

# Delete a webhook
response = client.delete_webhook(webhook_id="your_webhook_id")
print(response)

JavaScript

// To use the JavaScript SDK, install the package:
// npm i mem0ai

import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: "your-api-key" });

// Delete a webhook
client.deleteWebhook("your_webhook_id")
    .then(response => console.log('Delete webhook response:', response))
    .catch(error => console.error(error));

cURL

curl -X DELETE "https://api.mem0.ai/api/v1/webhooks/your_webhook_id/webhook/" \
     -H "Authorization: Token your-api-key"

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.mem0.ai/api/v1/webhooks/your_webhook_id/webhook/",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => ["Authorization: Token your-api-key"],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

Go

package main

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

func main() {
    req, _ := http.NewRequest("DELETE", "https://api.mem0.ai/api/v1/webhooks/your_webhook_id/webhook/", nil)
    req.Header.Add("Authorization", "Token your_api_key")

res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

fmt.Println(string(body))
}

Java

import com.konghq.unirest.http.HttpResponse;
import com.konghq.unirest.http.Unirest;

// Delete a webhook
HttpResponse<String> response = Unirest.delete("https://api.mem0.ai/api/v1/webhooks/your_webhook_id/webhook/")
    .header("Authorization", "Token your-api-key")
    .asString();

System.out.println(response.getBody());

Ruby

require 'uri'
require 'net/http'

url = URI("https://api.mem0.ai/api/v1/webhooks/{webhook_id}/")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body

Response Status Codes

Response Format

{
  "message": "Webhook deleted successfully"
}
{
  "error": "You don't have access to this webhook"
}
{
  "error": "Webhook not found"
}

Authorizations

Path Parameters