> ## 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 Memory Export

> Retrieve the latest structured memory export after submitting an export job, with optional entity filters.

Retrieve the latest structured memory export after submitting an export job. You can filter the export by `user_id`, `agent_id`, `app_id`, `run_id`, `created_at`, or `updated_at` to get the most recent export matching your filters.


## OpenAPI

````yaml post /v1/exports/get
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/exports/get:
    post:
      tags:
        - exports
      summary: Export data based on filters
      description: Get the latest memory export.
      operationId: exports_list
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                memory_export_id:
                  type: string
                  description: The unique identifier of the memory export.
                filters:
                  type: object
                  properties:
                    user_id:
                      type: string
                    agent_id:
                      type: string
                    app_id:
                      type: string
                    run_id:
                      type: string
                    created_at:
                      type: string
                    updated_at:
                      type: string
                  description: >-
                    Filters to apply while exporting memories. Available fields
                    are: user_id, agent_id, app_id, run_id, created_at,
                    updated_at.
                org_id:
                  type: string
                  description: Filter exports by organization ID.
                project_id:
                  type: string
                  description: Filter exports by project ID.
      responses:
        '200':
          description: Successful export.
          content:
            application/json:
              schema:
                type: object
                description: Export data response in an object format.
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      One of the filters: app_id, user_id, agent_id, run_id is
                      required!
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: No memory export request found
      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")


            memory_export_id = "<memory_export_id>"


            response =
            client.get_memory_export(memory_export_id=memory_export_id)

            print(response)
        - 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" });

            const memory_export_id = "<memory_export_id>";

            // Get memory export
            client.getMemoryExport({ memory_export_id })
              .then(result => console.log(result))
              .catch(error => console.error(error));
        - lang: cURL
          source: |-
            curl --request POST \
              --url 'https://api.mem0.ai/v1/exports/get/' \
              --header 'Authorization: Token <api-key>' \
              --data '{
                "memory_export_id": "<memory_export_id>"
            }'
        - lang: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\tmemory_export_id := \"<memory_export_id>\"\n\n\treq, _ := http.NewRequest(\"POST\", \"https://api.mem0.ai/v1/exports/get/\", 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(string(body))\n}"
        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            $data = json_encode(['memory_export_id' => '<memory_export_id>']);

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.mem0.ai/v1/exports/get/",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => $data,
              CURLOPT_HTTPHEADER => [
                "Authorization: Token <api-key>",
                "Content-Type: application/json"
              ],
            ]);

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

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: Java
          source: >-
            String data = "{\"memory_export_id\":\"<memory_export_id>\"}";


            HttpResponse<String> response =
            Unirest.post("https://api.mem0.ai/v1/exports/get/")
              .header("Authorization", "Token <api-key>")
              .header("Content-Type", "application/json")
              .body(data)
              .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'

````