KosmoKrator

productivity

TickTick Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the TickTick KosmoKrator integration.

9 functions 3 read 6 write OAuth browser flow auth

Lua Namespace

Agents call this integration through app.integrations.ticktick.*. Use lua_read_doc("integrations.ticktick") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

TickTick — Lua API Reference

list_projects

List all projects (task lists). No parameters. Call this first to discover project IDs.

local projects = app.integrations.ticktick.list_projects({})

for _, p in ipairs(projects) do
  print(p.name .. " (id: " .. p.id .. ")")
end

get_tasks

Get all tasks in a project.

NameTypeRequiredDescription
project_idstringyesProject ID (from list_projects)
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })

create_task

Create a new task.

NameTypeRequiredDescription
titlestringyesTask title
project_idstringnoProject ID. Omit to add to Inbox
contentstringnoDescription/notes
start_datestringnoISO 8601 (e.g. "2026-03-30T09:00:00+0000")
due_datestringnoISO 8601 (e.g. "2026-03-30T17:00:00+0000")
priorityintegerno0 = none, 1 = low, 3 = medium, 5 = high
is_all_daybooleannotrue for all-day, false for specific times
itemsstringnoJSON array of subtasks (see below)

Subtask format

[{"title": "Subtask 1", "status": 0}, {"title": "Subtask 2", "status": 0}]

Status: 0 = unchecked, 2 = checked.

complete_task

Mark a task as complete.

NameTypeRequiredDescription
project_idstringyesProject ID the task belongs to
task_idstringyesTask ID to complete

update_task

Update an existing task (same fields as create, plus task_id and project_id).

delete_task

Delete a task (requires project_id and task_id).

Examples

List projects, then create a task

-- Step 1: find the project
local projects = app.integrations.ticktick.list_projects({})
local project_id = nil
for _, p in ipairs(projects) do
  if p.name == "Work" then
    project_id = p.id
    break
  end
end

-- Step 2: create a high-priority task with a due date
app.integrations.ticktick.create_task({
  title = "Finish quarterly report",
  project_id = project_id,
  content = "Include revenue and churn metrics",
  due_date = "2026-04-01T17:00:00+0000",
  priority = 5,
  is_all_day = false
})

Create a task with subtasks

app.integrations.ticktick.create_task({
  title = "Launch checklist",
  project_id = project_id,
  priority = 3,
  items = '[{"title": "Update changelog", "status": 0}, {"title": "Tag release", "status": 0}, {"title": "Notify team", "status": 0}]'
})

Complete a task

-- Step 1: get tasks in the project
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })

-- Step 2: complete the first one
app.integrations.ticktick.complete_task({
  project_id = "abc123",
  task_id = tasks[1].id
})

Create a quick Inbox task

app.integrations.ticktick.create_task({
  title = "Buy groceries",
  priority = 1
})

Multi-Account Usage

If you have multiple ticktick accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.ticktick.function_name({...})

-- Explicit default (portable across setups)
app.integrations.ticktick.default.function_name({...})

-- Named accounts
app.integrations.ticktick.work.function_name({...})
app.integrations.ticktick.personal.function_name({...})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# TickTick — Lua API Reference

## list_projects

List all projects (task lists). No parameters. Call this first to discover project IDs.

```lua
local projects = app.integrations.ticktick.list_projects({})

for _, p in ipairs(projects) do
  print(p.name .. " (id: " .. p.id .. ")")
end
```

## get_tasks

Get all tasks in a project.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | Project ID (from `list_projects`) |

```lua
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })
```

## create_task

Create a new task.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Task title |
| `project_id` | string | no | Project ID. Omit to add to Inbox |
| `content` | string | no | Description/notes |
| `start_date` | string | no | ISO 8601 (e.g. `"2026-03-30T09:00:00+0000"`) |
| `due_date` | string | no | ISO 8601 (e.g. `"2026-03-30T17:00:00+0000"`) |
| `priority` | integer | no | `0` = none, `1` = low, `3` = medium, `5` = high |
| `is_all_day` | boolean | no | `true` for all-day, `false` for specific times |
| `items` | string | no | JSON array of subtasks (see below) |

### Subtask format

```
[{"title": "Subtask 1", "status": 0}, {"title": "Subtask 2", "status": 0}]
```

Status: `0` = unchecked, `2` = checked.

## complete_task

Mark a task as complete.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | Project ID the task belongs to |
| `task_id` | string | yes | Task ID to complete |

## update_task

Update an existing task (same fields as create, plus `task_id` and `project_id`).

## delete_task

Delete a task (requires `project_id` and `task_id`).

## Examples

### List projects, then create a task

```lua
-- Step 1: find the project
local projects = app.integrations.ticktick.list_projects({})
local project_id = nil
for _, p in ipairs(projects) do
  if p.name == "Work" then
    project_id = p.id
    break
  end
end

-- Step 2: create a high-priority task with a due date
app.integrations.ticktick.create_task({
  title = "Finish quarterly report",
  project_id = project_id,
  content = "Include revenue and churn metrics",
  due_date = "2026-04-01T17:00:00+0000",
  priority = 5,
  is_all_day = false
})
```

### Create a task with subtasks

```lua
app.integrations.ticktick.create_task({
  title = "Launch checklist",
  project_id = project_id,
  priority = 3,
  items = '[{"title": "Update changelog", "status": 0}, {"title": "Tag release", "status": 0}, {"title": "Notify team", "status": 0}]'
})
```

### Complete a task

```lua
-- Step 1: get tasks in the project
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })

-- Step 2: complete the first one
app.integrations.ticktick.complete_task({
  project_id = "abc123",
  task_id = tasks[1].id
})
```

### Create a quick Inbox task

```lua
app.integrations.ticktick.create_task({
  title = "Buy groceries",
  priority = 1
})
```

---

## Multi-Account Usage

If you have multiple ticktick accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.ticktick.function_name({...})

-- Explicit default (portable across setups)
app.integrations.ticktick.default.function_name({...})

-- Named accounts
app.integrations.ticktick.work.function_name({...})
app.integrations.ticktick.personal.function_name({...})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.ticktick.ticktick_list_projects({})
print(result)

Functions

ticktick_list_projects

List all TickTick projects (task lists). Returns project names, IDs, and metadata. Use this first to discover available projects before working with tasks.

Operation
Read read
Full name
ticktick.ticktick_list_projects
ParameterTypeRequiredDescription
No parameters.

ticktick_get_project

Get a TickTick project with all its tasks, sections, and columns. Use this to see everything in a project at once.

Operation
Read read
Full name
ticktick.ticktick_get_project
ParameterTypeRequiredDescription
project_id string yes The project ID. Use ticktick_list_projects to find project IDs.

ticktick_create_project

Create a new TickTick project (task list).

Operation
Write write
Full name
ticktick.ticktick_create_project
ParameterTypeRequiredDescription
name string yes Name of the project.
color string no Color of the project (e.g., "#ff8c00").
view_mode string no View mode: "list", "kanban", or "timeline".

ticktick_delete_project

Delete a TickTick project and all its tasks. This action cannot be undone.

Operation
Write write
Full name
ticktick.ticktick_delete_project
ParameterTypeRequiredDescription
project_id string yes The project ID to delete. Use ticktick_list_projects to find project IDs.

ticktick_get_tasks

Get all tasks in a TickTick project. Returns task titles, IDs, priorities, due dates, and subtasks.

Operation
Read read
Full name
ticktick.ticktick_get_tasks
ParameterTypeRequiredDescription
project_id string yes The project ID to get tasks from. Use ticktick_list_projects to find project IDs.

ticktick_create_task

Create a new task in TickTick. If no project_id is given, the task goes to the Inbox. Supports subtasks via the items array.

Operation
Write write
Full name
ticktick.ticktick_create_task
ParameterTypeRequiredDescription
title string yes Task title.
project_id string no Project ID to create the task in. Omit to add to Inbox.
content string no Task description/notes.
start_date string no Start date in ISO 8601 format (e.g., "2026-02-15T09:00:00+0000").
due_date string no Due date in ISO 8601 format (e.g., "2026-02-15T17:00:00+0000").
priority integer no Priority: 0 = none, 1 = low, 3 = medium, 5 = high.
is_all_day boolean no Whether this is an all-day task (true) or has specific times (false).
items string no JSON array of subtasks, e.g., [{"title": "Subtask 1", "status": 0}]. Status: 0 = unchecked, 2 = checked.

ticktick_update_task

Update an existing TickTick task. Requires both the task ID and its project ID. Only provided fields will be changed.

Operation
Write write
Full name
ticktick.ticktick_update_task
ParameterTypeRequiredDescription
task_id string yes The task ID to update.
project_id string yes The project ID the task belongs to.
title string no New title for the task.
content string no New description/notes for the task.
start_date string no New start date in ISO 8601 format.
due_date string no New due date in ISO 8601 format.
priority integer no New priority: 0 = none, 1 = low, 3 = medium, 5 = high.

ticktick_complete_task

Mark a TickTick task as complete.

Operation
Write write
Full name
ticktick.ticktick_complete_task
ParameterTypeRequiredDescription
project_id string yes The project ID the task belongs to.
task_id string yes The task ID to complete.

ticktick_delete_task

Delete a TickTick task. This action cannot be undone.

Operation
Write write
Full name
ticktick.ticktick_delete_task
ParameterTypeRequiredDescription
project_id string yes The project ID the task belongs to.
task_id string yes The task ID to delete.