> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mem0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Webhook

> Retrieve webhook configuration details for a specific project on the Mem0 platform.



## OpenAPI

````yaml get /api/v1/webhooks/projects/{project_id}/
openapi: 3.0.1
info:
  title: Mem0 API Docs
  description: mem0.ai API Docs
  contact:
    email: support@mem0.ai
  license:
    name: Apache 2.0
  version: v1
servers:
  - url: https://api.mem0.ai/
security:
  - ApiKeyAuth: []
paths:
  /api/v1/webhooks/projects/{project_id}/:
    get:
      tags:
        - webhooks
      summary: Get Project Webhooks
      description: Retrieve all webhooks for a specific project
      operationId: get_project_webhooks
      parameters:
        - name: project_id
          in: path
          required: true
          description: Unique identifier of the project.
          schema:
            type: string
      responses:
        '200':
          description: List of webhooks for the project.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    webhook_id:
                      type: string
                      description: Unique identifier of the webhook.
                    name:
                      type: string
                      description: Name of the webhook
                    url:
                      type: string
                      description: URL endpoint for the webhook.
                    event_types:
                      type: array
                      items:
                        type: string
                      description: List of event types the webhook subscribes to.
                    is_active:
                      type: boolean
                      description: Whether the webhook is active
                    project:
                      type: string
                      description: Name of the project the webhook is associated with
                    created_at:
                      type: string
                      format: date-time
                      description: Timestamp when the webhook was created
                    updated_at:
                      type: string
                      format: date-time
                      description: Timestamp when the webhook was last updated
        '403':
          description: Unauthorized access
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: You don't have access to this project
      x-code-samples:
        - lang: Python
          source: |-
            # To use the Python SDK, install the package:
            # pip install mem0ai

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

            # Get all webhooks
            webhooks = client.get_webhooks(project_id="your_project_id")
            print(webhooks)

            # 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", "memory:categorize"]
            )
            print(webhook)
        - lang: JavaScript
          source: |-
            // To use the JavaScript SDK, install the package:
            // npm i mem0ai

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

            // Get all webhooks
            client.getWebhooks('your_project_id')
              .then(webhooks => console.log(webhooks))
              .catch(err => console.error(err));

            // Create a webhook
            client.createWebhook({
              url: 'https://your-webhook-url.com',
              name: 'My Webhook',
              project_id: 'your_project_id',
              event_types: ['memory:add']
            })
              .then(webhook => console.log(webhook))
              .catch(err => console.error(err));
        - lang: cURL
          source: |-
            # Get all webhooks
            curl --request GET \
              --url 'https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/' \
              --header 'Authorization: Token your-api-key'

            # Create a webhook
            curl --request POST \
              --url 'https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/' \
              --header 'Authorization: Token your-api-key' \
              --header 'Content-Type: application/json' \
              --data '{
                "url": "https://your-webhook-url.com",
                "name": "My Webhook",
                "event_types": ["memory:add"]
              }'
        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

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

            $response = curl_exec($curl);

            // Create a webhook
            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => json_encode([
                "url" => "https://your-webhook-url.com",
                "name" => "My Webhook",
                "event_types" => ["memory:add"]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Token your-api-key",
                "Content-Type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            curl_close($curl);
        - lang: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\t// Get all webhooks\n\treq, _ := http.NewRequest(\"GET\", \"https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/\", nil)\n\treq.Header.Add(\"Authorization\", \"Token your-api-key\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\tfmt.Println(string(body))\n\n\t// Create a webhook\n\tpayload := strings.NewReader(`{\n\t\t\"url\": \"https://your-webhook-url.com\",\n\t\t\"name\": \"My Webhook\",\n\t\t\"event_types\": [\"memory:add\"]\n\t}`)\n\n\treq, _ = http.NewRequest(\"POST\", \"https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/\", payload)\n\treq.Header.Add(\"Authorization\", \"Token your-api-key\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ = http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ = ioutil.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: Java
          source: >-
            // Get all webhooks

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

            // Create a webhook

            HttpResponse<String> response =
            Unirest.post("https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/")
              .header("Authorization", "Token your-api-key")
              .header("Content-Type", "application/json")
              .body("{
                \"url\": \"https://your-webhook-url.com\",
                \"name\": \"My Webhook\",
                \"event_types\": [\"memory:add\"]
              }")
              .asString();
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Prefix your Mem0 API key with 'Token '. Example:
        'Token your_api_key'

````