> ## 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.

# Delete Memories

> Delete all memories matching specified filters from the Mem0 memory store using the DELETE endpoint.



## OpenAPI

````yaml delete /v1/memories/
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:
  /v1/memories/:
    delete:
      tags:
        - memories
      description: >-
        Delete memories by filter. At least one filter is required. Previously,
        omitting all filters silently deleted everything; now it returns a
        validation error.
      operationId: memories_delete_all
      parameters:
        - name: user_id
          in: query
          schema:
            type: string
          description: Filter by user ID. Pass `*` to delete memories for all users.
        - name: agent_id
          in: query
          schema:
            type: string
          description: Filter by agent ID. Pass `*` to delete memories for all agents.
        - name: app_id
          in: query
          schema:
            type: string
          description: Filter by app ID. Pass `*` to delete memories for all apps.
        - name: run_id
          in: query
          schema:
            type: string
          description: Filter by run ID. Pass `*` to delete memories for all runs.
        - name: metadata
          in: query
          schema:
            type: object
          description: Filter memories by metadata (JSON string).
          style: deepObject
          explode: true
        - name: org_id
          in: query
          schema:
            type: string
          description: Filter memories by organization ID.
        - name: project_id
          in: query
          schema:
            type: string
          description: Filter memories by project ID.
      responses:
        '204':
          description: Successful deletion of memories.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Memories deleted successfully!
      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")


            # Delete all memories for a specific user

            client.delete_all(user_id="<user_id>")


            # Delete all memories for every user in the project (wildcard)

            client.delete_all(user_id="*")


            # Full project wipe: all four filters must be explicitly set to "*"

            client.delete_all(user_id="*", agent_id="*", app_id="*", run_id="*")


            # NOTE: Calling delete_all() with no filters raises a validation
            error.

            # At least one filter is required to prevent accidental data loss.
        - 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" });


            // Delete all memories for a specific user

            client.deleteAll({ user_id: "<user_id>" })
              .then(result => console.log(result))
              .catch(error => console.error(error));

            // Delete all memories for every user in the project (wildcard)

            client.deleteAll({ user_id: "*" })
              .then(result => console.log(result))
              .catch(error => console.error(error));

            // Full project wipe: all four filters must be explicitly set to "*"

            client.deleteAll({ user_id: "*", agent_id: "*", app_id: "*", run_id:
            "*" })
              .then(result => console.log(result))
              .catch(error => console.error(error));
        - lang: cURL
          source: |-
            # Delete memories for a specific user
            curl --request DELETE \
              --url 'https://api.mem0.ai/v1/memories/?user_id=<user_id>' \
              --header 'Authorization: Token <api-key>'

            # Delete memories for all users (wildcard)
            curl --request DELETE \
              --url 'https://api.mem0.ai/v1/memories/?user_id=*' \
              --header 'Authorization: Token <api-key>'

            # Full project wipe: all four filters must be set to *
            curl --request DELETE \
              --url 'https://api.mem0.ai/v1/memories/?user_id=*&agent_id=*&app_id=*&run_id=*' \
              --header 'Authorization: Token <api-key>'
        - lang: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/v1/memories/\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"Authorization\", \"Token <api-key>\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.mem0.ai/v1/memories/",
              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: Token <api-key>"
              ],
            ]);

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

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: Java
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://api.mem0.ai/v1/memories/")
              .header("Authorization", "Token <api-key>")
              .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'

````