Leni developers
Custom analysts
Create, list, update, and delete custom analysts owned by the project-key user.
GET/users/custom-analysts
No body. Returns the owner’s custom model payload, including identifiers used for later updates or analysis.
POST/users/custom-analysts
| Field | Requirement | Behavior |
|---|---|---|
| name | Required | Display name. |
| base | Required | Built-in base model such as leniq-pro. |
| tone | Required | professional, friendly, authoritative, consultative, or funny. |
| emoji | Optional | Display icon. |
| organisationMemory | Optional | noteTitle and noteContext plus optional base64 files; multipart uses organisationMemoryFiles. |
{
"name": "Lease reviewer",
"base": "leniq-pro",
"tone": "professional",
"emoji": "📄"
}Returns HTTP 201 with the created analyst.
Organization Context sync can partially succeed
PUT/users/custom-analysts/:analystId
name, base, and tone are required. Optional emoji, description, and organisationMemory update display and owned Context. Supplying organisationMemory.noteId updates that note; omitting it creates a note when title and context exist.
DELETE/users/custom-analysts/:analystId
No body. Deletes only an analyst owned by the authenticated project-key context.
Run an owned custom analyst
Pass the selected analyst to POST /users/run-models. The service maps it to the owned custom-model context; account and organization identity still come from the API key.
{
"question": "Review lease-expiration risk for the next 12 months.",
"customAnalyst": {
"id": "<analyst-id>",
"name": "Lease reviewer",
"modelType": "leniq-pro",
"tone": "professional"
},
"wait": false
}curl -sS -X DELETE "https://api.prod.ca-central-1.leni.co/users/custom-analysts/<analyst-uuid>" \
-H "X-Api-Key: $LENI_API_KEY"