API for managing enterprise context and memory items with authentication and user-specific data.
API for managing enterprise context and memory items with authentication and user-specific data.
This API supports three authentication methods:
X-API-Key headerX-API-Key: <your-api-key>X-Session-Token headerX-Session-Token: <your-session-token>Authorization headerAuthorization: Bearer <token>All endpoints require one of these authentication methods.
If true, return 404 if the memory has consent='none'. Ensures only consented memories are returned.
If true, return 404 if the memory has risk='flagged'. Filters out flagged content.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
curl -i -X GET \
'https://memory.papr.ai/v1/memory/{memory_id}?exclude_flagged=false&max_risk=string&require_consent=false' \
-H 'X-API-Key: YOUR_API_KEY_HERE'Memory successfully retrieved
Search results if successful
Search results if successful
Error message if failed
Error message if failed
Error message if failed
Additional error details or context
Additional error details or context
Additional error details or context
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
{ "code": 200, "data": { "memories": [], "nodes": [] }, "search_id": "abc123def456", "status": "success" }
Add multiple memory items in a batch with size validation and background processing.
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerRequired Headers:
The API validates individual memory content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
Unified processing policy: transform_embedding, graph, consent, risk, acl.
Unified processing policy: transform_embedding, graph, consent, risk, acl.
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
List of memory items to add in batch
Unified processing policy: transform_embedding, graph, consent, risk, acl.
Unified processing policy: transform_embedding, graph, consent, risk, acl.
The content of the memory item you want to add to memory
Memory item type; defaults to 'text' if omitted
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Metadata used in graph and vector store for a memory item. Include role and category here.
Metadata used in graph and vector store for a memory item. Include role and category here.
Conversation history context for this memory. Use for providing message history when adding a memory. Format: [{role: 'user'|'assistant', content: '...'}]
Conversation history context for this memory. Use for providing message history when adding a memory. Format: [{role: 'user'|'assistant', content: '...'}]
DEPRECATED: Use 'policy' instead. Legacy graph + OMO policy. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
DEPRECATED: Use 'policy' instead. Legacy graph + OMO policy. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use 'policy.graph' instead. Legacy graph generation configuration. If both policy and graph_generation are provided, policy takes precedence.
DEPRECATED: Use 'policy.graph' instead. Legacy graph generation configuration. If both policy and graph_generation are provided, policy takes precedence.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'policy' instead. Migration options: 1. Specific memory: relationships=[{source: '$this', target: 'mem_123', type: 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related memories: link_to_related_memories=3
DEPRECATED: Use 'policy' instead. Migration options: 1. Specific memory: relationships=[{source: '$this', target: 'mem_123', type: 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related memories: link_to_related_memories=3
Number of items to process in parallel
Number of items to process in parallel
Number of items to process in parallel
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
DEPRECATED: Use 'policy' instead. Legacy graph + OMO policy. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
DEPRECATED: Use 'policy' instead. Legacy graph + OMO policy. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use policy.graph.link_to instead. Shorthand DSL for node/edge constraints (same as node_constraints, compact syntax). Expands and merges into memory_policy.node_constraints and edge_constraints at resolve time. Default create is upsert; use dict form with create='lookup' (or legacy 'never') for link-only. Formats: - String: 'Task:title' (semantic match on Task.title, upsert by default) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}, 'create': 'lookup'}} (full options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example lookup-only: {'SecurityPolicy:name': {'create': 'lookup'}}
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
DEPRECATED - Internal only. Auto-populated from API key scope. Do not set manually. The organization is resolved automatically from the API key's associated organization.
curl -i -X POST \
'https://memory.papr.ai/v1/memory/batch?skip_background_processing=false' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"batch_size": 10,
"external_user_id": "external_user_abcde",
"memories": [
{
"content": "Meeting notes from the product planning session",
"metadata": {
"createdAt": "2024-03-21T10:00:00Z",
"emoji tags": "📊,💡,📝",
"emotion tags": "focused, productive",
"hierarchical structures": "Business/Planning/Product",
"topics": "product, planning"
},
"type": "text"
},
{
"content": "Follow-up tasks from the planning meeting",
"metadata": {
"createdAt": "2024-03-21T11:00:00Z",
"emoji tags": "✅,📋",
"emotion tags": "organized",
"hierarchical structures": "Business/Tasks/Planning",
"topics": "tasks, planning"
},
"type": "text"
}
],
"user_id": "internal_user_id_12345"
}'Memories successfully added
Human-readable status message
Human-readable status message
Human-readable status message
Batch-level error message, if any
Batch-level error message, if any
Batch-level error message, if any
Additional error details or context
Additional error details or context
Additional error details or context
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
{ "code": 200, "status": "success", "message": "string", "error": "string", "details": {}, "batch_id": "string", "successful": [ { … } ], "errors": [ { … } ], "total_processed": 0, "total_successful": 0, "total_failed": 0, "total_content_size": 0, "total_storage_size": 0 }
Delete all memory items for a user.
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerUser Resolution:
Required Headers:
WARNING: This operation cannot be undone. All memories for the resolved user will be permanently deleted.
Optional user ID to delete memories for (if not provided, uses authenticated user)
Optional user ID to delete memories for (if not provided, uses authenticated user)
Optional user ID to delete memories for (if not provided, uses authenticated user)
Optional external user ID to resolve and delete memories for
Optional external user ID to resolve and delete memories for
Optional external user ID to resolve and delete memories for
Optional namespace ID to scope deletion to
Optional namespace ID to scope deletion to
Optional namespace ID to scope deletion to
curl -i -X DELETE \
'https://memory.papr.ai/v1/memory/all?external_user_id=string&namespace_id=string&skip_parse=false&user_id=string' \
-H 'X-API-Key: YOUR_API_KEY_HERE'All memories successfully deleted
Human-readable status message
Human-readable status message
Human-readable status message
Batch-level error message, if any
Batch-level error message, if any
Batch-level error message, if any
Additional error details or context
Additional error details or context
Additional error details or context
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
Batch tracking ID for status polling via GET /v1/memory/batch/status/{batch_id} and WebSocket updates
{ "code": 200, "status": "success", "message": "string", "error": "string", "details": {}, "batch_id": "string", "successful": [ { … } ], "errors": [ { … } ], "total_processed": 0, "total_successful": 0, "total_failed": 0, "total_content_size": 0, "total_storage_size": 0 }