Mem0 events API

The events API from Mem0 — 2 operation(s) for events.

OpenAPI Specification

mem0-events-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Mem0 API Docs agents events API
  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: []
tags:
- name: events
paths:
  /v1/events/:
    get:
      tags:
      - events
      summary: Retrieve all events for current organization and project.
      operationId: events_list
      responses:
        '200':
          description: Successfully retrieved events.
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Total number of events matching the filters.
                  next:
                    type: string
                    nullable: true
                    description: URL for the next page of results.
                  previous:
                    type: string
                    nullable: true
                    description: URL for the previous page of results.
                  results:
                    type: array
                    description: Array of event objects.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: The unique identifier of the event.
                        event_type:
                          type: string
                          description: The type of event (e.g., ADD, SEARCH).
                        status:
                          type: string
                          enum:
                          - PENDING
                          - RUNNING
                          - FAILED
                          - SUCCEEDED
                          description: The current status of the event.
                        payload:
                          type: object
                          description: The original payload associated with the event.
                        metadata:
                          type: object
                          nullable: true
                          description: Additional metadata associated with the event.
                        results:
                          type: array
                          description: Array of results produced by the event. For add events, this confirms the write completed; temporal reasoning enrichment runs asynchronously by default.
                        created_at:
                          type: string
                          format: date-time
                          description: Timestamp when the event was created.
                        updated_at:
                          type: string
                          format: date-time
                          description: Timestamp when the event was last updated.
                        started_at:
                          type: string
                          format: date-time
                          description: Timestamp when event processing started.
                        completed_at:
                          type: string
                          format: date-time
                          description: Timestamp when event processing completed.
                        latency:
                          type: number
                          description: Processing time in milliseconds.
                required:
                - count
                - results
      x-code-samples:
      - lang: Python
        source: 'import requests


          url = "https://api.mem0.ai/v1/events/"


          headers = {"Authorization": "Token <api-key>"}


          response = requests.request("GET", url, headers=headers)


          print(response.text)'
      - lang: JavaScript
        source: "const options = {method: 'GET', headers: {Authorization: 'Token <api-key>'}};\n\nfetch('https://api.mem0.ai/v1/events/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request GET \\\n  --url https://api.mem0.ai/v1/events/ \\\n  --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/events/\"\n\n\treq, _ := http.NewRequest(\"GET\", 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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/v1/events/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.get(\"https://api.mem0.ai/v1/events/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .asString();"
  /v1/event/{event_id}/:
    get:
      tags:
      - events
      summary: Retrieve details of a specific event by its ID.
      operationId: event_read
      parameters:
      - name: event_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: The unique identifier of the event (UUID).
      responses:
        '200':
          description: Successfully retrieved event details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the event.
                  event_type:
                    type: string
                    description: The type of event (e.g., ADD, SEARCH).
                  status:
                    type: string
                    enum:
                    - PENDING
                    - RUNNING
                    - FAILED
                    - SUCCEEDED
                    description: The current status of the event.
                  payload:
                    type: object
                    description: The original payload associated with the event.
                  metadata:
                    type: object
                    nullable: true
                    description: Additional metadata associated with the event.
                  results:
                    type: array
                    description: Array of results produced by the event.
                  created_at:
                    type: string
                    format: date-time
                    description: Timestamp when the event was created.
                  updated_at:
                    type: string
                    format: date-time
                    description: Timestamp when the event was last updated.
                  started_at:
                    type: string
                    format: date-time
                    description: Timestamp when event processing started.
                  completed_at:
                    type: string
                    format: date-time
                    description: Timestamp when event processing completed.
                  latency:
                    type: number
                    description: Processing time in milliseconds.
        '404':
          description: Event not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
      x-code-samples:
      - lang: Python
        source: 'import requests


          url = "https://api.mem0.ai/v1/event/{event_id}/"


          headers = {"Authorization": "Token <api-key>"}


          response = requests.request("GET", url, headers=headers)


          print(response.text)'
      - lang: JavaScript
        source: "const options = {method: 'GET', headers: {Authorization: 'Token <api-key>'}};\n\nfetch('https://api.mem0.ai/v1/event/{event_id}/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request GET \\\n  --url https://api.mem0.ai/v1/event/{event_id}/ \\\n  --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/event/{event_id}/\"\n\n\treq, _ := http.NewRequest(\"GET\", 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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/v1/event/{event_id}/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.get(\"https://api.mem0.ai/v1/event/{event_id}/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .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'''
x-original-swagger-version: '2.0'