KosmoKrator

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.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.missive.list_conversations({inbox = "example_inbox", assignee = "example_assignee", state = "example_state", limit = 1, offset = 1}))' --json
Read Lua docs headlessly
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.

workflow.lua
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)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. 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.

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`.
Metadata-derived Lua example
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
body object yes Team creation payload.
list_shared_labels Read

List shared labels in organizations the authenticated user can access.

Lua path
app.integrations.missive.list_shared_labels
Full name
missive.missive_list_shared_labels
ParameterTypeRequiredDescription
params object no Query parameters such as organization, limit, and offset.
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
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
ParameterTypeRequiredDescription
path string yes Endpoint path, such as /drafts/{id}.
params object no Optional request parameters.