POST
/
api
/
v1
/
webhooks
/
projects
/
{project_id}
# To use the Python SDK, install the package:
# pip install mem0ai

from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key", org_id="your_org_id", project_id="your_project_id")

# Create a webhook
webhook = client.create_webhook(
    url="https://your-webhook-url.com",
    name="My Webhook",
    project_id="your_project_id",
    event_types=["memory:add"]
)
print(webhook)
{
  "webhook_id": "<string>",
  "name": "<string>",
  "url": "<string>",
  "event_types": [
    "<string>"
  ],
  "is_active": true,
  "project": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Create Webhook

Create a webhook by providing the project ID and the webhook details.

Authorizations

Authorization
string
header
required

API key authentication. Prefix your Mem0 API key with 'Token '. Example: 'Token your_api_key'

Path Parameters

project_id
string
required

Unique identifier of the project

Body

application/json
url
string
required

URL endpoint for the webhook

name
string

Name of the webhook

event_types
enum<string>[]

List of event types to subscribe to

Available options:
memory:add,
memory:update,
memory:delete
is_active
boolean

Whether the webhook is active

project_id
string

Unique identifier of the project

Response

201
application/json
Webhook created successfully
webhook_id
string
name
string
url
string
event_types
string[]
is_active
boolean
project
string
created_at
string
updated_at
string