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

# API Introduction

> Learn how to integrate with the MemoryPlugin API

export const ArticleInfo = ({author, lastUpdated}) => {
  const authorAvatar = author === 'Alara' ? '/images/author-alara.jpg' : author === 'asad' ? '/images/author-alara.jpg' : null;
  const formatDate = dateInput => {
    if (!dateInput) return '';
    if (typeof dateInput === 'string' && !dateInput.match(/^\d{4}-\d{2}-\d{2}/)) {
      return dateInput;
    }
    try {
      const date = new Date(dateInput);
      const now = new Date();
      const diffTime = Math.abs(now - date);
      const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
      if (diffDays === 0) return 'today';
      if (diffDays === 1) return '1 day ago';
      if (diffDays < 7) return `${diffDays} days ago`;
      if (diffDays < 30) return `${Math.ceil(diffDays / 7)} week${Math.ceil(diffDays / 7) > 1 ? 's' : ''} ago`;
      if (diffDays < 365) return `${Math.ceil(diffDays / 30)} month${Math.ceil(diffDays / 30) > 1 ? 's' : ''} ago`;
      return `${Math.ceil(diffDays / 365)} year${Math.ceil(diffDays / 365) > 1 ? 's' : ''} ago`;
    } catch {
      return dateInput;
    }
  };
  return <div style={{
    display: "flex",
    alignItems: "center",
    gap: "8px",
    marginBottom: "16px",
    padding: "8px 12px",
    backgroundColor: "var(--ifm-color-emphasis-100)",
    borderRadius: "6px",
    fontSize: "14px",
    color: "var(--ifm-color-content-secondary)",
    border: "1px solid var(--ifm-color-emphasis-200)",
    opacity: "0.8"
  }}>
      <div style={{
    width: "40px",
    height: "40px",
    borderRadius: "50%",
    background: authorAvatar || "linear-gradient(45deg, #4F46E5, #7C3AED)",
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    color: "white",
    fontWeight: "bold",
    fontSize: "18px"
  }}>
        {authorAvatar ? <img src={authorAvatar} alt={author} style={{
    width: "100%",
    height: "100%",
    borderRadius: "50%"
  }} /> : author?.[0]?.toUpperCase()}
      </div>
      <div>
        <div style={{
    fontWeight: "400",
    fontSize: "14px"
  }}>Written by <span style={{
    fontWeight: "600"
  }}>{author}</span></div>
        <div style={{
    fontSize: "14px"
  }}>Last updated <span style={{
    fontWeight: "600"
  }}>{formatDate(lastUpdated)}</span></div>
      </div>
    </div>;
};

<ArticleInfo author="Alara" lastUpdated="2026-07-04" />

## Welcome to the MemoryPlugin API

The MemoryPlugin API lets you store, retrieve, and search memories programmatically, and query your imported chat history. It is the same API the browser extension and integrations use.

<Card title="MemoryPlugin API Specification" icon="code" href="https://www.memoryplugin.com/openapi.json">
  View the complete OpenAPI specification
</Card>

## Base URL

All API requests should be made to:

```
https://www.memoryplugin.com
```

## Authentication

Every endpoint requires your API token. Get it from the [dashboard](https://memoryplugin.com/dashboard): open **Settings** → **Integrations** and copy your token.

Include it as a bearer token in the request headers:

```bash theme={null}
Authorization: Bearer YOUR_API_TOKEN
```

Treat the token like a password. It grants full access to your memories and chat history, and you can regenerate it from the same settings tab if it leaks.

## Response Format

Endpoints return plain JSON objects. There is no shared envelope; each endpoint documents its own response shape. For example, `GET /api/v2/memory` returns:

```json theme={null}
{
  "memories": [
    "Prefers concise answers without preamble",
    "Works as a product designer at a fintech startup"
  ],
  "buckets": [
    { "id": 1, "name": "General" },
    { "id": 2, "name": "Work" }
  ]
}
```

## Error Handling

Errors use standard HTTP status codes (`400` for invalid input, `401` for a missing or bad token, `404` when something does not exist) with a JSON body:

```json theme={null}
{
  "error": "Human-readable error message"
}
```

## Available Endpoints

* **Memory endpoints**: store, retrieve, search, update, and delete memories
* **Bucket endpoints**: list and create memory buckets
* **Chat history endpoints**: recall, search, upload, and manage imported conversations

Explore the endpoint documentation for request and response details.
