Leo for agents

The Agent API

Versioned HTTP and JSON at https://www.leo.co.ke/api/agent/v1.

Basics

Base

https://www.leo.co.ke/api/agent/v1

Example

curl -H "Authorization: Bearer $LEO_TOKEN" https://www.leo.co.ke/api/agent/v1/me
  • OpenAPI 3.1: https://www.leo.co.ke/api/agent/v1/openapi.json. The index at https://www.leo.co.ke/api/agent/v1 lists every operation without a credential.
  • Success: { "data": …, "meta": { "requestId", "operation", "apiVersion", "replayed", "idempotencyKey" } }. Creates answer 201.
  • Failure: { "error": { "code", "message", "hint", "details", "requestId", "docs" } } with a stable code (see Errors).
  • Every response carries X-Request-Id. Quote it to support.

Safe retries

Send an Idempotency-Key header (or idempotency_key in the body) on every write you might retry. The same key with the same body returns the first result and the header Idempotent-Replayed: true. The same key with a different body is IDEMPOTENCY_CONFLICT and writes nothing. An identical create sent without a key within ten minutes is also treated as a retry.

Pagination

Lists return next, a timestamp cursor, when there may be more. Pass it back as before to get the next page.

Limits

WindowLimit
All requests300 a minute
Reads240 a minute
Writes60 a minute
Context packages30 a minute
Run reports120 a minute
Per day20,000

Limits are per credential and the same on every plan. A refused request answers 429 with Retry-After.

Endpoints

Method and pathWhat it doesScopes
GET /api/agent/v1/meWho am I in Leoany credential
GET /api/agent/v1/workspacesList the workspaces this connection may useany credential
GET /api/agent/v1/workspaceWorkspace overviewworkspace.read
GET /api/agent/v1/contextGet the context packagecontext.read
GET /api/agent/v1/searchSearch Leocontext.read
GET /api/agent/v1/fetchFetch a Leo recordcontext.read
GET /api/agent/v1/projectsList projectswork.read
GET /api/agent/v1/projects/:project_idGet a projectwork.read
POST /api/agent/v1/projectsCreate a projectwork.write
PATCH /api/agent/v1/projects/:project_idUpdate a projectwork.write
POST /api/agent/v1/projects/:project_id/decisionsRecord a project decisioncontext.write
POST /api/agent/v1/context/entriesRecord contextcontext.write
POST /api/agent/v1/projects/:project_id/referencesAdd a project referencecontext.write
GET /api/agent/v1/tasksList taskswork.read
GET /api/agent/v1/tasks/:task_idGet a taskwork.read
POST /api/agent/v1/tasksCreate a taskwork.write
PATCH /api/agent/v1/tasks/:task_idUpdate a taskwork.write
POST /api/agent/v1/tasks/:task_id/completeComplete a taskwork.write
POST /api/agent/v1/tasks/:task_id/approvalsAsk a person to approve a taskwork.write
POST /api/agent/v1/tasks/:task_id/runsStart work on a taskwork.execute
POST /api/agent/v1/runs/:run_id/eventsReport progress on a runwork.execute
POST /api/agent/v1/runs/:run_id/finishFinish a runwork.execute
POST /api/agent/v1/tasks/:task_id/handoffsHand work onwork.execute
GET /api/agent/v1/runs/:run_idGet a runwork.read
GET /api/agent/v1/tasks/:task_id/runsList runs on a taskwork.read
GET /api/agent/v1/artifactsList artifactslibrary.read
GET /api/agent/v1/artifacts/:artifact_idGet an artifactlibrary.read
POST /api/agent/v1/artifacts/uploadsGet an address to upload a file tolibrary.write
POST /api/agent/v1/artifactsPublish an artifactlibrary.write
GET /api/agent/v1/companiesFind companiescrm.read
GET /api/agent/v1/companies/:company_idGet a companycrm.read
POST /api/agent/v1/companiesCreate a companycrm.write
PATCH /api/agent/v1/companies/:company_idUpdate a companycrm.write
GET /api/agent/v1/contactsFind contactscrm.read
GET /api/agent/v1/contacts/:contact_idGet a contactcrm.read
POST /api/agent/v1/contactsCreate a contactcrm.write
PATCH /api/agent/v1/contacts/:contact_idUpdate a contactcrm.write
GET /api/agent/v1/dealsList dealscrm.read
GET /api/agent/v1/deals/:deal_idGet a dealcrm.read
POST /api/agent/v1/dealsCreate a dealcrm.write
PATCH /api/agent/v1/deals/:deal_idUpdate a dealcrm.write
POST /api/agent/v1/interactionsRecord an interaction or researchcrm.write
GET /api/agent/v1/studio/projectsList Studio projectsstudio.read
GET /api/agent/v1/studio/assetsList Studio rendersstudio.read
GET /api/agent/v1/studio/modelsList Studio modelsstudio.read
GET /api/agent/v1/studio/brandRead the brand guidelinesstudio.read
POST /api/agent/v1/studio/generations/quotePrice an image or videostudio.read
POST /api/agent/v1/studio/generationsMake an image or videostudio.generate
GET /api/agent/v1/studio/generations/:asset_idCheck one renderstudio.read
GET /api/agent/v1/studio/voicesList Leo Audio voicesstudio.read
POST /api/agent/v1/studio/audio/quotePrice a voice, music or sound effectstudio.read
POST /api/agent/v1/studio/audioMake a voice, music or sound effectstudio.generate
GET /api/agent/v1/meetingsList meetingsmeetings.read
GET /api/agent/v1/meetings/:meeting_idRead a meetingmeetings.read
GET /api/agent/v1/devicesList the person's computersworkspace.read
GET /api/agent/v1/historyRead what happened on a project or taskwork.read
Leo Agent API | Leo