Papr Memory API (1.0.0)

API for managing memory, context, and retrieval for AI agents or apps with authentication and user-specific data.

Authentication This API supports three authentication methods: - API Key: Include your API key in the X-API-Key header

X-API-Key: <your-api-key>
  • Session Token: Include your session token in the X-Session-Token header
    X-Session-Token: <your-session-token>
  • Bearer Token: Include your OAuth2 token from Auth0 in the Authorization header
    Authorization: Bearer <token>

All endpoints require one of these authentication methods.

Download OpenAPI description
Languages
Servers
Production server
http://memory.papr.ai/

v1

Operations

Store Message

Request

Store a chat message and queue it for AI analysis and memory creation.

Authentication Required: Bearer token, API key, or session token

Processing Control:

  • Set process_messages: true (default) to enable full AI analysis and memory creation
  • Set process_messages: false to store messages only without processing into memories

Processing Flow (when process_messages=true):

  1. Message is immediately stored in PostMessage class
  2. Background processing analyzes the message for memory-worthiness
  3. If worthy, creates a memory with appropriate role-based categorization
  4. Links the message to the created memory

Role-Based Categories:

  • User messages: preference, task, goal, facts, context
  • Assistant messages: skills, learning

Session Management:

  • sessionId is required to group related messages
  • Use the same sessionId for an entire conversation
  • Retrieve conversation history using GET /messages/sessions/{sessionId}
Bodyapplication/jsonrequired
contentContent (string) or Array of Content (objects)(Content)required

The content of the chat message - can be a simple string or structured content objects

Any of:

The content of the chat message - can be a simple string or structured content objects

string(Content)

The content of the chat message - can be a simple string or structured content objects

rolestring(MessageRole)required

Role of the message sender (user or assistant)

Enum"user""assistant"
sessionIdstring(Sessionid)required

Session ID to group related messages in a conversation

metadataMemoryMetadata (object) or null

Optional metadata for the message

Any of:

Optional metadata for the message

process_messagesboolean(Process Messages)

Whether to process messages into memories (true) or just store them (false). Default is true.

Default true
organization_idOrganization Id (string) or Organization Id (null)(Organization Id)

Optional organization ID for multi-tenant message scoping

Any of:

Optional organization ID for multi-tenant message scoping

string(Organization Id)

Optional organization ID for multi-tenant message scoping

namespace_idNamespace Id (string) or Namespace Id (null)(Namespace Id)

Optional namespace ID for multi-tenant message scoping

Any of:

Optional namespace ID for multi-tenant message scoping

string(Namespace Id)

Optional namespace ID for multi-tenant message scoping

curl -i -X POST \
  http://memory.papr.ai/v1/messages \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "content": "Can you help me plan the Q4 product roadmap?",
    "metadata": {
      "location": "Office",
      "topics": [
        "product",
        "planning",
        "roadmap"
      ]
    },
    "process_messages": true,
    "role": "user",
    "sessionId": "session_123"
  }'

Responses

Message stored and queued for processing

Bodyapplication/json
objectIdstring(Objectid)required

Parse Server objectId of the stored message

Example: "msg_abc123"
sessionIdstring(Sessionid)required

Session ID of the conversation

Example: "session_123"
rolestring(MessageRole)required

Role of the message sender

Enum"user""assistant"
Example: "user"
contentContent (string) or Array of Content (objects)(Content)required

Content of the message - can be a simple string or structured content objects

Example: "Can you help me plan the Q4 product roadmap?"
Any of:

Content of the message - can be a simple string or structured content objects

string(Content)

Content of the message - can be a simple string or structured content objects

createdAtstring(date-time)(Createdat)required

When the message was created

Example: "2024-01-15T10:30:00Z"
processing_statusstring(Processing Status)

Status of background processing (queued, analyzing, completed, failed)

Default "queued"
Example: "queued"
Response
application/json
{ "content": "Can you help me plan the Q4 product roadmap?", "createdAt": "2024-01-15T10:30:00Z", "objectId": "msg_abc123", "processing_status": "queued", "role": "user", "sessionId": "session_123" }

Get Session History

Request

Retrieve message history for a specific conversation session.

Authentication Required: Bearer token, API key, or session token

Pagination:

  • Use limit and skip parameters for pagination
  • Messages are returned in chronological order (oldest first)
  • total_count indicates total messages in the session

Access Control:

  • Only returns messages for the authenticated user
  • Workspace scoping is applied if available
Path
session_idstring(Session Id)required
Query
limitinteger(Limit)[ 1 .. 100 ]

Maximum number of messages to return

Default 50
skipinteger(Skip)>= 0

Number of messages to skip for pagination

Default 0
curl -i -X GET \
  'http://memory.papr.ai/v1/messages/sessions/{session_id}?limit=50&skip=0' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

Message history retrieved

Bodyapplication/json
sessionIdstring(Sessionid)required

Session ID of the conversation

Example: "session_123"
messagesArray of objects(Messages)required

List of messages in chronological order

Example: [{"content":"Can you help me plan the Q4 product roadmap?","createdAt":"2024-01-15T10:30:00Z","objectId":"msg_abc123","processing_status":"completed","role":"user","sessionId":"session_123"},{"content":"I'd be happy to help you plan your Q4 roadmap. Let's start by identifying your key objectives.","createdAt":"2024-01-15T10:31:00Z","objectId":"msg_def456","processing_status":"completed","role":"assistant","sessionId":"session_123"}]
messages[].​objectIdstring(Objectid)required

Parse Server objectId of the stored message

Example: "msg_abc123"
messages[].​sessionIdstring(Sessionid)required

Session ID of the conversation

Example: "session_123"
messages[].​rolestring(MessageRole)required

Role of the message sender

Enum"user""assistant"
Example: "user"
messages[].​contentContent (string) or Array of Content (objects)(Content)required

Content of the message - can be a simple string or structured content objects

Example: "Can you help me plan the Q4 product roadmap?"
Any of:

Content of the message - can be a simple string or structured content objects

string(Content)

Content of the message - can be a simple string or structured content objects

messages[].​createdAtstring(date-time)(Createdat)required

When the message was created

Example: "2024-01-15T10:30:00Z"
messages[].​processing_statusstring(Processing Status)

Status of background processing (queued, analyzing, completed, failed)

Default "queued"
Example: "queued"
total_countinteger(Total Count)required

Total number of messages in the session

Example: 2
Response
application/json
{ "messages": [ {}, {} ], "sessionId": "session_123", "total_count": 2 }

Get Session Status

Request

Get processing status for messages in a session.

Authentication Required: Bearer token, API key, or session token

Status Information:

  • Total messages in session
  • Processing status breakdown (queued, analyzing, completed, failed)
  • Any messages with processing errors
Path
session_idstring(Session Id)required
curl -i -X GET \
  'http://memory.papr.ai/v1/messages/sessions/{session_id}/status' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Session processing status

Bodyapplication/json
any
Response
application/json
null

Memory

Operations

User

Operations

Feedback

Operations

Document

Operations

Schema Management

Operations

Messages

Operations

GraphQL

Operations