v1
Messages

Store Message

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
- **Optional `title`**: Set a human-readable title for the conversation (e.g., "Q4 Planning Session")
- Retrieve conversation history using GET /messages/sessions/{sessionId}
post/v1/messages

Request body

role'user' | 'assistant' required

Role of the message sender

sessionIdstring required

Session ID to group related messages in a conversation

titlestring nullable

Optional title for the conversation session. Sets the Chat.title in Parse Server for easy identification.

contextobject[] nullable

Optional context for the message (conversation history or relevant context)

relationships_jsonobject[] nullable

Optional array of relationships for Graph DB (Neo4j)

process_messagesboolean

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

user_idstring nullable

Internal Papr Parse user ID (_User.objectId). Use when you already have the resolved user, e.g. first-party Papr apps after login.

external_user_idstring nullable

Your application's external user identifier. Papr resolves or creates internal users automatically. Use for third-party integrations.

organization_idstring nullable

Optional organization ID for multi-tenant message scoping

namespace_idstring nullable

Optional namespace ID for multi-tenant message scoping

Example request

{
  "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",
  "title": "Q4 Product Planning"
}

Response

Message stored and queued for processing

objectIdstring required

Parse Server objectId of the stored message

sessionIdstring required

Session ID of the conversation

role'user' | 'assistant' required

Role of the message sender

createdAtstring date-time required

When the message was created

processing_statusstring

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

Example response

{
  "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"
}

Changes

Changed in 13 of the 37 revisions of this API.7241

  • f29d29d1ad1626See the full diff
    • removed ContentVariant1 from the content request property anyOf list

      request-property-any-of-removed

    • removed UserMemoryCategory AssistantMemoryCategory from the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-removed

    • added the new optional request property external_user_id

      new-optional-request-property

    • added the new optional request property user_id

      new-optional-request-property

    • added subschema #1 to the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-added

    • added subschema #2 to the content request property anyOf list

      request-property-any-of-added

    • added subschema #2 to the content response property anyOf list for the response status 200

      response-property-any-of-added

    • removed ContentVariant1 from the content response property anyOf list for the response status 200

      response-property-any-of-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 22d84aa060d6121See the full diff
    • removed subschema #1 from the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-removed

    • removed the request property external_user_id

      request-property-removed

    • removed the request property user_id

      request-property-removed

    • added UserMemoryCategory AssistantMemoryCategory to the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-added

    This revision also has 8 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 02daa1da4e8211See the full diff
    • removed UserMemoryCategory AssistantMemoryCategory from the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-removed

    • added subschema #1 to the metadata/anyOf[subschema #1: MemoryMetadata]/category request property anyOf list

      request-property-any-of-added

  • 871a12102bbe13See the full diff
    • removed subschema #2 from the content request property anyOf list

      request-property-any-of-removed

    • added ContentVariant1 to the content request property anyOf list

      request-property-any-of-added

    • added ContentVariant1 to the content response property anyOf list for the response status 200

      response-property-any-of-added

    • removed subschema #2 from the content response property anyOf list for the response status 200

      response-property-any-of-removed

  • b8ef009d360615See the full diff
    • added the new required request property content/anyOf[subschema #2]/items/type

      new-required-request-property

    • added the new optional request property content/anyOf[subschema #2]/items/text

      new-optional-request-property

    • added the new optional request property external_user_id

      new-optional-request-property

    • added the new optional request property user_id

      new-optional-request-property

    • added the optional property content/anyOf[subschema #2]/items/text to the response with the 200 status

      response-optional-property-added

    • added the required property content/anyOf[subschema #2]/items/type to the response with the 200 status

      response-required-property-added

    • added the new optional request property policy

      new-optional-request-property

    • request property memory_policy deprecated

      request-property-deprecated

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property memory_policy/anyOf[subschema #1: MemoryPolicy]/edge_constraints/anyOf[subschema #1]/items/set/anyOf[subschema #1]/additionalProperties/anyOf[subschema #7: PropertyValue]/prompt

      new-optional-request-property

    • added the new optional request property memory_policy/anyOf[subschema #1: MemoryPolicy]/node_constraints/anyOf[subschema #1]/items/set/anyOf[subschema #1]/additionalProperties/anyOf[subschema #7: PropertyValue]/prompt

      new-optional-request-property

    • added the optional property detail/items/ctx to the response with the 422 status

      response-optional-property-added

    • added the optional property detail/items/input to the response with the 422 status

      response-optional-property-added

    • added the new optional request property title

      new-optional-request-property

    • added the new optional request property context

      new-optional-request-property

    • added the new optional request property graph_generation

      new-optional-request-property

    • added the new optional request property memory_policy

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/acl

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/consent

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/risk

      new-optional-request-property

    • added the new optional request property relationships_json

      new-optional-request-property

    • request property metadata/anyOf[subschema #1: MemoryMetadata]/external_user_id deprecated

      request-property-deprecated

    • request property metadata/anyOf[subschema #1: MemoryMetadata]/namespace_id deprecated

      request-property-deprecated

    • request property metadata/anyOf[subschema #1: MemoryMetadata]/organization_id deprecated

      request-property-deprecated

    • request property metadata/anyOf[subschema #1: MemoryMetadata]/user_id deprecated

      request-property-deprecated

    • request property metadata/anyOf[subschema #1: MemoryMetadata]/hierarchical_structures list-of-types was widened by adding types array to media type application/json

      request-property-list-of-types-widened

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/namespace_read_access

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/namespace_write_access

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/organization_read_access

      new-optional-request-property

    • added the new optional request property metadata/anyOf[subschema #1: MemoryMetadata]/organization_write_access

      new-optional-request-property