productivity
Missive Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Missive KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.missive.*.
Use lua_read_doc("integrations.missive") 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
Missive workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.missive.list_conversations({inbox = "example_inbox", assignee = "example_assignee", state = "example_state", limit = 1, offset = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("missive"))' --json
kosmo integrations:lua --eval 'print(docs.read("missive.list_conversations"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local missive = app.integrations.missive
local result = missive.list_conversations({inbox = "example_inbox", assignee = "example_assignee", state = "example_state", limit = 1, offset = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.missive, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.missive.default.* or app.integrations.missive.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Missive, 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.
Missive Lua Reference
Namespace: missive
Missive tools target the public REST API at https://public.missiveapp.com/v1.
Configure a personal access token; the integration sends it as
Authorization: Bearer <access_token>.
Conversations
local conversations = app.integrations.missive.list_conversations({
state = "open",
limit = 25
})
local conversation = app.integrations.missive.get_conversation({
id = "conv_123"
})
local messages = app.integrations.missive.list_conversation_messages({
conversation_id = "conv_123",
params = { limit = 20 }
})
local comments = app.integrations.missive.list_conversation_comments({
conversation_id = "conv_123"
})
Additional conversation helpers:
list_conversation_drafts({ conversation_id, params? })list_conversation_posts({ conversation_id, params? })merge_conversation({ conversation_id, body })create_comment({ conversation_id, body, assignees? })
Drafts, Messages, And Posts
local draft = app.integrations.missive.create_draft({
body = {
subject = "Follow up",
body = "Thanks for the details.",
to_fields = { { address = "person@example.test" } }
}
})
local found = app.integrations.missive.list_messages({
params = { email_message_id = "<message-id@example.test>" }
})
Tools: create_draft, delete_draft, list_messages, create_post,
and delete_post. Draft, post, and send payloads are passed as body objects
matching Missive’s documented request schema.
Tasks
local tasks = app.integrations.missive.list_tasks({
state = "open",
limit = 20
})
local task = app.integrations.missive.get_task({ task_id = "task_123" })
local updated = app.integrations.missive.update_task({
task_id = "task_123",
body = { state = "completed" }
})
Contacts
local contacts = app.integrations.missive.list_contacts({
params = {
search = "Example",
limit = 50
}
})
local created = app.integrations.missive.create_contacts({
body = {
contacts = {
{ email = "person@example.test", first_name = "Example" }
}
}
})
Contact tools include get_contact, update_contacts, list_contact_books,
and list_contact_groups. Bulk update IDs are comma-separated strings.
Organization Metadata
local organizations = app.integrations.missive.list_organizations({})
local users = app.integrations.missive.list_users({
params = { organization = "org_123" }
})
local teams = app.integrations.missive.list_teams({})
local labels = app.integrations.missive.list_shared_labels({})
create_teams({ body }) creates one or more teams using Missive’s documented
team payload shape.
Responses, Analytics, And Hooks
local responses = app.integrations.missive.list_responses({})
local report = app.integrations.missive.create_analytics_report({
body = {
organization = "org_123",
start = "2026-05-01",
["end"] = "2026-05-06",
time_zone = "UTC"
}
})
local hooks = app.integrations.missive.list_hooks({})
Response tools support list, get, create, update, and delete. Analytics reports
are asynchronous: create a report first, then call get_analytics_report with
the returned report ID. Hook tools support list, create, and delete.
Generic API
Use generic helpers for documented Missive endpoints without dedicated wrappers:
local raw = app.integrations.missive.api_get({
path = "/contacts",
params = { limit = 10 }
})
Available generic tools: api_get, api_post, api_patch, and api_delete.
Raw agent markdown
# Missive Lua Reference
Namespace: `missive`
Missive tools target the public REST API at `https://public.missiveapp.com/v1`.
Configure a personal access token; the integration sends it as
`Authorization: Bearer <access_token>`.
## Conversations
```lua
local conversations = app.integrations.missive.list_conversations({
state = "open",
limit = 25
})
local conversation = app.integrations.missive.get_conversation({
id = "conv_123"
})
local messages = app.integrations.missive.list_conversation_messages({
conversation_id = "conv_123",
params = { limit = 20 }
})
local comments = app.integrations.missive.list_conversation_comments({
conversation_id = "conv_123"
})
```
Additional conversation helpers:
- `list_conversation_drafts({ conversation_id, params? })`
- `list_conversation_posts({ conversation_id, params? })`
- `merge_conversation({ conversation_id, body })`
- `create_comment({ conversation_id, body, assignees? })`
## Drafts, Messages, And Posts
```lua
local draft = app.integrations.missive.create_draft({
body = {
subject = "Follow up",
body = "Thanks for the details.",
to_fields = { { address = "person@example.test" } }
}
})
local found = app.integrations.missive.list_messages({
params = { email_message_id = "<message-id@example.test>" }
})
```
Tools: `create_draft`, `delete_draft`, `list_messages`, `create_post`,
and `delete_post`. Draft, post, and send payloads are passed as `body` objects
matching Missive's documented request schema.
## Tasks
```lua
local tasks = app.integrations.missive.list_tasks({
state = "open",
limit = 20
})
local task = app.integrations.missive.get_task({ task_id = "task_123" })
local updated = app.integrations.missive.update_task({
task_id = "task_123",
body = { state = "completed" }
})
```
## Contacts
```lua
local contacts = app.integrations.missive.list_contacts({
params = {
search = "Example",
limit = 50
}
})
local created = app.integrations.missive.create_contacts({
body = {
contacts = {
{ email = "person@example.test", first_name = "Example" }
}
}
})
```
Contact tools include `get_contact`, `update_contacts`, `list_contact_books`,
and `list_contact_groups`. Bulk update IDs are comma-separated strings.
## Organization Metadata
```lua
local organizations = app.integrations.missive.list_organizations({})
local users = app.integrations.missive.list_users({
params = { organization = "org_123" }
})
local teams = app.integrations.missive.list_teams({})
local labels = app.integrations.missive.list_shared_labels({})
```
`create_teams({ body })` creates one or more teams using Missive's documented
team payload shape.
## Responses, Analytics, And Hooks
```lua
local responses = app.integrations.missive.list_responses({})
local report = app.integrations.missive.create_analytics_report({
body = {
organization = "org_123",
start = "2026-05-01",
["end"] = "2026-05-06",
time_zone = "UTC"
}
})
local hooks = app.integrations.missive.list_hooks({})
```
Response tools support list, get, create, update, and delete. Analytics reports
are asynchronous: create a report first, then call `get_analytics_report` with
the returned report ID. Hook tools support list, create, and delete.
## Generic API
Use generic helpers for documented Missive endpoints without dedicated wrappers:
```lua
local raw = app.integrations.missive.api_get({
path = "/contacts",
params = { limit = 10 }
})
```
Available generic tools: `api_get`, `api_post`, `api_patch`, and `api_delete`. local result = app.integrations.missive.list_conversations({inbox = "example_inbox", assignee = "example_assignee", state = "example_state", limit = 1, offset = 1})
print(result) Functions
list_conversations Read
List conversations from Missive. Supports filtering by inbox, assignee, and state. Returns paginated results.
- Lua path
app.integrations.missive.list_conversations- Full name
missive.missive_list_conversations
| Parameter | Type | Required | Description |
|---|---|---|---|
inbox | string | no | Filter by inbox ID. |
assignee | string | no | Filter by assignee user ID or email. |
state | string | no | Filter by conversation state: "open", "closed", or "spam". |
limit | integer | no | Maximum number of conversations to return (default: 25, max: 100). |
offset | integer | no | Offset for pagination. |
get_conversation Read
Get a single Missive conversation by ID, including messages and metadata.
- Lua path
app.integrations.missive.get_conversation- Full name
missive.missive_get_conversation
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The conversation UUID. |
list_conversation_messages Read
List messages in a Missive conversation with timestamp pagination.
- Lua path
app.integrations.missive.list_conversation_messages- Full name
missive.missive_list_conversation_messages
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | Conversation UUID. |
params | object | no | Optional query parameters such as limit and until. |
list_conversation_comments Read
List comments in a Missive conversation with timestamp pagination.
- Lua path
app.integrations.missive.list_conversation_comments- Full name
missive.missive_list_conversation_comments
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | Conversation UUID. |
params | object | no | Optional query parameters such as limit and until. |
list_conversation_drafts Read
List drafts in a Missive conversation with timestamp pagination.
- Lua path
app.integrations.missive.list_conversation_drafts- Full name
missive.missive_list_conversation_drafts
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | Conversation UUID. |
params | object | no | Optional query parameters such as limit and until. |
list_conversation_posts Read
List posts in a Missive conversation with timestamp pagination.
- Lua path
app.integrations.missive.list_conversation_posts- Full name
missive.missive_list_conversation_posts
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | Conversation UUID. |
params | object | no | Optional query parameters such as limit and until. |
merge_conversation Write
Merge a source Missive conversation into a target conversation.
- Lua path
app.integrations.missive.merge_conversation- Full name
missive.missive_merge_conversation
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | Source conversation UUID. |
body | object | yes | Merge payload including target and optional subject. |
create_comment Write
Create a comment on a Missive conversation. Use this to add internal notes or replies.
- Lua path
app.integrations.missive.create_comment- Full name
missive.missive_create_comment
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | yes | The UUID of the conversation to comment on. |
body | string | yes | The comment body text. Supports Markdown. |
assignees | array | no | List of user IDs or emails to assign the comment to. |
create_draft Write
Create a Missive draft, or send immediately when send=true.
- Lua path
app.integrations.missive.create_draft- Full name
missive.missive_create_draft
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Draft payload matching the Missive drafts endpoint. |
delete_draft Write
Delete a Missive draft by ID.
- Lua path
app.integrations.missive.delete_draft- Full name
missive.missive_delete_draft
| Parameter | Type | Required | Description |
|---|---|---|---|
draft_id | string | yes | Draft UUID. |
list_messages Read
List Missive messages using documented query parameters such as email_message_id.
- Lua path
app.integrations.missive.list_messages- Full name
missive.missive_list_messages
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as email_message_id. |
create_post Write
Create a Missive post in a conversation.
- Lua path
app.integrations.missive.create_post- Full name
missive.missive_create_post
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Post payload matching the Missive posts endpoint. |
delete_post Write
Delete a Missive post by ID.
- Lua path
app.integrations.missive.delete_post- Full name
missive.missive_delete_post
| Parameter | Type | Required | Description |
|---|---|---|---|
post_id | string | yes | Post UUID. |
list_tasks Read
List tasks from Missive. Supports filtering by state and assignee. Returns paginated results.
- Lua path
app.integrations.missive.list_tasks- Full name
missive.missive_list_tasks
| Parameter | Type | Required | Description |
|---|---|---|---|
state | string | no | Filter by task state: "open" or "completed". |
assignee | string | no | Filter by assignee user ID or email. |
limit | integer | no | Maximum number of tasks to return (default: 25, max: 100). |
offset | integer | no | Offset for pagination. |
get_task Read
Get a single Missive task by ID.
- Lua path
app.integrations.missive.get_task- Full name
missive.missive_get_task
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | Task UUID. |
create_task Write
Create a new task in Missive. Requires a title. Optionally set description, assignee, and due date.
- Lua path
app.integrations.missive.create_task- Full name
missive.missive_create_task
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | yes | The task title. |
description | string | no | Detailed description of the task. Supports Markdown. |
assignee | string | no | User ID or email of the person to assign the task to. |
due_date | string | no | Due date in ISO 8601 format (e.g., "2025-12-31"). |
update_task Write
Update a Missive task by ID.
- Lua path
app.integrations.missive.update_task- Full name
missive.missive_update_task
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | Task UUID. |
body | object | yes | Task attributes to update. |
get_current_user Read
Get the profile of the currently authenticated Missive user, including name, email, and organization info.
- Lua path
app.integrations.missive.get_current_user- Full name
missive.missive_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_organizations Read
List organizations the authenticated Missive user is part of.
- Lua path
app.integrations.missive.list_organizations- Full name
missive.missive_list_organizations
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as limit and offset. |
list_users Read
List users in organizations the authenticated Missive user is part of.
- Lua path
app.integrations.missive.list_users- Full name
missive.missive_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as organization, limit, and offset. |
list_teams Read
List teams in organizations the authenticated Missive user is part of.
- Lua path
app.integrations.missive.list_teams- Full name
missive.missive_list_teams
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as organization, limit, and offset. |
create_teams Write
Create one or more Missive teams.
- Lua path
app.integrations.missive.create_teams- Full name
missive.missive_create_teams
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Team creation payload. |
list_contacts Read
List Missive contacts with contact book, search, pagination, and sync filters.
- Lua path
app.integrations.missive.list_contacts- Full name
missive.missive_list_contacts
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as contact_book, search, modified_since, include_deleted, limit, and offset. |
get_contact Read
Get a Missive contact by ID.
- Lua path
app.integrations.missive.get_contact- Full name
missive.missive_get_contact
| Parameter | Type | Required | Description |
|---|---|---|---|
contact_id | string | yes | Contact UUID. |
create_contacts Write
Create one or more Missive contacts.
- Lua path
app.integrations.missive.create_contacts- Full name
missive.missive_create_contacts
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Contact creation payload. |
update_contacts Write
Update one or more Missive contacts by comma-separated IDs.
- Lua path
app.integrations.missive.update_contacts- Full name
missive.missive_update_contacts
| Parameter | Type | Required | Description |
|---|---|---|---|
contact_ids | string | yes | One or more contact IDs, comma separated. |
body | object | yes | Contact attributes to update. |
list_contact_books Read
List Missive contact books accessible to the API token user.
- Lua path
app.integrations.missive.list_contact_books- Full name
missive.missive_list_contact_books
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as limit and offset. |
list_contact_groups Read
List Missive contact groups or organizations linked to a contact book.
- Lua path
app.integrations.missive.list_contact_groups- Full name
missive.missive_list_contact_groups
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters including contact_book, kind, limit, and offset. |
list_responses Read
List Missive canned responses.
- Lua path
app.integrations.missive.list_responses- Full name
missive.missive_list_responses
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as organization, limit, and offset. |
get_response Read
Get a Missive canned response by ID.
- Lua path
app.integrations.missive.get_response- Full name
missive.missive_get_response
| Parameter | Type | Required | Description |
|---|---|---|---|
response_id | string | yes | Response UUID. |
create_responses Write
Create one or more Missive canned responses.
- Lua path
app.integrations.missive.create_responses- Full name
missive.missive_create_responses
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Response creation payload. |
update_responses Write
Update one or more Missive canned responses by comma-separated IDs.
- Lua path
app.integrations.missive.update_responses- Full name
missive.missive_update_responses
| Parameter | Type | Required | Description |
|---|---|---|---|
response_ids | string | yes | One or more response IDs, comma separated. |
body | object | yes | Response attributes to update. |
delete_responses Write
Delete one or more Missive canned responses by comma-separated IDs.
- Lua path
app.integrations.missive.delete_responses- Full name
missive.missive_delete_responses
| Parameter | Type | Required | Description |
|---|---|---|---|
response_ids | string | yes | One or more response IDs, comma separated. |
create_analytics_report Write
Create an asynchronous Missive analytics report.
- Lua path
app.integrations.missive.create_analytics_report- Full name
missive.missive_create_analytics_report
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Analytics report payload with organization, start, end, and time_zone. |
get_analytics_report Read
Get a Missive analytics report by ID after generation.
- Lua path
app.integrations.missive.get_analytics_report- Full name
missive.missive_get_analytics_report
| Parameter | Type | Required | Description |
|---|---|---|---|
report_id | string | yes | Analytics report UUID returned by create_analytics_report. |
list_hooks Read
List Missive webhook subscriptions.
- Lua path
app.integrations.missive.list_hooks- Full name
missive.missive_list_hooks
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as organization, limit, and offset. |
create_hook Write
Create a Missive webhook subscription.
- Lua path
app.integrations.missive.create_hook- Full name
missive.missive_create_hook
| Parameter | Type | Required | Description |
|---|---|---|---|
body | object | yes | Webhook subscription payload. |
delete_hook Write
Delete a Missive webhook subscription by ID.
- Lua path
app.integrations.missive.delete_hook- Full name
missive.missive_delete_hook
| Parameter | Type | Required | Description |
|---|---|---|---|
hook_id | string | yes | Hook UUID. |
api_get Read
Call a documented Missive API GET endpoint relative to /v1.
- Lua path
app.integrations.missive.api_get- Full name
missive.missive_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Endpoint path, such as /contacts or /shared_labels. |
params | object | no | Optional query parameters. |
api_post Write
Call a documented Missive API POST endpoint relative to /v1.
- Lua path
app.integrations.missive.api_post- Full name
missive.missive_api_post
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Endpoint path, such as /drafts. |
body | object | no | JSON request body. |
api_patch Write
Call a documented Missive API PATCH endpoint relative to /v1.
- Lua path
app.integrations.missive.api_patch- Full name
missive.missive_api_patch
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Endpoint path, such as /contacts/{id}. |
body | object | no | JSON request body. |
api_delete Write
Call a documented Missive API DELETE endpoint relative to /v1.
- Lua path
app.integrations.missive.api_delete- Full name
missive.missive_api_delete
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Endpoint path, such as /drafts/{id}. |
params | object | no | Optional request parameters. |