KosmoKrator

communication

Courier CLI for AI Agents

Use the Courier CLI from KosmoKrator to call Courier tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write API key auth

Courier CLI Setup

Courier can be configured headlessly with `kosmokrator integrations:configure courier`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure courier --set api_key="$COURIER_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor courier --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key COURIER_API_KEY Secret secret yes API Key
url COURIER_URL URL url no Courier API URL

Call Courier Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call courier.courier_send_message '{
  "message": "example_message",
  "recipient": "example_recipient"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:courier courier_send_message '{
  "message": "example_message",
  "recipient": "example_recipient"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs courier --json
kosmo integrations:docs courier.courier_send_message --json
kosmo integrations:schema courier.courier_send_message --json
kosmo integrations:search "Courier" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Courier.

courier.courier_send_message

Write write

Send a notification message through Courier. Provide a message payload with content or template, and a recipient (user ID, email, or recipient object). Supports all Courier send options including channels, routing, and preferences.

Parameters
message, recipient

Generic CLI call

kosmo integrations:call courier.courier_send_message '{"message":"example_message","recipient":"example_recipient"}' --json

Provider shortcut

kosmo integrations:courier courier_send_message '{"message":"example_message","recipient":"example_recipient"}' --json

courier.courier_list_messages

Read read

List messages from Courier with optional filtering by status and cursor-based pagination. Returns message IDs, statuses, and metadata.

Parameters
limit, cursor, status

Generic CLI call

kosmo integrations:call courier.courier_list_messages '{"limit":1,"cursor":"example_cursor","status":"example_status"}' --json

Provider shortcut

kosmo integrations:courier courier_list_messages '{"limit":1,"cursor":"example_cursor","status":"example_status"}' --json

courier.courier_get_message

Read read

Get detailed information about a specific Courier message, including delivery status, content, and channel details.

Parameters
id

Generic CLI call

kosmo integrations:call courier.courier_get_message '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:courier courier_get_message '{"id":"example_id"}' --json

courier.courier_list_recipients

Read read

List notification recipients from Courier with cursor-based pagination. Returns recipient IDs, contact details, and preferences.

Parameters
limit, cursor

Generic CLI call

kosmo integrations:call courier.courier_list_recipients '{"limit":1,"cursor":"example_cursor"}' --json

Provider shortcut

kosmo integrations:courier courier_list_recipients '{"limit":1,"cursor":"example_cursor"}' --json

courier.courier_get_recipient

Read read

Get detailed information about a specific Courier recipient, including contact preferences and channel profiles.

Parameters
id

Generic CLI call

kosmo integrations:call courier.courier_get_recipient '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:courier courier_get_recipient '{"id":"example_id"}' --json

courier.courier_list_templates

Read read

List notification templates from Courier with cursor-based pagination. Returns template IDs, names, and metadata.

Parameters
limit, cursor

Generic CLI call

kosmo integrations:call courier.courier_list_templates '{"limit":1,"cursor":"example_cursor"}' --json

Provider shortcut

kosmo integrations:courier courier_list_templates '{"limit":1,"cursor":"example_cursor"}' --json

courier.courier_get_current_user

Read read

Get the currently authenticated Courier user profile. Use this to verify the API key and see account information.

Parameters
none

Generic CLI call

kosmo integrations:call courier.courier_get_current_user '{}' --json

Provider shortcut

kosmo integrations:courier courier_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

courier.courier_send_message

Send a notification message through Courier. Provide a message payload with content or template, and a recipient (user ID, email, or recipient object). Supports all Courier send options including channels, routing, and preferences.

Operation
Write write
Schema command
kosmo integrations:schema courier.courier_send_message --json
ParameterTypeRequiredDescription
message object yes The message payload. Can include "template" (template ID), "content" (title/body blocks), "routing" (channel overrides), "data" (template variables), and other Courier send options. Pass as a JSON object.
recipient string yes The message recipient. Can be a Courier user ID, email address, or a JSON object with recipient details (e.g., {"email": "[email protected]"}).

courier.courier_list_messages

List messages from Courier with optional filtering by status and cursor-based pagination. Returns message IDs, statuses, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_list_messages --json
ParameterTypeRequiredDescription
limit integer no Maximum number of messages to return (default: 20, max: 200).
cursor string no Pagination cursor — pass the cursor from a previous response to fetch the next page.
status string no Filter by message status. Possible values: "delivered", "undelivered", "opened", "clicked", "bounced", "enqueued".

courier.courier_get_message

Get detailed information about a specific Courier message, including delivery status, content, and channel details.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_get_message --json
ParameterTypeRequiredDescription
id string yes The message ID (e.g., "msg_1234567890").

courier.courier_list_recipients

List notification recipients from Courier with cursor-based pagination. Returns recipient IDs, contact details, and preferences.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_list_recipients --json
ParameterTypeRequiredDescription
limit integer no Maximum number of recipients to return (default: 20, max: 200).
cursor string no Pagination cursor — pass the cursor from a previous response to fetch the next page.

courier.courier_get_recipient

Get detailed information about a specific Courier recipient, including contact preferences and channel profiles.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_get_recipient --json
ParameterTypeRequiredDescription
id string yes The recipient ID (e.g., "rcpt_1234567890").

courier.courier_list_templates

List notification templates from Courier with cursor-based pagination. Returns template IDs, names, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_list_templates --json
ParameterTypeRequiredDescription
limit integer no Maximum number of templates to return (default: 20, max: 200).
cursor string no Pagination cursor — pass the cursor from a previous response to fetch the next page.

courier.courier_get_current_user

Get the currently authenticated Courier user profile. Use this to verify the API key and see account information.

Operation
Read read
Schema command
kosmo integrations:schema courier.courier_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.