KosmoKrator

productivity

Clockify Lua API for KosmoKrator Agents

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

12 functions 8 read 4 write API key auth

Lua Namespace

Agents call this integration through app.integrations.clockify.*. Use lua_read_doc("integrations.clockify") 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.

Clockify — Lua API Reference

clockify_list_workspaces

List all Clockify workspaces the authenticated user belongs to.

Parameters

None

Example

local workspaces = app.integrations.clockify.list_workspaces()

for _, ws in ipairs(workspaces) do
  print(ws.id .. ": " .. ws.name)
end

clockify_get_workspace

Get details for a single Clockify workspace.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID

Example

local ws = app.integrations.clockify.get_workspace({
  workspace_id = "abc123"
})
print(ws.name)

clockify_list_projects

List projects in a Clockify workspace.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
namestringnoFilter by project name (partial match)
pageintegernoPage number, 1-based (default: 1)
page_sizeintegernoItems per page (default: 50)

Example

local projects = app.integrations.clockify.list_projects({
  workspace_id = "abc123",
  name = "Marketing"
})

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

clockify_get_project

Get details for a single Clockify project.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
project_idstringyesThe project ID

Example

local project = app.integrations.clockify.get_project({
  workspace_id = "abc123",
  project_id = "proj456"
})
print(project.name .. " — " .. project.color)

clockify_create_project

Create a new project in a Clockify workspace.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
namestringyesProject name
colorstringnoHex color code (e.g. "#ff0000", default: "#03a9f4")
is_publicbooleannoWhether the project is publicly visible (default: false)

Example

local project = app.integrations.clockify.create_project({
  workspace_id = "abc123",
  name = "Website Redesign",
  color = "#e91e63",
  is_public = true
})
print("Created project: " .. project.id)

clockify_list_time_entries

List time entries in a Clockify workspace.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
startstringnoStart date filter (ISO 8601, e.g. "2026-01-01T00:00:00Z")
endstringnoEnd date filter (ISO 8601)
projectstringnoFilter by project ID
pageintegernoPage number, 1-based (default: 1)
page_sizeintegernoItems per page (default: 50)

Example

local entries = app.integrations.clockify.list_time_entries({
  workspace_id = "abc123",
  start = "2026-04-01T00:00:00Z",
  end = "2026-04-05T23:59:59Z"
})

for _, e in ipairs(entries) do
  print(e.description .. ": " .. e.timeInterval.start .. " → " .. e.timeInterval.end)
end

Filter by project

local entries = app.integrations.clockify.list_time_entries({
  workspace_id = "abc123",
  project = "proj456"
})

clockify_get_time_entry

Get details for a single Clockify time entry.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
time_entry_idstringyesThe time entry ID

Example

local entry = app.integrations.clockify.get_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789"
})
print(entry.description)

clockify_create_time_entry

Create a new time entry in a Clockify workspace.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
startstringyesStart time (ISO 8601, e.g. "2026-04-05T09:00:00Z")
endstringyesEnd time (ISO 8601, e.g. "2026-04-05T17:00:00Z")
descriptionstringnoDescription of the time entry
project_idstringnoProject ID to assign the time entry to

Example

local entry = app.integrations.clockify.create_time_entry({
  workspace_id = "abc123",
  start = "2026-04-05T09:00:00Z",
  end = "2026-04-05T12:30:00Z",
  description = "Worked on API integration",
  project_id = "proj456"
})
print("Created entry: " .. entry.id)

clockify_update_time_entry

Update an existing Clockify time entry.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
time_entry_idstringyesThe time entry ID
startstringnoNew start time (ISO 8601)
endstringnoNew end time (ISO 8601)
descriptionstringnoNew description
project_idstringnoNew project ID to assign

Example

local entry = app.integrations.clockify.update_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789",
  description = "Updated description",
  end = "2026-04-05T14:00:00Z"
})
print("Updated entry: " .. entry.id)

clockify_delete_time_entry

Delete a Clockify time entry. This action cannot be undone.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
time_entry_idstringyesThe time entry ID to delete

Example

app.integrations.clockify.delete_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789"
})
print("Time entry deleted.")

clockify_list_tasks

List tasks for a Clockify project.

Parameters

NameTypeRequiredDescription
workspace_idstringyesThe workspace ID
project_idstringyesThe project ID
pageintegernoPage number, 1-based (default: 1)
page_sizeintegernoItems per page (default: 50)

Example

local tasks = app.integrations.clockify.list_tasks({
  workspace_id = "abc123",
  project_id = "proj456"
})

for _, t in ipairs(tasks) do
  print(t.id .. ": " .. t.name .. " (" .. t.status .. ")")
end

clockify_get_current_user

Get the authenticated Clockify user profile. Useful for verifying API key validity.

Parameters

None

Example

local user = app.integrations.clockify.get_current_user()
print(user.name .. " <" .. user.email .. ">")

Multi-Account Usage

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

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

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

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

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

Raw agent markdown
# Clockify — Lua API Reference

## clockify_list_workspaces

List all Clockify workspaces the authenticated user belongs to.

### Parameters

_None_

### Example

```lua
local workspaces = app.integrations.clockify.list_workspaces()

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

---

## clockify_get_workspace

Get details for a single Clockify workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |

### Example

```lua
local ws = app.integrations.clockify.get_workspace({
  workspace_id = "abc123"
})
print(ws.name)
```

---

## clockify_list_projects

List projects in a Clockify workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `name` | string | no | Filter by project name (partial match) |
| `page` | integer | no | Page number, 1-based (default: 1) |
| `page_size` | integer | no | Items per page (default: 50) |

### Example

```lua
local projects = app.integrations.clockify.list_projects({
  workspace_id = "abc123",
  name = "Marketing"
})

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

---

## clockify_get_project

Get details for a single Clockify project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `project_id` | string | yes | The project ID |

### Example

```lua
local project = app.integrations.clockify.get_project({
  workspace_id = "abc123",
  project_id = "proj456"
})
print(project.name .. " — " .. project.color)
```

---

## clockify_create_project

Create a new project in a Clockify workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `name` | string | yes | Project name |
| `color` | string | no | Hex color code (e.g. `"#ff0000"`, default: `"#03a9f4"`) |
| `is_public` | boolean | no | Whether the project is publicly visible (default: `false`) |

### Example

```lua
local project = app.integrations.clockify.create_project({
  workspace_id = "abc123",
  name = "Website Redesign",
  color = "#e91e63",
  is_public = true
})
print("Created project: " .. project.id)
```

---

## clockify_list_time_entries

List time entries in a Clockify workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `start` | string | no | Start date filter (ISO 8601, e.g. `"2026-01-01T00:00:00Z"`) |
| `end` | string | no | End date filter (ISO 8601) |
| `project` | string | no | Filter by project ID |
| `page` | integer | no | Page number, 1-based (default: 1) |
| `page_size` | integer | no | Items per page (default: 50) |

### Example

```lua
local entries = app.integrations.clockify.list_time_entries({
  workspace_id = "abc123",
  start = "2026-04-01T00:00:00Z",
  end = "2026-04-05T23:59:59Z"
})

for _, e in ipairs(entries) do
  print(e.description .. ": " .. e.timeInterval.start .. " → " .. e.timeInterval.end)
end
```

### Filter by project

```lua
local entries = app.integrations.clockify.list_time_entries({
  workspace_id = "abc123",
  project = "proj456"
})
```

---

## clockify_get_time_entry

Get details for a single Clockify time entry.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `time_entry_id` | string | yes | The time entry ID |

### Example

```lua
local entry = app.integrations.clockify.get_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789"
})
print(entry.description)
```

---

## clockify_create_time_entry

Create a new time entry in a Clockify workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `start` | string | yes | Start time (ISO 8601, e.g. `"2026-04-05T09:00:00Z"`) |
| `end` | string | yes | End time (ISO 8601, e.g. `"2026-04-05T17:00:00Z"`) |
| `description` | string | no | Description of the time entry |
| `project_id` | string | no | Project ID to assign the time entry to |

### Example

```lua
local entry = app.integrations.clockify.create_time_entry({
  workspace_id = "abc123",
  start = "2026-04-05T09:00:00Z",
  end = "2026-04-05T12:30:00Z",
  description = "Worked on API integration",
  project_id = "proj456"
})
print("Created entry: " .. entry.id)
```

---

## clockify_update_time_entry

Update an existing Clockify time entry.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `time_entry_id` | string | yes | The time entry ID |
| `start` | string | no | New start time (ISO 8601) |
| `end` | string | no | New end time (ISO 8601) |
| `description` | string | no | New description |
| `project_id` | string | no | New project ID to assign |

### Example

```lua
local entry = app.integrations.clockify.update_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789",
  description = "Updated description",
  end = "2026-04-05T14:00:00Z"
})
print("Updated entry: " .. entry.id)
```

---

## clockify_delete_time_entry

Delete a Clockify time entry. This action cannot be undone.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `time_entry_id` | string | yes | The time entry ID to delete |

### Example

```lua
app.integrations.clockify.delete_time_entry({
  workspace_id = "abc123",
  time_entry_id = "entry789"
})
print("Time entry deleted.")
```

---

## clockify_list_tasks

List tasks for a Clockify project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | yes | The workspace ID |
| `project_id` | string | yes | The project ID |
| `page` | integer | no | Page number, 1-based (default: 1) |
| `page_size` | integer | no | Items per page (default: 50) |

### Example

```lua
local tasks = app.integrations.clockify.list_tasks({
  workspace_id = "abc123",
  project_id = "proj456"
})

for _, t in ipairs(tasks) do
  print(t.id .. ": " .. t.name .. " (" .. t.status .. ")")
end
```

---

## clockify_get_current_user

Get the authenticated Clockify user profile. Useful for verifying API key validity.

### Parameters

_None_

### Example

```lua
local user = app.integrations.clockify.get_current_user()
print(user.name .. " <" .. user.email .. ">")
```

---

## Multi-Account Usage

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

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

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

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

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

Metadata-Derived Lua Example

local result = app.integrations.clockify.clockify_list_workspaces({})
print(result)

Functions

clockify_list_workspaces

List all Clockify workspaces the authenticated user belongs to. Returns workspace IDs and names needed for other Clockify tools.

Operation
Read read
Full name
clockify.clockify_list_workspaces
ParameterTypeRequiredDescription
No parameters.

clockify_get_workspace

Get details for a single Clockify workspace by ID.

Operation
Read read
Full name
clockify.clockify_get_workspace
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.

clockify_list_projects

List projects in a Clockify workspace. Optionally filter by name and paginate results.

Operation
Read read
Full name
clockify.clockify_list_projects
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
name string no Filter by project name (partial match).
page integer no Page number (1-based, default: 1).
page_size integer no Items per page (default: 50).

clockify_get_project

Get details for a single Clockify project by ID.

Operation
Read read
Full name
clockify.clockify_get_project
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
project_id string yes The project ID.

clockify_create_project

Create a new project in a Clockify workspace.

Operation
Write write
Full name
clockify.clockify_create_project
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
name string yes Project name.
color string no Hex color code (e.g. "#ff0000"). Defaults to "#03a9f4".
is_public boolean no Whether the project is publicly visible. Defaults to false.

clockify_list_time_entries

List time entries in a Clockify workspace. Optionally filter by date range or project.

Operation
Read read
Full name
clockify.clockify_list_time_entries
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
start string no Start date filter (ISO 8601, e.g. "2026-01-01T00:00:00Z").
end string no End date filter (ISO 8601).
project string no Filter by project ID.
page integer no Page number (1-based, default: 1).
page_size integer no Items per page (default: 50).

clockify_get_time_entry

Get details for a single Clockify time entry by ID.

Operation
Read read
Full name
clockify.clockify_get_time_entry
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
time_entry_id string yes The time entry ID.

clockify_create_time_entry

Create a new time entry in a Clockify workspace. Provide start/end times, a description, and optionally a project.

Operation
Write write
Full name
clockify.clockify_create_time_entry
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
start string yes Start time (ISO 8601, e.g. "2026-04-05T09:00:00Z").
end string yes End time (ISO 8601, e.g. "2026-04-05T17:00:00Z").
description string no Description of the time entry.
project_id string no Project ID to assign the time entry to.

clockify_update_time_entry

Update an existing Clockify time entry. Provide the fields you want to change.

Operation
Write write
Full name
clockify.clockify_update_time_entry
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
time_entry_id string yes The time entry ID.
start string no New start time (ISO 8601).
end string no New end time (ISO 8601).
description string no New description.
project_id string no New project ID to assign.

clockify_delete_time_entry

Delete a Clockify time entry. This action cannot be undone.

Operation
Write write
Full name
clockify.clockify_delete_time_entry
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
time_entry_id string yes The time entry ID to delete.

clockify_list_tasks

List tasks for a Clockify project.

Operation
Read read
Full name
clockify.clockify_list_tasks
ParameterTypeRequiredDescription
workspace_id string yes The workspace ID.
project_id string yes The project ID.
page integer no Page number (1-based, default: 1).
page_size integer no Items per page (default: 50).

clockify_get_current_user

Get the authenticated Clockify user profile. Use this to verify your API key is working.

Operation
Read read
Full name
clockify.clockify_get_current_user
ParameterTypeRequiredDescription
No parameters.