ClickCease

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

FieldRequirementBehavior
nameRequiredDisplay name.
baseRequiredBuilt-in base model such as leniq-pro.
toneRequiredprofessional, friendly, authoritative, consultative, or funny.
emojiOptionalDisplay icon.
organisationMemoryOptionalnoteTitle 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

Analyst creation happens before the optional Organization Context write. If that follow-up write fails, the endpoint can return HTTP 502 even though the analyst itself was created. Re-list owned analysts before retrying so a network or memory-sync failure does not create a duplicate.

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"