KosmoKrator

productivity

Harvest Lua API for KosmoKrator Agents

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

12 functions 9 read 3 write Manual OAuth token auth

Lua Namespace

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

Client for the Harvest REST API v2 — Lua API Reference

harvest_create_time_entry

Create a new Harvest time entry for a project and task..

Parameters

NameTypeRequiredDescription
project_idintegeryesProject ID to log time against.
task_idintegeryesTask ID to associate with the entry.
spent_datestringyesDate the time was spent (YYYY-MM-DD).
hoursnumbernoNumber of hours logged (e.g. 1.5).
notesstringnoNotes describing the time entry.
timer_started_atstringnoISO 8601 timestamp when the timer was started.

Example

local result = app.integrations.harvest.harvest_create_time_entry({
  project_id = 0
  task_id = 0
  spent_date = ""
})

harvest_delete_time_entry

Delete a Harvest time entry by its ID..

Parameters

NameTypeRequiredDescription
idintegeryesThe time entry ID to delete.

Example

local result = app.integrations.harvest.harvest_delete_time_entry({
  id = 0
})

harvest_get_current_user

Get the currently authenticated Harvest user profile..

Example

local result = app.integrations.harvest.harvest_get_current_user({
})

harvest_get_project

Get a single Harvest project by its ID..

Parameters

NameTypeRequiredDescription
idintegeryesThe project ID.

Example

local result = app.integrations.harvest.harvest_get_project({
  id = 0
})

harvest_get_time_entry

Get a single Harvest time entry by its ID..

Parameters

NameTypeRequiredDescription
idintegeryesThe time entry ID.

Example

local result = app.integrations.harvest.harvest_get_time_entry({
  id = 0
})

harvest_get_user

Get a single Harvest user by their ID..

Parameters

NameTypeRequiredDescription
idintegeryesThe user ID.

Example

local result = app.integrations.harvest.harvest_get_user({
  id = 0
})

harvest_list_clients

List Harvest clients with optional active status filter..

Parameters

NameTypeRequiredDescription
is_activebooleannoFilter to active clients only.
pageintegernoPage number (default: 1).

Example

local result = app.integrations.harvest.harvest_list_clients({
  is_active = true
  page = 0
})

harvest_list_projects

List Harvest projects with optional filters for client and active status..

Parameters

NameTypeRequiredDescription
client_idintegernoFilter by client ID.
is_activebooleannoFilter to active projects only.
pageintegernoPage number (default: 1).
per_pageintegernoResults per page (default: 100).

Example

local result = app.integrations.harvest.harvest_list_projects({
  client_id = 0
  is_active = true
  page = 0
})

harvest_list_tasks

List Harvest tasks with optional active status filter..

Parameters

NameTypeRequiredDescription
is_activebooleannoFilter to active tasks only.
pageintegernoPage number (default: 1).

Example

local result = app.integrations.harvest.harvest_list_tasks({
  is_active = true
  page = 0
})

harvest_list_time_entries

List Harvest time entries with optional filters for user, client, project, and date range..

Parameters

NameTypeRequiredDescription
user_idintegernoFilter by user ID.
client_idintegernoFilter by client ID.
project_idintegernoFilter by project ID.
is_billedbooleannoFilter by billed status (true/false).
is_runningbooleannoFilter to only running timers.
fromstringnoStart date filter (YYYY-MM-DD).
tostringnoEnd date filter (YYYY-MM-DD).
pageintegernoPage number (default: 1).
per_pageintegernoResults per page (default: 100, max: 2000).

Example

local result = app.integrations.harvest.harvest_list_time_entries({
  user_id = 0
  client_id = 0
  project_id = 0
})

harvest_list_users

List Harvest users with optional active status filter..

Parameters

NameTypeRequiredDescription
is_activebooleannoFilter to active users only.
pageintegernoPage number (default: 1).
per_pageintegernoResults per page (default: 100).

Example

local result = app.integrations.harvest.harvest_list_users({
  is_active = true
  page = 0
  per_page = 0
})

harvest_update_time_entry

Update an existing Harvest time entry (hours, notes, or spent_date)..

Parameters

NameTypeRequiredDescription
idintegeryesThe time entry ID to update.
hoursnumbernoUpdated number of hours (e.g. 2.5).
notesstringnoUpdated notes for the time entry.
spent_datestringnoUpdated spent date (YYYY-MM-DD).

Example

local result = app.integrations.harvest.harvest_update_time_entry({
  id = 0
  hours = 0
  notes = ""
})

Multi-Account Usage

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

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

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

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

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

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

## harvest_create_time_entry

Create a new Harvest time entry for a project and task..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | integer | yes | Project ID to log time against. |
| `task_id` | integer | yes | Task ID to associate with the entry. |
| `spent_date` | string | yes | Date the time was spent (YYYY-MM-DD). |
| `hours` | number | no | Number of hours logged (e.g. 1.5). |
| `notes` | string | no | Notes describing the time entry. |
| `timer_started_at` | string | no | ISO 8601 timestamp when the timer was started. |

### Example

```lua
local result = app.integrations.harvest.harvest_create_time_entry({
  project_id = 0
  task_id = 0
  spent_date = ""
})
```

## harvest_delete_time_entry

Delete a Harvest time entry by its ID..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The time entry ID to delete. |

### Example

```lua
local result = app.integrations.harvest.harvest_delete_time_entry({
  id = 0
})
```

## harvest_get_current_user

Get the currently authenticated Harvest user profile..

### Example

```lua
local result = app.integrations.harvest.harvest_get_current_user({
})
```

## harvest_get_project

Get a single Harvest project by its ID..

### Parameters

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

### Example

```lua
local result = app.integrations.harvest.harvest_get_project({
  id = 0
})
```

## harvest_get_time_entry

Get a single Harvest time entry by its ID..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The time entry ID. |

### Example

```lua
local result = app.integrations.harvest.harvest_get_time_entry({
  id = 0
})
```

## harvest_get_user

Get a single Harvest user by their ID..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The user ID. |

### Example

```lua
local result = app.integrations.harvest.harvest_get_user({
  id = 0
})
```

## harvest_list_clients

List Harvest clients with optional active status filter..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `is_active` | boolean | no | Filter to active clients only. |
| `page` | integer | no | Page number (default: 1). |

### Example

```lua
local result = app.integrations.harvest.harvest_list_clients({
  is_active = true
  page = 0
})
```

## harvest_list_projects

List Harvest projects with optional filters for client and active status..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `client_id` | integer | no | Filter by client ID. |
| `is_active` | boolean | no | Filter to active projects only. |
| `page` | integer | no | Page number (default: 1). |
| `per_page` | integer | no | Results per page (default: 100). |

### Example

```lua
local result = app.integrations.harvest.harvest_list_projects({
  client_id = 0
  is_active = true
  page = 0
})
```

## harvest_list_tasks

List Harvest tasks with optional active status filter..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `is_active` | boolean | no | Filter to active tasks only. |
| `page` | integer | no | Page number (default: 1). |

### Example

```lua
local result = app.integrations.harvest.harvest_list_tasks({
  is_active = true
  page = 0
})
```

## harvest_list_time_entries

List Harvest time entries with optional filters for user, client, project, and date range..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `user_id` | integer | no | Filter by user ID. |
| `client_id` | integer | no | Filter by client ID. |
| `project_id` | integer | no | Filter by project ID. |
| `is_billed` | boolean | no | Filter by billed status (true/false). |
| `is_running` | boolean | no | Filter to only running timers. |
| `from` | string | no | Start date filter (YYYY-MM-DD). |
| `to` | string | no | End date filter (YYYY-MM-DD). |
| `page` | integer | no | Page number (default: 1). |
| `per_page` | integer | no | Results per page (default: 100, max: 2000). |

### Example

```lua
local result = app.integrations.harvest.harvest_list_time_entries({
  user_id = 0
  client_id = 0
  project_id = 0
})
```

## harvest_list_users

List Harvest users with optional active status filter..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `is_active` | boolean | no | Filter to active users only. |
| `page` | integer | no | Page number (default: 1). |
| `per_page` | integer | no | Results per page (default: 100). |

### Example

```lua
local result = app.integrations.harvest.harvest_list_users({
  is_active = true
  page = 0
  per_page = 0
})
```

## harvest_update_time_entry

Update an existing Harvest time entry (hours, notes, or spent_date)..

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The time entry ID to update. |
| `hours` | number | no | Updated number of hours (e.g. 2.5). |
| `notes` | string | no | Updated notes for the time entry. |
| `spent_date` | string | no | Updated spent date (YYYY-MM-DD). |

### Example

```lua
local result = app.integrations.harvest.harvest_update_time_entry({
  id = 0
  hours = 0
  notes = ""
})
```

---

## Multi-Account Usage

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

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

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

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

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

Metadata-Derived Lua Example

local result = app.integrations.harvest.harvest_list_time_entries({
  user_id = 1,
  client_id = 1,
  project_id = 1,
  is_billed = true,
  is_running = true,
  from = "example_from",
  to = "example_to",
  page = 1
})
print(result)

Functions

harvest_list_time_entries

List Harvest time entries with optional filters for user, client, project, and date range.

Operation
Read read
Full name
harvest.harvest_list_time_entries
ParameterTypeRequiredDescription
user_id integer no Filter by user ID.
client_id integer no Filter by client ID.
project_id integer no Filter by project ID.
is_billed boolean no Filter by billed status (true/false).
is_running boolean no Filter to only running timers.
from string no Start date filter (YYYY-MM-DD).
to string no End date filter (YYYY-MM-DD).
page integer no Page number (default: 1).
per_page integer no Results per page (default: 100, max: 2000).

harvest_create_time_entry

Create a new Harvest time entry for a project and task.

Operation
Write write
Full name
harvest.harvest_create_time_entry
ParameterTypeRequiredDescription
project_id integer yes Project ID to log time against.
task_id integer yes Task ID to associate with the entry.
spent_date string yes Date the time was spent (YYYY-MM-DD).
hours number no Number of hours logged (e.g. 1.5).
notes string no Notes describing the time entry.
timer_started_at string no ISO 8601 timestamp when the timer was started.

harvest_get_time_entry

Get a single Harvest time entry by its ID.

Operation
Read read
Full name
harvest.harvest_get_time_entry
ParameterTypeRequiredDescription
id integer yes The time entry ID.

harvest_update_time_entry

Update an existing Harvest time entry (hours, notes, or spent_date).

Operation
Write write
Full name
harvest.harvest_update_time_entry
ParameterTypeRequiredDescription
id integer yes The time entry ID to update.
hours number no Updated number of hours (e.g. 2.5).
notes string no Updated notes for the time entry.
spent_date string no Updated spent date (YYYY-MM-DD).

harvest_delete_time_entry

Delete a Harvest time entry by its ID.

Operation
Write write
Full name
harvest.harvest_delete_time_entry
ParameterTypeRequiredDescription
id integer yes The time entry ID to delete.

harvest_list_projects

List Harvest projects with optional filters for client and active status.

Operation
Read read
Full name
harvest.harvest_list_projects
ParameterTypeRequiredDescription
client_id integer no Filter by client ID.
is_active boolean no Filter to active projects only.
page integer no Page number (default: 1).
per_page integer no Results per page (default: 100).

harvest_get_project

Get a single Harvest project by its ID.

Operation
Read read
Full name
harvest.harvest_get_project
ParameterTypeRequiredDescription
id integer yes The project ID.

harvest_list_clients

List Harvest clients with optional active status filter.

Operation
Read read
Full name
harvest.harvest_list_clients
ParameterTypeRequiredDescription
is_active boolean no Filter to active clients only.
page integer no Page number (default: 1).

harvest_list_tasks

List Harvest tasks with optional active status filter.

Operation
Read read
Full name
harvest.harvest_list_tasks
ParameterTypeRequiredDescription
is_active boolean no Filter to active tasks only.
page integer no Page number (default: 1).

harvest_list_users

List Harvest users with optional active status filter.

Operation
Read read
Full name
harvest.harvest_list_users
ParameterTypeRequiredDescription
is_active boolean no Filter to active users only.
page integer no Page number (default: 1).
per_page integer no Results per page (default: 100).

harvest_get_user

Get a single Harvest user by their ID.

Operation
Read read
Full name
harvest.harvest_get_user
ParameterTypeRequiredDescription
id integer yes The user ID.

harvest_get_current_user

Get the currently authenticated Harvest user profile.

Operation
Read read
Full name
harvest.harvest_get_current_user
ParameterTypeRequiredDescription
No parameters.