Leni HTTP API
Memory
List, create, and update memory in the API-key owner’s authorized user or organization context.
POST/users/get-user-memory
JSON body is optional. modelType and modelId select an authorized scope; an empty {} uses defaults.
{ "modelType": "leniq-pro", "modelId": null }POST/users/add-to-memory
| Field | Requirement | Behavior |
|---|---|---|
| memoryType | Required | Non-empty memory store, normally user_memory or organisation_memory. |
| noteTitle / noteContext | Optional | Readable title and note content. |
| modelType / modelId | Optional | Authorized model scope. |
| folderId / folderName | Optional | Folder placement metadata. |
| files / filesBase64 | Optional | Shared 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
| Field | Requirement | Behavior |
|---|---|---|
| memory | Required | Existing memory object, including its owned identifier and changed fields. |
| memoryType | Required | Non-empty store matching the record. |
| modelType | Required with modelId | Authorized model type for scoped organization memory. |
| modelId | Optional | Authorized custom model scope. |
| files / filesBase64 | Optional | New attachments using the shared file contract. |
{
"memoryType": "user_memory",
"memory": {
"id": "<memory-id>",
"noteTitle": "Updated title",
"noteContext": "Updated body"
},
"modelType": "leniq-pro"
}