Add Content
This endpoint allows you to add new content to your memories. It supports various content types including web pages, tweets, documents, and custom content.
POST /api/addRequest Body
{
// Required: The content to add (URL or text)
content: string,
// Optional: Array of space IDs to add content to (max 5)
spaces?: string[],
// Optional: Pre-fetched content data
prefetched?: {
contentToVectorize: string,
contentToSave: string,
title: string,
type: string,
description?: string,
ogImage?: string
}
}Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The content to add. Must not be empty. Can be a URL or text content. |
spaces | string[] | No | Array of space IDs where the content should be added. Maximum 5 spaces allowed. |
prefetched | object | No | Pre-fetched content data for optimization |
prefetched.contentToVectorize | string | Yes* | Content to be vectorized for search |
prefetched.contentToSave | string | Yes* | Content to be saved in the database |
prefetched.title | string | Yes* | Title of the content |
prefetched.type | string | Yes* | Type of the content |
prefetched.description | string | No | Description of the content |
prefetched.ogImage | string | No | Open Graph image URL |
*Required if prefetched object is provided
Response
Success Response
{
"message": "Content added successfully",
"id": "add-user123-abc456",
"type": "page"
}| Field | Type | Description |
|---|---|---|
message | string | Success message |
id | string | Unique identifier for the added content |
type | string | Type of content that was added |
Error Responses
400 Bad Request
{
"error": "Could not determine content type",
"details": "Error message details"
}401 Unauthorized
{
"error": "You must be logged in to add content"
}403 Forbidden
{
"error": "Space permission denied",
"details": "space123: Not authorized to add to this space"
}409 Conflict
{
"error": "That page already exists in your memories"
}500 Internal Server Error
{
"error": "Failed to queue content for processing"
}Notes
- Authentication is required for this endpoint
- Content type is automatically determined if not provided in
prefetched - URLs are validated for accessibility before processing
- Space permissions are checked if spaces are specified:
- For public spaces, only the owner can add content
- For private spaces, both owner and users in the allowlist can add content
- Duplicate content detection is implemented to prevent redundant entries
Examples
Adding a Web Page
{
"content": "https://example.com/article",
"spaces": ["space123", "space456"]
}Adding Text Content with Pre-fetched Data
{
"content": "My important note",
"prefetched": {
"contentToVectorize": "My important note about AI",
"contentToSave": "My important note about AI",
"title": "AI Notes",
"type": "note",
"description": "Personal notes about artificial intelligence"
}
}