KosmoKrator

productivity

Wrike Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.wrike.*. Use lua_read_doc("integrations.wrike") 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 Wrike workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.wrike.create_task({folderId = "example_folderId", title = "example_title", description = "example_description", importance = "example_importance", status = "example_status", dates = "example_dates", assignees = "example_assignees"}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("wrike"))' --json
kosmo integrations:lua --eval 'print(docs.read("wrike.create_task"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local wrike = app.integrations.wrike
local result = wrike.create_task({folderId = "example_folderId", title = "example_title", description = "example_description", importance = "example_importance", status = "example_status", dates = "example_dates", assignees = "example_assignees"})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.wrike, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.wrike.default.* or app.integrations.wrike.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Wrike, use the narrower mcp:lua command.

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 Wrike REST API — Lua API Reference

wrike_add_comment

Add a comment to a Wrike task.

Parameters

NameTypeRequiredDescription
task_idstringyesID of the task to comment on.
textstringyesComment text (supports Markdown).

Example

local result = app.integrations.wrike.wrike_add_comment({
  task_id = ""
  text = ""
})

wrike_create_folder

Create a new folder in Wrike.

Parameters

NameTypeRequiredDescription
titlestringyesTitle of the folder.
parent_idstringnoParent folder or space ID to nest the folder under.
descriptionstringnoDescription of the folder.

Example

local result = app.integrations.wrike.wrike_create_folder({
  title = ""
  description = ""
})

wrike_create_task

Create a new task in Wrike.

Parameters

NameTypeRequiredDescription
folderIdstringyesFolder ID to create the task in.
titlestringyesTitle of the task.
descriptionstringnoDetailed description of the task.
importancestringnoTask importance (High, Normal, Low).
statusstringnoTask status (Active, Completed, Deferred).
datesobjectnoDate settings object (start, due, type).
assigneesarraynoArray of user IDs to assign the task to.

Example

local result = app.integrations.wrike.wrike_create_task({
  folderId = ""
  title = ""
  description = ""
})

wrike_get_current_user

Get the currently authenticated Wrike user.

Example

local result = app.integrations.wrike.wrike_get_current_user({
})

wrike_get_folder

Get detailed information about a Wrike folder.

Parameters

NameTypeRequiredDescription
folder_idstringyesThe folder ID.

Example

local result = app.integrations.wrike.wrike_get_folder({
  folder_id = ""
})

wrike_get_project

Get detailed information about a Wrike project.

Parameters

NameTypeRequiredDescription
idstringyesThe project ID.

Example

local result = app.integrations.wrike.wrike_get_project({
  id = ""
})

wrike_get_space

Get detailed information about a Wrike space.

Parameters

NameTypeRequiredDescription
space_idstringyesThe space ID.

Example

local result = app.integrations.wrike.wrike_get_space({
  space_id = ""
})

wrike_get_task

Get detailed information about a Wrike task.

Parameters

NameTypeRequiredDescription
idstringyesThe task ID.

Example

local result = app.integrations.wrike.wrike_get_task({
  id = ""
})

wrike_list_contacts

List contacts in Wrike.

Parameters

NameTypeRequiredDescription
limitintegernoMax number of contacts to return.

Example

local result = app.integrations.wrike.wrike_list_contacts({
})

wrike_list_folders

List folders in Wrike with optional filters.

Parameters

NameTypeRequiredDescription
limitintegernoMax number of folders to return.
nextPageTokenstringnoCursor for pagination from a previous response.

Example

local result = app.integrations.wrike.wrike_list_folders({
})

wrike_list_projects

List projects in Wrike with optional filters.

Parameters

NameTypeRequiredDescription
statusstringnoFilter by project status (Active, Completed, Deferred).
limitintegernoMax number of projects to return.
nextPageTokenstringnoCursor for pagination from a previous response.

Example

local result = app.integrations.wrike.wrike_list_projects({
  status = ""
})

wrike_list_spaces

List spaces in Wrike.

Parameters

NameTypeRequiredDescription
limitintegernoMax number of spaces to return.

Example

local result = app.integrations.wrike.wrike_list_spaces({
})

wrike_list_tasks

List tasks in Wrike with optional filters.

Parameters

NameTypeRequiredDescription
folderIdstringnoFolder ID to list tasks from.
statusstringnoFilter by status (e.g. Active, Completed, Deferred).
importancestringnoFilter by importance (e.g. High, Normal, Low).
limitintegernoMax number of tasks to return.
nextPageTokenstringnoCursor for pagination from a previous response.

Example

local result = app.integrations.wrike.wrike_list_tasks({
  folderId = ""
  status = ""
})

wrike_update_task

Update an existing Wrike task.

Parameters

NameTypeRequiredDescription
task_idstringyesThe task ID to update.
titlestringnoNew title for the task.
descriptionstringnoNew description for the task.
statusstringnoNew status (e.g. Active, Completed, Deferred).
importancestringnoTask importance: High, Normal, or Low.
dates_duestringnoNew due date in YYYY-MM-DD format.

Example

local result = app.integrations.wrike.wrike_update_task({
  task_id = ""
  title = ""
  description = ""
})

Multi-Account Usage

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

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

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

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

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

Raw agent markdown
# Client for the Wrike REST API — Lua API Reference

## wrike_add_comment

Add a comment to a Wrike task.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `task_id` | string | yes | ID of the task to comment on. |
| `text` | string | yes | Comment text (supports Markdown). |

### Example

```lua
local result = app.integrations.wrike.wrike_add_comment({
  task_id = ""
  text = ""
})
```

## wrike_create_folder

Create a new folder in Wrike.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Title of the folder. |
| `parent_id` | string | no | Parent folder or space ID to nest the folder under. |
| `description` | string | no | Description of the folder. |

### Example

```lua
local result = app.integrations.wrike.wrike_create_folder({
  title = ""
  description = ""
})
```

## wrike_create_task

Create a new task in Wrike.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `folderId` | string | yes | Folder ID to create the task in. |
| `title` | string | yes | Title of the task. |
| `description` | string | no | Detailed description of the task. |
| `importance` | string | no | Task importance (High, Normal, Low). |
| `status` | string | no | Task status (Active, Completed, Deferred). |
| `dates` | object | no | Date settings object (start, due, type). |
| `assignees` | array | no | Array of user IDs to assign the task to. |

### Example

```lua
local result = app.integrations.wrike.wrike_create_task({
  folderId = ""
  title = ""
  description = ""
})
```

## wrike_get_current_user

Get the currently authenticated Wrike user.

### Example

```lua
local result = app.integrations.wrike.wrike_get_current_user({
})
```

## wrike_get_folder

Get detailed information about a Wrike folder.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `folder_id` | string | yes | The folder ID. |

### Example

```lua
local result = app.integrations.wrike.wrike_get_folder({
  folder_id = ""
})
```

## wrike_get_project

Get detailed information about a Wrike project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The project ID. |

### Example

```lua
local result = app.integrations.wrike.wrike_get_project({
  id = ""
})
```

## wrike_get_space

Get detailed information about a Wrike space.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `space_id` | string | yes | The space ID. |

### Example

```lua
local result = app.integrations.wrike.wrike_get_space({
  space_id = ""
})
```

## wrike_get_task

Get detailed information about a Wrike task.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The task ID. |

### Example

```lua
local result = app.integrations.wrike.wrike_get_task({
  id = ""
})
```

## wrike_list_contacts

List contacts in Wrike.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Max number of contacts to return. |

### Example

```lua
local result = app.integrations.wrike.wrike_list_contacts({
})
```

## wrike_list_folders

List folders in Wrike with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Max number of folders to return. |
| `nextPageToken` | string | no | Cursor for pagination from a previous response. |

### Example

```lua
local result = app.integrations.wrike.wrike_list_folders({
})
```

## wrike_list_projects

List projects in Wrike with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | string | no | Filter by project status (Active, Completed, Deferred). |
| `limit` | integer | no | Max number of projects to return. |
| `nextPageToken` | string | no | Cursor for pagination from a previous response. |

### Example

```lua
local result = app.integrations.wrike.wrike_list_projects({
  status = ""
})
```

## wrike_list_spaces

List spaces in Wrike.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Max number of spaces to return. |

### Example

```lua
local result = app.integrations.wrike.wrike_list_spaces({
})
```

## wrike_list_tasks

List tasks in Wrike with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `folderId` | string | no | Folder ID to list tasks from. |
| `status` | string | no | Filter by status (e.g. Active, Completed, Deferred). |
| `importance` | string | no | Filter by importance (e.g. High, Normal, Low). |
| `limit` | integer | no | Max number of tasks to return. |
| `nextPageToken` | string | no | Cursor for pagination from a previous response. |

### Example

```lua
local result = app.integrations.wrike.wrike_list_tasks({
  folderId = ""
  status = ""
})
```

## wrike_update_task

Update an existing Wrike task.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `task_id` | string | yes | The task ID to update. |
| `title` | string | no | New title for the task. |
| `description` | string | no | New description for the task. |
| `status` | string | no | New status (e.g. Active, Completed, Deferred). |
| `importance` | string | no | Task importance: High, Normal, or Low. |
| `dates_due` | string | no | New due date in YYYY-MM-DD format. |

### Example

```lua
local result = app.integrations.wrike.wrike_update_task({
  task_id = ""
  title = ""
  description = ""
})
```

---

## Multi-Account Usage

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

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

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

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

All functions are identical across accounts — only the credentials differ.
Metadata-derived Lua example
local result = app.integrations.wrike.create_task({folderId = "example_folderId", title = "example_title", description = "example_description", importance = "example_importance", status = "example_status", dates = "example_dates", assignees = "example_assignees"})
print(result)

Functions

create_task Write

Create a new task in Wrike.

Lua path
app.integrations.wrike.create_task
Full name
wrike.wrike_create_task
ParameterTypeRequiredDescription
folderId string yes Folder ID to create the task in.
title string yes Title of the task.
description string no Detailed description of the task.
importance string no Task importance (High, Normal, Low).
status string no Task status (Active, Completed, Deferred).
dates object no Date settings object (start, due, type).
assignees array no Array of user IDs to assign the task to.
get_task Read

Get detailed information about a Wrike task.

Lua path
app.integrations.wrike.get_task
Full name
wrike.wrike_get_task
ParameterTypeRequiredDescription
id string yes The task ID.
update_task Write

Update an existing Wrike task.

Lua path
app.integrations.wrike.update_task
Full name
wrike.wrike_update_task
ParameterTypeRequiredDescription
task_id string yes The task ID to update.
title string no New title for the task.
description string no New description for the task.
status string no New status (e.g. Active, Completed, Deferred).
importance string no Task importance: High, Normal, or Low.
dates_due string no New due date in YYYY-MM-DD format.
list_tasks Read

List tasks in Wrike with optional filters.

Lua path
app.integrations.wrike.list_tasks
Full name
wrike.wrike_list_tasks
ParameterTypeRequiredDescription
folderId string no Folder ID to list tasks from.
status string no Filter by status (e.g. Active, Completed, Deferred).
importance string no Filter by importance (e.g. High, Normal, Low).
limit integer no Max number of tasks to return.
nextPageToken string no Cursor for pagination from a previous response.
add_comment Write

Add a comment to a Wrike task.

Lua path
app.integrations.wrike.add_comment
Full name
wrike.wrike_add_comment
ParameterTypeRequiredDescription
task_id string yes ID of the task to comment on.
text string yes Comment text (supports Markdown).
get_project Read

Get detailed information about a Wrike project.

Lua path
app.integrations.wrike.get_project
Full name
wrike.wrike_get_project
ParameterTypeRequiredDescription
id string yes The project ID.
list_projects Read

List projects in Wrike with optional filters.

Lua path
app.integrations.wrike.list_projects
Full name
wrike.wrike_list_projects
ParameterTypeRequiredDescription
status string no Filter by project status (Active, Completed, Deferred).
limit integer no Max number of projects to return.
nextPageToken string no Cursor for pagination from a previous response.
create_folder Write

Create a new folder in Wrike.

Lua path
app.integrations.wrike.create_folder
Full name
wrike.wrike_create_folder
ParameterTypeRequiredDescription
title string yes Title of the folder.
parent_id string no Parent folder or space ID to nest the folder under.
description string no Description of the folder.
get_folder Read

Get detailed information about a Wrike folder.

Lua path
app.integrations.wrike.get_folder
Full name
wrike.wrike_get_folder
ParameterTypeRequiredDescription
folder_id string yes The folder ID.
list_folders Read

List folders in Wrike with optional filters.

Lua path
app.integrations.wrike.list_folders
Full name
wrike.wrike_list_folders
ParameterTypeRequiredDescription
limit integer no Max number of folders to return.
nextPageToken string no Cursor for pagination from a previous response.
get_space Read

Get detailed information about a Wrike space.

Lua path
app.integrations.wrike.get_space
Full name
wrike.wrike_get_space
ParameterTypeRequiredDescription
space_id string yes The space ID.
list_spaces Read

List spaces in Wrike.

Lua path
app.integrations.wrike.list_spaces
Full name
wrike.wrike_list_spaces
ParameterTypeRequiredDescription
limit integer no Max number of spaces to return.
list_contacts Read

List contacts in Wrike.

Lua path
app.integrations.wrike.list_contacts
Full name
wrike.wrike_list_contacts
ParameterTypeRequiredDescription
limit integer no Max number of contacts to return.
get_current_user Read

Get the currently authenticated Wrike user.

Lua path
app.integrations.wrike.get_current_user
Full name
wrike.wrike_get_current_user
ParameterTypeRequiredDescription
No parameters.