KosmoKrator

productivity

Postmark CLI for AI Agents

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

Postmark CLI Setup

Postmark can be configured headlessly with `kosmokrator integrations:configure postmark`.

Install, configure, and verify
# 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 postmark --set server_token="$POSTMARK_SERVER_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor postmark --json
kosmokrator integrations:status --json

Credentials

Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
server_token POSTMARK_SERVER_TOKEN Secret secret yes Server Token
account_token POSTMARK_ACCOUNT_TOKEN Secret secret no Account Token
base_url POSTMARK_BASE_URL Text text no Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call postmark.postmark_list_messages '{"count":1,"offset":1,"recipient":"example_recipient","fromemail":"example_fromemail","subject":"example_subject","status":"example_status","tag":"example_tag"}' --json
Provider shortcut
kosmo integrations:postmark postmark_list_messages '{"count":1,"offset":1,"recipient":"example_recipient","fromemail":"example_fromemail","subject":"example_subject","status":"example_status","tag":"example_tag"}' --json

Discovery

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

Discovery commands
kosmo integrations:docs postmark --json
kosmo integrations:docs postmark.postmark_list_messages --json
kosmo integrations:schema postmark.postmark_list_messages --json
kosmo integrations:search "Postmark" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

postmark.postmark_list_messages

List outbound messages from Postmark. Supports filtering by recipient, sender, subject, status, and tag.

Read read
Parameters
count, offset, recipient, fromemail, subject, status, tag
Generic call
kosmo integrations:call postmark.postmark_list_messages '{"count":1,"offset":1,"recipient":"example_recipient","fromemail":"example_fromemail","subject":"example_subject","status":"example_status","tag":"example_tag"}' --json
Shortcut
kosmo integrations:postmark postmark_list_messages '{"count":1,"offset":1,"recipient":"example_recipient","fromemail":"example_fromemail","subject":"example_subject","status":"example_status","tag":"example_tag"}' --json

postmark.postmark_get_message

Get details for a specific Postmark outbound message including body, recipients, and delivery status.

Read read
Parameters
message_id
Generic call
kosmo integrations:call postmark.postmark_get_message '{"message_id":"example_message_id"}' --json
Shortcut
kosmo integrations:postmark postmark_get_message '{"message_id":"example_message_id"}' --json

postmark.postmark_send_email

Send an email through Postmark. Requires To, From, and Subject. Provide either TextBody or HtmlBody.

Write write
Parameters
To, From, Subject, TextBody, HtmlBody, Cc, Bcc, Tag, ReplyTo
Generic call
kosmo integrations:call postmark.postmark_send_email '{"To":"example_To","From":"example_From","Subject":"example_Subject","TextBody":"example_TextBody","HtmlBody":"example_HtmlBody","Cc":"example_Cc","Bcc":"example_Bcc","Tag":"example_Tag"}' --json
Shortcut
kosmo integrations:postmark postmark_send_email '{"To":"example_To","From":"example_From","Subject":"example_Subject","TextBody":"example_TextBody","HtmlBody":"example_HtmlBody","Cc":"example_Cc","Bcc":"example_Bcc","Tag":"example_Tag"}' --json

postmark.postmark_send_template

Send an email using a Postmark template. Provide either a TemplateId or TemplateAlias along with the template model data.

Write write
Parameters
From, To, TemplateId, TemplateAlias, TemplateModel, Cc, Bcc, ReplyTo, Tag, TrackOpens, TrackLinks
Generic call
kosmo integrations:call postmark.postmark_send_template '{"From":"example_From","To":"example_To","TemplateId":1,"TemplateAlias":"example_TemplateAlias","TemplateModel":"example_TemplateModel","Cc":"example_Cc","Bcc":"example_Bcc","ReplyTo":"example_ReplyTo"}' --json
Shortcut
kosmo integrations:postmark postmark_send_template '{"From":"example_From","To":"example_To","TemplateId":1,"TemplateAlias":"example_TemplateAlias","TemplateModel":"example_TemplateModel","Cc":"example_Cc","Bcc":"example_Bcc","ReplyTo":"example_ReplyTo"}' --json

postmark.postmark_get_delivery_stats

Get email delivery statistics for your Postmark server, including counts of sent, bounced, and spam complaints.

Read read
Parameters
none
Generic call
kosmo integrations:call postmark.postmark_get_delivery_stats '{}' --json
Shortcut
kosmo integrations:postmark postmark_get_delivery_stats '{}' --json

postmark.postmark_list_templates

List all email templates in Postmark. Supports pagination.

Read read
Parameters
count, offset
Generic call
kosmo integrations:call postmark.postmark_list_templates '{"count":1,"offset":1}' --json
Shortcut
kosmo integrations:postmark postmark_list_templates '{"count":1,"offset":1}' --json

postmark.postmark_get_template

Get details for a Postmark email template including subject, HTML body, and text body.

Read read
Parameters
template_id
Generic call
kosmo integrations:call postmark.postmark_get_template '{"template_id":"example_template_id"}' --json
Shortcut
kosmo integrations:postmark postmark_get_template '{"template_id":"example_template_id"}' --json

postmark.postmark_list_servers

List servers in the Postmark account using an account API token. Supports filtering by name and pagination.

Read read
Parameters
count, offset, name
Generic call
kosmo integrations:call postmark.postmark_list_servers '{"count":1,"offset":1,"name":"example_name"}' --json
Shortcut
kosmo integrations:postmark postmark_list_servers '{"count":1,"offset":1,"name":"example_name"}' --json

postmark.postmark_get_current_user

Get the current Postmark server info including name, settings, and delivery stats. Useful as a health check.

Read read
Parameters
none
Generic call
kosmo integrations:call postmark.postmark_get_current_user '{}' --json
Shortcut
kosmo integrations:postmark postmark_get_current_user '{}' --json

Function Schemas

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

postmark.postmark_list_messages 7 parameters
Schema command
kosmo integrations:schema postmark.postmark_list_messages --json
ParameterTypeRequiredDescription
count integer no Number of messages to return per page (default 100, max 500).
offset integer no Number of messages to skip for pagination.
recipient string no Filter by recipient email address.
fromemail string no Filter by sender email address.
subject string no Filter by email subject.
status string no Filter by status (queued, sent, bounced, etc.).
tag string no Filter by tag.
postmark.postmark_get_message 1 parameters
Schema command
kosmo integrations:schema postmark.postmark_get_message --json
ParameterTypeRequiredDescription
message_id string yes The Postmark message ID to look up.
postmark.postmark_send_email 9 parameters
Schema command
kosmo integrations:schema postmark.postmark_send_email --json
ParameterTypeRequiredDescription
To string yes Recipient email address.
From string yes Sender email address (must be a verified sender signature).
Subject string yes Email subject line.
TextBody string no Plain-text body of the email.
HtmlBody string no HTML body of the email.
Cc string no CC recipient(s), comma-separated.
Bcc string no BCC recipient(s), comma-separated.
Tag string no Tag for categorization and tracking.
ReplyTo string no Reply-To email address.
postmark.postmark_send_template 11 parameters
Schema command
kosmo integrations:schema postmark.postmark_send_template --json
ParameterTypeRequiredDescription
From string yes Sender email address (must be a verified sender signature). Example: "sender@example.com" or "Sender Name <sender@example.com>".
To string yes Recipient email address. Multiple recipients separated by commas.
TemplateId integer no The template ID to use. Use this or TemplateAlias.
TemplateAlias string no The template alias to use. Use this or TemplateId.
TemplateModel array no Key-value pairs to fill the template variables. Example: {"name": "John", "company": "Acme"}.
Cc string no CC recipients (comma-separated).
Bcc string no BCC recipients (comma-separated).
ReplyTo string no Reply-to email address.
Tag string no Tag for categorization and analytics.
TrackOpens boolean no Enable open tracking (default: server setting).
TrackLinks string no Link tracking mode: "None", "HtmlAndText", "HtmlOnly", "TextOnly".
postmark.postmark_get_delivery_stats 0 parameters
Schema command
kosmo integrations:schema postmark.postmark_get_delivery_stats --json
ParameterTypeRequiredDescription
No parameters.
postmark.postmark_list_templates 2 parameters
Schema command
kosmo integrations:schema postmark.postmark_list_templates --json
ParameterTypeRequiredDescription
count integer no Number of templates to return per page (default 100, max 500).
offset integer no Number of templates to skip for pagination.
postmark.postmark_get_template 1 parameters
Schema command
kosmo integrations:schema postmark.postmark_get_template --json
ParameterTypeRequiredDescription
template_id string yes The Postmark template ID to look up.
postmark.postmark_list_servers 3 parameters
Schema command
kosmo integrations:schema postmark.postmark_list_servers --json
ParameterTypeRequiredDescription
count integer no Number of servers to return per page (default 100, max 500).
offset integer no Number of servers to skip for pagination.
name string no Filter by server name.
postmark.postmark_get_current_user 0 parameters
Schema command
kosmo integrations:schema postmark.postmark_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.