List Memories

This endpoint retrieves a paginated list of memories. It can fetch either all memories for the authenticated user or memories from a specific space.

GET /api/memories

Query Parameters

ParameterTypeRequiredDefaultDescription
startnumberNo0Starting index for pagination
countnumberNo10Number of items to return per page
spaceIdstringNo-ID of the space to fetch memories from

Response

Success Response

{
  "items": [
    {
      "id": "memory-123",
      "uuid": "memory-123",
      "type": "page",
      "url": "https://example.com/article",
      "title": "Example Article",
      "description": "Article description",
      "ogImage": "https://example.com/image.jpg",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "total": 100
}

Response Fields

FieldTypeDescription
itemsarrayList of memory items
items[].idstringUnique identifier for the memory
items[].uuidstringSame as id (included for backward compatibility)
items[].typestringType of content (e.g., “page”, “note”, “tweet”)
items[].urlstringURL of the content
items[].titlestringTitle of the content
items[].descriptionstringDescription of the content (if available)
items[].ogImagestringOpen Graph image URL (if available)
items[].createdAtstringISO timestamp of when the memory was created
totalnumberTotal count of available memories

Error Responses

401 Unauthorized

{
  "error": "Unauthorized"
}

404 Not Found

{
  "error": "Space not found"
}

Caching

The endpoint implements caching mechanisms for better performance:

  • Cache-Control: private, max-age=300 (5 minutes)
  • Varies on: Cookie header
  • ETag support: Client can use If-None-Match header to get 304 Not Modified responses

Access Control

Personal Memories

  • Requires authentication
  • Returns all memories owned by the authenticated user

Space Memories

When spaceId is provided:

  1. Public Spaces:
    • Accessible to all users
    • No authentication required
  2. Private Spaces:
    • Requires authentication
    • Access granted if user:
      • Owns the space
      • Has accepted access through spaceAccess

Examples

List Personal Memories

GET /api/memories?start=0&count=10

List Space Memories

GET /api/memories?spaceId=space123&start=0&count=20

Using ETag for Caching

GET /api/memories
If-None-Match: "user123-0-10"

If content hasn’t changed, receives:

HTTP/1.1 304 Not Modified
ETag: "user123-0-10"