Last updated

Request Templates

Canonical request shapes for reliable integrations.

Prerequisites

  • Papr API key configured in your client runtime
  • Endpoint-level access for memory, messages, and document APIs
  • Tenant identifiers (organization_id, namespace_id) for multi-tenant workloads

Minimal Setup

  1. Start from one template on this page.
  2. Replace placeholders with your app IDs and metadata.
  3. Validate payloads against API reference schemas before production rollout.

Add Memory (Current)

{
  "content": "memory text",
  "type": "text",
  "external_user_id": "user_123",
  "organization_id": "org_demo",
  "namespace_id": "ns_prod",
  "metadata": {
    "role": "assistant",
    "category": "learning",
    "topics": ["topic_a", "topic_b"]
  },
  "memory_policy": {
    "mode": "auto",
    "consent": "implicit",
    "risk": "none",
    "acl": {
      "read": ["external_user:user_123"],
      "write": ["external_user:user_123"]
    }
  }
}

Add Memory in Manual Graph Mode

{
  "content": "structured ingest event",
  "external_user_id": "ops_admin",
  "memory_policy": {
    "mode": "manual",
    "nodes": [
      {
        "id": "acct_1",
        "type": "Account",
        "properties": {"name": "Acme Corp"}
      },
      {
        "id": "opp_1",
        "type": "Opportunity",
        "properties": {"stage": "proposal"}
      }
    ],
    "relationships": [
      {
        "source": "acct_1",
        "target": "opp_1",
        "type": "HAS_OPPORTUNITY"
      }
    ]
  }
}
{
  "query": "What does this user prefer for notifications?",
  "external_user_id": "user_123",
  "organization_id": "org_demo",
  "enable_agentic_graph": true
}

Query params:

  • max_memories=20
  • max_nodes=15
  • response_format=toon for LLM-bound output

Store Message

{
  "sessionId": "session_123",
  "role": "user",
  "content": "I want weekly summaries by email.",
  "external_user_id": "user_123",
  "process_messages": true
}

Document Upload (Form Fields)

Use multipart form:

  • file
  • external_user_id
  • optional: organization_id, namespace_id, memory_policy

Notes

  • Prefer external_user_id over internal user_id.
  • Prefer memory_policy over deprecated graph fields.
  • Keep tenant scope fields explicit in multi-tenant apps.

Validation Checklist

  • Required fields are present for each endpoint
  • Deprecated fields are not present in request payloads
  • Tenant and user scope fields are explicit where needed

Troubleshooting

If a template fails validation, use Error Playbook and Deprecations and Migrations.