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

> Build custom integrations with MemoryPlugin using our OpenAPI specification

export const ArticleInfo = ({author, lastUpdated}) => {
  const authorAvatar = author === 'asad' ? '/images/author-asad.jpeg' : 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="asad" lastUpdated="2025-08-20" />

For developers who want to create custom integrations or use MemoryPlugin on unsupported platforms, we provide a comprehensive OpenAPI specification that you can use to build your own integrations.

## OpenAPI Specification

Our API is fully documented using the industry-standard OpenAPI format:

<Card title="MemoryPlugin OpenAPI Spec" icon="external-link" href="https://www.memoryplugin.com/openapi.json">
  Access the complete OpenAPI specification
</Card>

The OpenAPI spec includes:

* All API endpoints with detailed documentation
* Request/response schemas and examples
* Authentication requirements
* Machine-readable instructions for automated tools

## Supported Integration Tools

The OpenAPI specification can be imported into many platforms and tools:

### Automation Platforms

* **n8n**: Create custom nodes using our OpenAPI spec
* **Zapier**: Build custom integrations (if they support OpenAPI import)
* **Make (formerly Integromat)**: Custom API connections
* **Microsoft Power Automate**: Custom connector creation

### Development Tools

* **Postman**: Import for API testing and development
* **Insomnia**: API client for testing endpoints
* **Swagger UI**: Interactive API documentation
* **Code Generators**: Generate client libraries in various languages

### AI Platforms

* **[LibreChat](https://www.librechat.ai/docs/features/agents#actions)**: Import as actions for enhanced AI conversations
* **Other AI Clients**: Many third-party AI applications support OpenAPI imports

## Example: n8n Integration

Here's how you can use our OpenAPI spec with n8n:

<Steps>
  <Step title="Install n8n OpenAPI Node">
    Use the community package: [n8n-openapi-node](https://github.com/devlikeapro/n8n-openapi-node)
  </Step>

  <Step title="Import OpenAPI Spec">
    Configure the node to use: `https://www.memoryplugin.com/openapi.json`
  </Step>

  <Step title="Set Authentication">
    Configure Bearer token authentication with your MemoryPlugin API key
  </Step>

  <Step title="Create Workflows">
    Build n8n workflows that interact with your MemoryPlugin memories
  </Step>
</Steps>

## Authentication

All API requests require authentication using a Bearer token:

```http theme={null}
Authorization: Bearer YOUR_API_TOKEN_HERE
```

### Getting Your API Token

<Steps>
  <Step title="Access Dashboard">
    Go to your [MemoryPlugin Dashboard](https://memoryplugin.com/dashboard)
  </Step>

  <Step title="Find API Section">
    Look for the API or Auth Token section
  </Step>

  <Step title="Copy Token">
    Copy your authentication token
  </Step>

  <Step title="Keep Secure">
    Treat this token like a password - keep it secure and regenerate if compromised
  </Step>
</Steps>

## Core API Endpoints

The MemoryPlugin API provides endpoints for:

### Memory Management

* **GET /api/memory** - Retrieve and search memories
* **POST /api/memory** - Create new memories

### Bucket Management

* **GET /api/buckets** - List memory buckets
* **POST /api/buckets** - Create new buckets

### Combined Operations

* **GET /api/v2/memory** - Get memories and buckets in a single request

<Card title="Full API Reference" icon="book" href="/api-reference/introduction">
  Complete documentation for all endpoints, parameters, and examples
</Card>

## Implementation

For detailed implementation examples, request/response schemas, and code samples, see our comprehensive API reference documentation.

## Use Cases for Custom Integrations

<CardGroup cols={2}>
  <Card title="Workflow Automation" icon="gear">
    Integrate memory creation/retrieval into personal or team automation workflows
  </Card>

  <Card title="Custom AI Applications" icon="robot">
    Build your own AI applications with persistent memory capabilities
  </Card>

  <Card title="Data Migration" icon="database">
    Import existing knowledge bases or personal data into MemoryPlugin
  </Card>

  <Card title="Platform Integration" icon="plug">
    Add MemoryPlugin to platforms that don't have native support
  </Card>
</CardGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Rate Limiting">
    Respect API rate limits and implement appropriate retry logic in your integrations.
  </Accordion>

  <Accordion title="Error Handling">
    Always implement proper error handling for API calls and network issues.
  </Accordion>

  <Accordion title="Token Security">
    Never expose your API tokens in client-side code or public repositories.
  </Accordion>

  <Accordion title="Data Validation">
    Validate data before sending it to the API to avoid errors and ensure data quality.
  </Accordion>
</AccordionGroup>

## Support and Resources

<CardGroup cols={2}>
  <Card title="API Documentation" icon="book" href="/api-reference/introduction">
    Detailed API reference documentation
  </Card>

  <Card title="OpenAPI Spec" icon="file-code" href="https://www.memoryplugin.com/openapi.json">
    Machine-readable API specification
  </Card>

  <Card title="Example Integrations" icon="code-branch" href="https://github.com/devlikeapro/n8n-openapi-node">
    Community examples and tools
  </Card>

  <Card title="Developer Support" icon="headset" href="mailto:support@memoryplugin.com">
    Get help with your custom integration
  </Card>
</CardGroup>
