KosmoKrator

productivity

EasyPost Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.easypost.*. Use lua_read_doc("integrations.easypost") 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 EasyPost workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.easypost.create_address({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("easypost"))' --json
kosmo integrations:lua --eval 'print(docs.read("easypost.create_address"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local easypost = app.integrations.easypost
local result = easypost.create_address({})

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.easypost, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.easypost.default.* or app.integrations.easypost.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need EasyPost, 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.

EasyPost

Namespace: easypost

Use EasyPost tools for shipping labels, address verification, parcels, customs, trackers, orders, batches, pickups, scan forms, refunds, insurance, carrier accounts, webhooks, events, reports, and API-key inspection.

EasyPost authenticates with HTTP Basic auth using the API key as the username and a blank password. Test and production keys both work against the same v2 API base URL.

Request Shape

Create/update tools wrap top-level fields in the documented EasyPost resource key when needed. For example:

easypost.addresses_create({
  street1 = "417 Montgomery St",
  city = "San Francisco",
  state = "CA",
  zip = "94104",
  country = "US"
})

is sent as { address = { ... } }.

If you need exact control, pass the wrapped key yourself in payload, for example { shipment = { ... } }.

Common Workflows

  • easypost_addresses_create and easypost_addresses_verify validate sender and recipient addresses.
  • easypost_shipments_create rates a shipment from to_address, from_address, and parcel.
  • easypost_shipments_buy buys a label with a selected rate.
  • easypost_trackers_create registers tracking for labels not purchased through EasyPost.
  • easypost_batches_create, easypost_batches_buy, and easypost_batches_scan_form handle bulk label workflows.
  • easypost_pickups_create and easypost_pickups_buy schedule pickups.
  • easypost_refunds_create bulk-requests carrier refunds by tracking code.
  • easypost_reports_create accepts report_type, such as shipment.

Response Shape

JSON responses are returned as { status = 200, data = { ... } }. Empty successful responses return { status = 204, success = true }.

Raw API Tools

Use easypost_api_get, easypost_api_post, easypost_api_put, easypost_api_patch, and easypost_api_delete only for supported EasyPost paths not yet represented by a named tool. Raw paths must be relative, for example /shipments; absolute URLs are rejected.

Raw agent markdown
# EasyPost

Namespace: `easypost`

Use EasyPost tools for shipping labels, address verification, parcels, customs,
trackers, orders, batches, pickups, scan forms, refunds, insurance, carrier
accounts, webhooks, events, reports, and API-key inspection.

EasyPost authenticates with HTTP Basic auth using the API key as the username
and a blank password. Test and production keys both work against the same v2
API base URL.

## Request Shape

Create/update tools wrap top-level fields in the documented EasyPost resource
key when needed. For example:

```lua
easypost.addresses_create({
  street1 = "417 Montgomery St",
  city = "San Francisco",
  state = "CA",
  zip = "94104",
  country = "US"
})
```

is sent as `{ address = { ... } }`.

If you need exact control, pass the wrapped key yourself in `payload`, for
example `{ shipment = { ... } }`.

## Common Workflows

- `easypost_addresses_create` and `easypost_addresses_verify` validate sender
  and recipient addresses.
- `easypost_shipments_create` rates a shipment from `to_address`,
  `from_address`, and `parcel`.
- `easypost_shipments_buy` buys a label with a selected rate.
- `easypost_trackers_create` registers tracking for labels not purchased
  through EasyPost.
- `easypost_batches_create`, `easypost_batches_buy`, and
  `easypost_batches_scan_form` handle bulk label workflows.
- `easypost_pickups_create` and `easypost_pickups_buy` schedule pickups.
- `easypost_refunds_create` bulk-requests carrier refunds by tracking code.
- `easypost_reports_create` accepts `report_type`, such as `shipment`.

## Response Shape

JSON responses are returned as `{ status = 200, data = { ... } }`. Empty
successful responses return `{ status = 204, success = true }`.

## Raw API Tools

Use `easypost_api_get`, `easypost_api_post`, `easypost_api_put`,
`easypost_api_patch`, and `easypost_api_delete` only for supported EasyPost
paths not yet represented by a named tool. Raw paths must be relative, for
example `/shipments`; absolute URLs are rejected.
Metadata-derived Lua example
local result = app.integrations.easypost.create_address({})
print(result)

Functions

create_address Write

Create an EasyPost address.

Lua path
app.integrations.easypost.create_address
Full name
easypost.easypost_addresses_create
ParameterTypeRequiredDescription
No parameters.
get_address Read

Retrieve an EasyPost address.

Lua path
app.integrations.easypost.get_address
Full name
easypost.easypost_addresses_get
ParameterTypeRequiredDescription
No parameters.
verify_address Write

Verify an address by ID.

Lua path
app.integrations.easypost.verify_address
Full name
easypost.easypost_addresses_verify
ParameterTypeRequiredDescription
No parameters.
create_parcel Write

Create an EasyPost parcel.

Lua path
app.integrations.easypost.create_parcel
Full name
easypost.easypost_parcels_create
ParameterTypeRequiredDescription
No parameters.
get_parcel Read

Retrieve an EasyPost parcel.

Lua path
app.integrations.easypost.get_parcel
Full name
easypost.easypost_parcels_get
ParameterTypeRequiredDescription
No parameters.
create_customs_item Write

Create a customs item.

Lua path
app.integrations.easypost.create_customs_item
Full name
easypost.easypost_customs_items_create
ParameterTypeRequiredDescription
No parameters.
get_customs_item Read

Retrieve a customs item.

Lua path
app.integrations.easypost.get_customs_item
Full name
easypost.easypost_customs_items_get
ParameterTypeRequiredDescription
No parameters.
create_customs_info Write

Create customs info for international shipments.

Lua path
app.integrations.easypost.create_customs_info
Full name
easypost.easypost_customs_infos_create
ParameterTypeRequiredDescription
No parameters.
get_customs_info Read

Retrieve customs info.

Lua path
app.integrations.easypost.get_customs_info
Full name
easypost.easypost_customs_infos_get
ParameterTypeRequiredDescription
No parameters.
create_shipment Write

Create a shipment and retrieve rates.

Lua path
app.integrations.easypost.create_shipment
Full name
easypost.easypost_shipments_create
ParameterTypeRequiredDescription
No parameters.
buy_shipment Write

Buy a shipment label using a selected rate.

Lua path
app.integrations.easypost.buy_shipment
Full name
easypost.easypost_shipments_buy
ParameterTypeRequiredDescription
No parameters.
list_shipments Read

List shipments with pagination filters.

Lua path
app.integrations.easypost.list_shipments
Full name
easypost.easypost_shipments_list
ParameterTypeRequiredDescription
No parameters.
get_shipment Read

Retrieve a shipment.

Lua path
app.integrations.easypost.get_shipment
Full name
easypost.easypost_shipments_get
ParameterTypeRequiredDescription
No parameters.
get_shipment_label Read

Retrieve or regenerate a shipment label.

Lua path
app.integrations.easypost.get_shipment_label
Full name
easypost.easypost_shipments_label
ParameterTypeRequiredDescription
No parameters.
insure_shipment Write

Add insurance to a purchased shipment.

Lua path
app.integrations.easypost.insure_shipment
Full name
easypost.easypost_shipments_insure
ParameterTypeRequiredDescription
No parameters.
refund_shipment Write

Request a refund for one shipment.

Lua path
app.integrations.easypost.refund_shipment
Full name
easypost.easypost_shipments_refund
ParameterTypeRequiredDescription
No parameters.
create_tracker Write

Create a tracker for a tracking code.

Lua path
app.integrations.easypost.create_tracker
Full name
easypost.easypost_trackers_create
ParameterTypeRequiredDescription
No parameters.
list_trackers Read

List trackers with pagination filters.

Lua path
app.integrations.easypost.list_trackers
Full name
easypost.easypost_trackers_list
ParameterTypeRequiredDescription
No parameters.
get_tracker Read

Retrieve a tracker.

Lua path
app.integrations.easypost.get_tracker
Full name
easypost.easypost_trackers_get
ParameterTypeRequiredDescription
No parameters.
create_order Write

Create a multi-parcel order.

Lua path
app.integrations.easypost.create_order
Full name
easypost.easypost_orders_create
ParameterTypeRequiredDescription
No parameters.
buy_order Write

Buy labels for an order.

Lua path
app.integrations.easypost.buy_order
Full name
easypost.easypost_orders_buy
ParameterTypeRequiredDescription
No parameters.
get_order Read

Retrieve an order.

Lua path
app.integrations.easypost.get_order
Full name
easypost.easypost_orders_get
ParameterTypeRequiredDescription
No parameters.
create_batch Write

Create a batch of shipments.

Lua path
app.integrations.easypost.create_batch
Full name
easypost.easypost_batches_create
ParameterTypeRequiredDescription
No parameters.
add_batch_shipments Write

Add shipments to a batch.

Lua path
app.integrations.easypost.add_batch_shipments
Full name
easypost.easypost_batches_add_shipments
ParameterTypeRequiredDescription
No parameters.
remove_batch_shipments Write

Remove shipments from a batch.

Lua path
app.integrations.easypost.remove_batch_shipments
Full name
easypost.easypost_batches_remove_shipments
ParameterTypeRequiredDescription
No parameters.
buy_batch Write

Buy all buyable shipments in a batch.

Lua path
app.integrations.easypost.buy_batch
Full name
easypost.easypost_batches_buy
ParameterTypeRequiredDescription
No parameters.
generate_batch_label Write

Generate consolidated labels for a batch.

Lua path
app.integrations.easypost.generate_batch_label
Full name
easypost.easypost_batches_label
ParameterTypeRequiredDescription
No parameters.
create_batch_scan_form Write

Create a scan form for a batch.

Lua path
app.integrations.easypost.create_batch_scan_form
Full name
easypost.easypost_batches_scan_form
ParameterTypeRequiredDescription
No parameters.
list_batches Read

List batches with pagination filters.

Lua path
app.integrations.easypost.list_batches
Full name
easypost.easypost_batches_list
ParameterTypeRequiredDescription
No parameters.
get_batch Read

Retrieve a batch.

Lua path
app.integrations.easypost.get_batch
Full name
easypost.easypost_batches_get
ParameterTypeRequiredDescription
No parameters.
create_pickup Write

Create a carrier pickup.

Lua path
app.integrations.easypost.create_pickup
Full name
easypost.easypost_pickups_create
ParameterTypeRequiredDescription
No parameters.
buy_pickup Write

Purchase a pickup rate.

Lua path
app.integrations.easypost.buy_pickup
Full name
easypost.easypost_pickups_buy
ParameterTypeRequiredDescription
No parameters.
cancel_pickup Write

Cancel a scheduled pickup.

Lua path
app.integrations.easypost.cancel_pickup
Full name
easypost.easypost_pickups_cancel
ParameterTypeRequiredDescription
No parameters.
list_pickups Read

List pickups with pagination filters.

Lua path
app.integrations.easypost.list_pickups
Full name
easypost.easypost_pickups_list
ParameterTypeRequiredDescription
No parameters.
get_pickup Read

Retrieve a pickup.

Lua path
app.integrations.easypost.get_pickup
Full name
easypost.easypost_pickups_get
ParameterTypeRequiredDescription
No parameters.
create_scan_form Write

Create a scan form.

Lua path
app.integrations.easypost.create_scan_form
Full name
easypost.easypost_scan_forms_create
ParameterTypeRequiredDescription
No parameters.
list_scan_forms Read

List scan forms with pagination filters.

Lua path
app.integrations.easypost.list_scan_forms
Full name
easypost.easypost_scan_forms_list
ParameterTypeRequiredDescription
No parameters.
get_scan_form Read

Retrieve a scan form.

Lua path
app.integrations.easypost.get_scan_form
Full name
easypost.easypost_scan_forms_get
ParameterTypeRequiredDescription
No parameters.
create_refunds Write

Bulk request refunds by carrier and tracking codes.

Lua path
app.integrations.easypost.create_refunds
Full name
easypost.easypost_refunds_create
ParameterTypeRequiredDescription
No parameters.
list_refunds Read

List refunds with pagination filters.

Lua path
app.integrations.easypost.list_refunds
Full name
easypost.easypost_refunds_list
ParameterTypeRequiredDescription
No parameters.
get_refund Read

Retrieve a refund.

Lua path
app.integrations.easypost.get_refund
Full name
easypost.easypost_refunds_get
ParameterTypeRequiredDescription
No parameters.
create_insurance Write

Create standalone shipment insurance.

Lua path
app.integrations.easypost.create_insurance
Full name
easypost.easypost_insurances_create
ParameterTypeRequiredDescription
No parameters.
list_insurances Read

List insurance records with pagination filters.

Lua path
app.integrations.easypost.list_insurances
Full name
easypost.easypost_insurances_list
ParameterTypeRequiredDescription
No parameters.
get_insurance Read

Retrieve an insurance record.

Lua path
app.integrations.easypost.get_insurance
Full name
easypost.easypost_insurances_get
ParameterTypeRequiredDescription
No parameters.
refund_insurance Write

Refund an insurance record.

Lua path
app.integrations.easypost.refund_insurance
Full name
easypost.easypost_insurances_refund
ParameterTypeRequiredDescription
No parameters.
list_carrier_accounts Read

List carrier accounts.

Lua path
app.integrations.easypost.list_carrier_accounts
Full name
easypost.easypost_carrier_accounts_list
ParameterTypeRequiredDescription
No parameters.
get_carrier_account Read

Retrieve a carrier account.

Lua path
app.integrations.easypost.get_carrier_account
Full name
easypost.easypost_carrier_accounts_get
ParameterTypeRequiredDescription
No parameters.
create_carrier_account Write

Create a carrier account.

Lua path
app.integrations.easypost.create_carrier_account
Full name
easypost.easypost_carrier_accounts_create
ParameterTypeRequiredDescription
No parameters.
update_carrier_account Write

Update a carrier account.

Lua path
app.integrations.easypost.update_carrier_account
Full name
easypost.easypost_carrier_accounts_update
ParameterTypeRequiredDescription
No parameters.
delete_carrier_account Write

Delete a carrier account.

Lua path
app.integrations.easypost.delete_carrier_account
Full name
easypost.easypost_carrier_accounts_delete
ParameterTypeRequiredDescription
No parameters.
list_carrier_types Read

List available carrier account types.

Lua path
app.integrations.easypost.list_carrier_types
Full name
easypost.easypost_carrier_types_list
ParameterTypeRequiredDescription
No parameters.
create_webhook Write

Create a webhook endpoint.

Lua path
app.integrations.easypost.create_webhook
Full name
easypost.easypost_webhooks_create
ParameterTypeRequiredDescription
No parameters.
list_webhooks Read

List webhook endpoints.

Lua path
app.integrations.easypost.list_webhooks
Full name
easypost.easypost_webhooks_list
ParameterTypeRequiredDescription
No parameters.
get_webhook Read

Retrieve a webhook endpoint.

Lua path
app.integrations.easypost.get_webhook
Full name
easypost.easypost_webhooks_get
ParameterTypeRequiredDescription
No parameters.
update_webhook Write

Update a webhook endpoint.

Lua path
app.integrations.easypost.update_webhook
Full name
easypost.easypost_webhooks_update
ParameterTypeRequiredDescription
No parameters.
delete_webhook Write

Delete a webhook endpoint.

Lua path
app.integrations.easypost.delete_webhook
Full name
easypost.easypost_webhooks_delete
ParameterTypeRequiredDescription
No parameters.
list_events Read

List webhook events.

Lua path
app.integrations.easypost.list_events
Full name
easypost.easypost_events_list
ParameterTypeRequiredDescription
No parameters.
get_event Read

Retrieve a webhook event.

Lua path
app.integrations.easypost.get_event
Full name
easypost.easypost_events_get
ParameterTypeRequiredDescription
No parameters.
create_report Write

Create a report by report type.

Lua path
app.integrations.easypost.create_report
Full name
easypost.easypost_reports_create
ParameterTypeRequiredDescription
No parameters.
list_reports Read

List reports by report type.

Lua path
app.integrations.easypost.list_reports
Full name
easypost.easypost_reports_list
ParameterTypeRequiredDescription
No parameters.
get_report Read

Retrieve one report by type.

Lua path
app.integrations.easypost.get_report
Full name
easypost.easypost_reports_get
ParameterTypeRequiredDescription
No parameters.
list_api_keys Read

List EasyPost API keys visible to the credential.

Lua path
app.integrations.easypost.list_api_keys
Full name
easypost.easypost_api_keys_list
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a safe relative EasyPost API GET path.

Lua path
app.integrations.easypost.api_get
Full name
easypost.easypost_api_get
ParameterTypeRequiredDescription
No parameters.
api Write

Call a safe relative EasyPost API POST path.

Lua path
app.integrations.easypost.api
Full name
easypost.easypost_api_post
ParameterTypeRequiredDescription
No parameters.
api_put Write

Call a safe relative EasyPost API PUT path.

Lua path
app.integrations.easypost.api_put
Full name
easypost.easypost_api_put
ParameterTypeRequiredDescription
No parameters.
api_patch Write

Call a safe relative EasyPost API PATCH path.

Lua path
app.integrations.easypost.api_patch
Full name
easypost.easypost_api_patch
ParameterTypeRequiredDescription
No parameters.
api_delete Write

Call a safe relative EasyPost API DELETE path.

Lua path
app.integrations.easypost.api_delete
Full name
easypost.easypost_api_delete
ParameterTypeRequiredDescription
No parameters.