productivity
Teamwork Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Teamwork KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.teamwork.*.
Use lua_read_doc("integrations.teamwork") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Teamwork workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.teamwork.create_task({projectId = 1, name = "example_name", description = "example_description", assigneeId = 1, dueDate = "example_dueDate", priority = "example_priority", startDate = "example_startDate"}))' --json kosmo integrations:lua --eval 'print(docs.read("teamwork"))' --json
kosmo integrations:lua --eval 'print(docs.read("teamwork.create_task"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local teamwork = app.integrations.teamwork
local result = teamwork.create_task({projectId = 1, name = "example_name", description = "example_description", assigneeId = 1, dueDate = "example_dueDate", priority = "example_priority", startDate = "example_startDate"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.teamwork, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.teamwork.default.* or app.integrations.teamwork.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Teamwork, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Client for the Teamwork REST API — Lua API Reference
teamwork_list_projects
List projects in Teamwork with optional filters..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | string | no | Filter by project status (e.g. “active”, “late”, “completed”). |
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of projects per page (max 500). |
Example
local result = app.integrations.teamwork.teamwork_list_projects({
status = ""
page = 0
pageSize = 0
})
teamwork_get_project
Get detailed information about a Teamwork project..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The project ID. |
Example
local result = app.integrations.teamwork.teamwork_get_project({
id = 0
})
teamwork_list_tasks
List tasks in Teamwork with optional filters..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | no | Project ID to filter tasks by. |
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of tasks per page (max 500). |
filter | string | no | Filter tasks (e.g. “all”, “overdue”, “today”). |
sort | string | no | Sort order (e.g. “duedate”, “priority”). |
Example
local result = app.integrations.teamwork.teamwork_list_tasks({
projectId = 0
page = 0
pageSize = 0
})
teamwork_get_task
Get detailed information about a Teamwork task..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The task ID. |
Example
local result = app.integrations.teamwork.teamwork_get_task({
id = 0
})
teamwork_create_task
Create a new task in Teamwork..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | yes | The project ID to create the task in. |
name | string | yes | Name of the task. |
description | string | no | Detailed description of the task. |
assigneeId | integer | no | User ID to assign the task to. |
dueDate | string | no | Due date in YYYYMMDD format. |
priority | string | no | Task priority (e.g. “low”, “medium”, “high”). |
startDate | string | no | Start date in YYYYMMDD format. |
Example
local result = app.integrations.teamwork.teamwork_create_task({
projectId = 0
name = ""
description = ""
})
teamwork_list_timers
List time timers for the authenticated user in Teamwork..
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of timers per page. |
Example
local result = app.integrations.teamwork.teamwork_list_timers({
page = 0
pageSize = 0
})
teamwork_get_current_user
Get the currently authenticated Teamwork user..
Example
local result = app.integrations.teamwork.teamwork_get_current_user({
})
Multi-Account Usage
If you have multiple teamwork accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.teamwork.function_name({...})
-- Explicit default (portable across setups)
app.integrations.teamwork.default.function_name({...})
-- Named accounts
app.integrations.teamwork.work.function_name({...})
app.integrations.teamwork.personal.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Client for the Teamwork REST API — Lua API Reference
## teamwork_list_projects
List projects in Teamwork with optional filters..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | string | no | Filter by project status (e.g. "active", "late", "completed"). |
| `page` | integer | no | Page number for pagination. |
| `pageSize` | integer | no | Number of projects per page (max 500). |
### Example
```lua
local result = app.integrations.teamwork.teamwork_list_projects({
status = ""
page = 0
pageSize = 0
})
```
## teamwork_get_project
Get detailed information about a Teamwork project..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The project ID. |
### Example
```lua
local result = app.integrations.teamwork.teamwork_get_project({
id = 0
})
```
## teamwork_list_tasks
List tasks in Teamwork with optional filters..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | integer | no | Project ID to filter tasks by. |
| `page` | integer | no | Page number for pagination. |
| `pageSize` | integer | no | Number of tasks per page (max 500). |
| `filter` | string | no | Filter tasks (e.g. "all", "overdue", "today"). |
| `sort` | string | no | Sort order (e.g. "duedate", "priority"). |
### Example
```lua
local result = app.integrations.teamwork.teamwork_list_tasks({
projectId = 0
page = 0
pageSize = 0
})
```
## teamwork_get_task
Get detailed information about a Teamwork task..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The task ID. |
### Example
```lua
local result = app.integrations.teamwork.teamwork_get_task({
id = 0
})
```
## teamwork_create_task
Create a new task in Teamwork..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | integer | yes | The project ID to create the task in. |
| `name` | string | yes | Name of the task. |
| `description` | string | no | Detailed description of the task. |
| `assigneeId` | integer | no | User ID to assign the task to. |
| `dueDate` | string | no | Due date in YYYYMMDD format. |
| `priority` | string | no | Task priority (e.g. "low", "medium", "high"). |
| `startDate` | string | no | Start date in YYYYMMDD format. |
### Example
```lua
local result = app.integrations.teamwork.teamwork_create_task({
projectId = 0
name = ""
description = ""
})
```
## teamwork_list_timers
List time timers for the authenticated user in Teamwork..
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination. |
| `pageSize` | integer | no | Number of timers per page. |
### Example
```lua
local result = app.integrations.teamwork.teamwork_list_timers({
page = 0
pageSize = 0
})
```
## teamwork_get_current_user
Get the currently authenticated Teamwork user..
### Example
```lua
local result = app.integrations.teamwork.teamwork_get_current_user({
})
```
---
## Multi-Account Usage
If you have multiple teamwork accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.teamwork.function_name({...})
-- Explicit default (portable across setups)
app.integrations.teamwork.default.function_name({...})
-- Named accounts
app.integrations.teamwork.work.function_name({...})
app.integrations.teamwork.personal.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.teamwork.create_task({projectId = 1, name = "example_name", description = "example_description", assigneeId = 1, dueDate = "example_dueDate", priority = "example_priority", startDate = "example_startDate"})
print(result) Functions
create_task Write
Create a new task in Teamwork.
- Lua path
app.integrations.teamwork.create_task- Full name
teamwork.teamwork_create_task
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | integer | yes | The project ID to create the task in. |
name | string | yes | Name of the task. |
description | string | no | Detailed description of the task. |
assigneeId | integer | no | User ID to assign the task to. |
dueDate | string | no | Due date in YYYYMMDD format. |
priority | string | no | Task priority (e.g. "low", "medium", "high"). |
startDate | string | no | Start date in YYYYMMDD format. |
get_current_user Read
Get the currently authenticated Teamwork user.
- Lua path
app.integrations.teamwork.get_current_user- Full name
teamwork.teamwork_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_project Read
Get detailed information about a Teamwork project.
- Lua path
app.integrations.teamwork.get_project- Full name
teamwork.teamwork_get_project
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The project ID. |
get_task Read
Get detailed information about a Teamwork task.
- Lua path
app.integrations.teamwork.get_task- Full name
teamwork.teamwork_get_task
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The task ID. |
list_projects Read
List projects in Teamwork with optional filters.
- Lua path
app.integrations.teamwork.list_projects- Full name
teamwork.teamwork_list_projects
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | no | Filter by project status (e.g. "active", "late", "completed"). |
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of projects per page (max 500). |
list_tasks Read
List tasks in Teamwork with optional filters.
- Lua path
app.integrations.teamwork.list_tasks- Full name
teamwork.teamwork_list_tasks
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | integer | no | Project ID to filter tasks by. |
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of tasks per page (max 500). |
filter | string | no | Filter tasks (e.g. "all", "overdue", "today"). |
sort | string | no | Sort order (e.g. "duedate", "priority"). |
list_timers Read
List time timers for the authenticated user in Teamwork.
- Lua path
app.integrations.teamwork.list_timers- Full name
teamwork.teamwork_list_timers
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination. |
pageSize | integer | no | Number of timers per page. |