API for managing personal memory items with authentication and user-specific data.
API for managing personal 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.
Create a new user-defined graph schema.
This endpoint allows users to define custom node types and relationships for their knowledge graph. The schema will be validated and stored for use in future memory extractions.
Features:
status to "active" to immediately activate the schema, or "draft" to save as draft (default)enum_values to restrict property values to a predefined list (max 15 values)Schema Limits (optimized for LLM performance):
Property Types & Validation:
string: Text values with optional enum_values, min_length, max_length, patterninteger: Whole numbers with optional min_value, max_valuefloat: Decimal numbers with optional min_value, max_valueboolean: True/false valuesdatetime: ISO 8601 timestamp stringsarray: Lists of valuesobject: Complex nested objectsEnum Values:
enum_values to any string property to restrict values to a predefined listdefault to set a default enum value"enum_values": ["small", "medium", "large"]When to Use Enums:
When to Avoid Enums:
Unique Identifiers & Entity Resolution:
unique_identifiers are used for entity deduplication and mergingLLM-Friendly Descriptions:
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerRequired Headers:
Schema scopes available through the API
curl -i -X POST \
http://memory.papr.ai/v1/schemas \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"id": "string",
"name": "string",
"description": "string",
"version": "1.0.0",
"user_id": "string",
"workspace_id": "string",
"organization": "string",
"namespace": "string",
"node_types": {
"property1": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"required_properties": [
"string"
],
"unique_identifiers": [
"string"
],
"color": "#3498db",
"icon": "string"
},
"property2": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"required_properties": [
"string"
],
"unique_identifiers": [
"string"
],
"color": "#3498db",
"icon": "string"
}
},
"relationship_types": {
"property1": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"allowed_source_types": [
"string"
],
"allowed_target_types": [
"string"
],
"cardinality": "one-to-one",
"color": "#e74c3c"
},
"property2": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"allowed_source_types": [
"string"
],
"allowed_target_types": [
"string"
],
"cardinality": "one-to-one",
"color": "#e74c3c"
}
},
"status": "draft",
"scope": "personal",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"read_access": [
"string"
],
"write_access": [
"string"
],
"usage_count": 0,
"last_used_at": "2019-08-24T14:15:22Z"
}'{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "version": "1.0.0", "user_id": "string", "workspace_id": "string", "organization": "string", "namespace": "string", "node_types": { … }, "relationship_types": { … }, "status": "draft", "scope": "personal", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "read_access": [ … ], "write_access": [ … ], "usage_count": 0, "last_used_at": "2019-08-24T14:15:22Z" }, "error": "string", "code": 200 }
List all schemas accessible to the authenticated user.
Returns schemas that the user owns or has read access to, including:
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headercurl -i -X GET \
'http://memory.papr.ai/v1/schemas?status_filter=string&workspace_id=string' \
-H 'X-API-Key: YOUR_API_KEY_HERE'{ "success": true, "data": [ { … } ], "code": 200, "total": 1 }
curl -i -X GET \
'http://memory.papr.ai/v1/schemas/{schema_id}' \
-H 'X-API-Key: YOUR_API_KEY_HERE'{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "version": "1.0.0", "user_id": "string", "workspace_id": "string", "organization": "string", "namespace": "string", "node_types": { … }, "relationship_types": { … }, "status": "draft", "scope": "personal", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "read_access": [ … ], "write_access": [ … ], "usage_count": 0, "last_used_at": "2019-08-24T14:15:22Z" }, "error": "string", "code": 200 }
Update an existing schema.
Allows modification of schema properties, node types, relationship types, and status. User must have write access to the schema. Updates create a new version while preserving the existing data.
Status Management:
status to "active" to activate the schema and trigger Neo4j index creationstatus to "draft" to deactivate the schemastatus to "archived" to soft-delete the schemacurl -i -X PUT \
'http://memory.papr.ai/v1/schemas/{schema_id}' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{}'{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "version": "1.0.0", "user_id": "string", "workspace_id": "string", "organization": "string", "namespace": "string", "node_types": { … }, "relationship_types": { … }, "status": "draft", "scope": "personal", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "read_access": [ … ], "write_access": [ … ], "usage_count": 0, "last_used_at": "2019-08-24T14:15:22Z" }, "error": "string", "code": 200 }
curl -i -X DELETE \
'http://memory.papr.ai/v1/schemas/{schema_id}' \
-H 'X-API-Key: YOUR_API_KEY_HERE'