Cortask

REST API

Base URL: /api

All endpoints accept and return JSON unless otherwise noted.


Sessions

MethodPathDescription
GET/sessionsList sessions for a workspace. Requires ?workspaceId query param.
GET/sessions/:idGet a single session by ID. Requires ?workspaceId query param.
DELETE/sessions/:idDelete a session. Requires ?workspaceId query param.

Workspaces

MethodPathDescription
GET/workspacesList all workspaces.
GET/workspaces/:idGet a workspace by ID.
POST/workspacesCreate a workspace. Body: { name, rootPath? }
PUT/workspaces/:idUpdate a workspace.
DELETE/workspaces/:idDelete a workspace.
PUT/workspaces/reorderReorder workspaces. Body: { ids: string[] }
POST/workspaces/:id/openOpen/activate a workspace.
GET/workspaces/:id/treeGet recursive directory tree. Optional ?depth (1-5, default 3).
GET/workspaces/:id/list-filesList recent files in the workspace root (max 10, sorted by mtime).
GET/workspaces/:id/memoryRead the workspace memory file (.cortask/memory.md).
PUT/workspaces/:id/memoryWrite the workspace memory file. Body: { content: string }
GET/workspaces/:id/memory/searchSemantic search over structured memory. Requires ?q. Optional ?limit (1-50, default 5).
GET/workspaces/:id/memory/entriesList recent memory entries. Optional ?limit (1-100, default 20).
PUT/workspaces/:id/files/renameRename a file. Body: { oldPath, newPath }
DELETE/workspaces/:id/files/:pathDelete a file or directory.
PUT/workspaces/:id/files/:pathWrite file content. Body: { content: string }
GET/workspaces/:id/files/:pathDownload a file.

Credentials

MethodPathDescription
GET/credentialsList all credential keys (values are not returned).
POST/credentialsStore a credential. Body: { key, value }
GET/credentials/:keyCheck if a credential exists.
DELETE/credentials/:keyDelete a credential.

Providers

MethodPathDescription
GET/providersList available LLM providers with their configuration.
PUT/providers/defaultSet the default provider. Body: { provider: string }

Models

MethodPathDescription
GET/models/:providerId/availableList available models for a provider.
GET/models/enabledList all enabled models with pricing info.
POST/models/enableEnable a model. Body: { provider, modelId, inputPricePer1m?, outputPricePer1m? }
DELETE/models/enabled/:idDisable an enabled model.

Skills

MethodPathDescription
GET/skillsList all skills (bundled and custom).
POST/skillsCreate a custom skill. Body: { name, content }
GET/skills/:nameGet a skill by name.
PUT/skills/:nameUpdate a custom skill. Body: { content }
DELETE/skills/:nameRemove a custom skill.
POST/skills/:name/installInstall a skill from a URL.
GET/skills/:name/file/:filePathRead a file from a skill directory.
POST/skills/:name/credentialsSave credentials for a skill.
POST/skills/:name/oauth/startStart OAuth flow for a skill.
GET/skills/oauth/callbackOAuth callback handler.
POST/skills/:name/oauth/revokeRevoke OAuth token for a skill.

Cron

MethodPathDescription
GET/cronList all cron jobs.
GET/cron/:idGet a cron job by ID.
POST/cronCreate a cron job.
PUT/cron/:idUpdate a cron job.
DELETE/cron/:idDelete a cron job.
POST/cron/:id/triggerTrigger a cron job immediately.
POST/cron/:id/enableEnable a cron job.
POST/cron/:id/disableDisable a cron job.

Templates

MethodPathDescription
GET/templatesList all prompt templates.
POST/templatesCreate a template.
PUT/templates/:idUpdate a template.
DELETE/templates/:idDelete a template.

Artifacts

MethodPathDescription
GET/artifactsList all artifacts.
GET/artifacts/:idGet artifact metadata.
GET/artifacts/:id?rawGet raw artifact content.

Usage

MethodPathDescription
GET/usageGet usage summary for the current spending period.
GET/usage/historyGet daily usage history. Optional ?days (default 30).

Channels

MethodPathDescription
GET/channelsList channel statuses.
POST/channels/:id/startStart a channel adapter.
POST/channels/:id/stopStop a channel adapter.
POST/channels/:id/credentialsSave channel credentials.
GET/channels/:id/qrGet QR code (for WhatsApp).
POST/channels/:id/trusted-contactsUpdate trusted contacts list.

Config

MethodPathDescription
GET/configGet the current configuration.
PUT/configUpdate configuration. Body: partial config object.

Onboarding

MethodPathDescription
GET/onboarding/statusCheck onboarding status.
POST/onboarding/completeMark onboarding as complete.

LLM

MethodPathDescription
POST/llm/completeDirect LLM completion (used for utility tasks like title generation).

Health

MethodPathDescription
GET/healthHealth check. Returns { status, version, ready }.
GET/updates/checkCheck for updates against npm registry.