ClickCease

Leni developers

Context

Search notes, list folders, access files, and write saved knowledge in the API-key owner’s authorized Personal or Organization Context.

Why the API still says memory

The Leni product calls this feature Context. Existing paths, fields, MCP tools, and OAuth scopes retain memory, user_memory, and organisation_memory for backward compatibility. Send those identifiers exactly as documented: they map to Personal Context and Organization Context.

POST/users/get-user-memory

Legacy compatibility route for the existing Personal Context response shape. JSON body is optional. modelType and modelId select an authorized scope; an empty {} uses defaults. New integrations should use the normalized search route below.

{ "modelType": "leniq-pro", "modelId": null }

POST/users/memory/search

FieldRequirementBehavior
scopeRequireduser for Personal Context, or organization for eligible Organization Context.
modelType / modelIdOptionalDefaults to leniq-pro; modelId selects an authorized custom analyst.
page / pageSizeOptionalDefaults to 1 / 20. pageSize is capped at 100.
searchOptionalCase-insensitive title/content search, up to 500 characters.

The response includes normalized notes and safe attachment metadata such as file name, MIME type, and size. It never returns storage keys or download URLs.

{
  "scope": "organization",
  "modelType": "leniq-pro",
  "search": "loan",
  "page": 1,
  "pageSize": 20
}
{
  "memories": [{
    "id": "<memory-id>",
    "title": "Loan terms",
    "content": "...",
    "scope": "organization",
    "modelType": "leniq-pro",
    "canEdit": true,
    "attachments": [{
      "filename": "loan-agreement.pdf",
      "contentType": "application/pdf",
      "sizeBytes": 48120
    }],
    "createdAt": "<ISO-8601 timestamp>",
    "folderId": "<folder-id>",
    "folderName": "Financing"
  }],
  "total": 1,
  "page": 1,
  "pageSize": 20
}

Organization Context eligibility

Organization Context is plan controlled. Ineligible accounts receive HTTP 403 with PAID_FEATURE_REQUIRED. A 404 from a note or file route intentionally does not distinguish a missing resource from one outside the caller’s authorized partition.

POST/users/memory/folders

Send scope plus optional modelType and modelId. Each returned folder contains only note IDs visible in that exact user or organization/model partition.

{ "scope": "user", "modelType": "leniq-pro" }

POST/users/memory/:memoryId/files

Resolves one bounded page of files on an exact authorized note after rechecking the API-key owner, organization, and model partition. The response contains five-minute HTTPS bearer links. It never accepts a raw attachment ID and never exposes an S3 bucket or object key.

FieldRequirementBehavior
pageOptionalOne-based page number; defaults to 1.
pageSizeOptionalDefaults to 20 and is capped at 25.
{
  "scope": "organization",
  "modelType": "leniq-pro",
  "page": 1,
  "pageSize": 20
}

The response includes total, hasMore, and partial. FollowhasMore page by page. Retry the same page when partial is true.

Use links immediately

Anyone holding a link can read that file until it expires. Do not log, persist, or forward it. Request a new link after five minutes.

POST/users/add-to-memory

FieldRequirementBehavior
memoryTypeRequiredNon-empty Context store, normally user_memory or organisation_memory.
noteTitle / noteContextOptionalReadable title and note content.
modelType / modelIdOptionalAuthorized model scope. modelType is required whenever modelId is sent.
folderId / folderNameOptionalFolder placement metadata.
files / filesBase64OptionalShared base64 file contract; multipart parts named files are supported.
{
  "memoryType": "user_memory",
  "modelType": "leniq-pro",
  "noteTitle": "Building hours",
  "noteContext": "Lobby desk staffed 9–5 weekdays."
}

POST/users/update-memory

FieldRequirementBehavior
memoryRequiredExisting Context object, including its owned identifier and changed fields.
memoryTypeRequiredNon-empty store matching the record.
modelTypeRequired with modelIdAuthorized model type for scoped Organization Context.
modelIdOptionalAuthorized custom model scope.
files / filesBase64OptionalNew attachments using the shared file contract.
{
  "memoryType": "user_memory",
  "memory": {
    "id": "<memory-id>",
    "noteTitle": "Updated title",
    "noteContext": "Updated body"
  },
  "modelType": "leniq-pro"
}

Updates are scoped writes

Read the note in the intended user or organization/model partition before updating it. Do not move an identifier between scopes or infer edit permission from a previously cached list.