KosmoKrator

productivity

Postman Lua API for KosmoKrator Agents

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

Lua Namespace

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

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

Workflow file

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

workflow.lua
local postman = app.integrations.postman
local result = postman.get_authenticated_user({})

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

MCP-only Lua

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

Postman

Namespace: postman

Use Postman tools to manage workspaces, collections, environments, global variables, APIs/specifications, API versions and schemas, mock servers, monitors, collection webhooks, users, groups, workspace roles, and billing metadata.

Postman authenticates with an API key in the X-Api-Key header.

Some Enterprise and Professional endpoints are plan-gated by Postman. If a tool receives a 403 or 404, treat it as an availability signal rather than assuming the resource does not exist.

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

Use postman_api_get, postman_api_post, postman_api_put, postman_api_patch, and postman_api_delete for plan-specific Postman API paths not represented by a named tool, such as governance, audit logs, tags, SCIM, or secret-scanner endpoints. Raw paths must be relative, for example /collections; absolute URLs are rejected.

Raw agent markdown
# Postman

Namespace: `postman`

Use Postman tools to manage workspaces, collections, environments, global variables, APIs/specifications, API versions and schemas, mock servers, monitors, collection webhooks, users, groups, workspace roles, and billing metadata.

Postman authenticates with an API key in the `X-Api-Key` header.

Some Enterprise and Professional endpoints are plan-gated by Postman. If a tool receives a 403 or 404, treat it as an availability signal rather than assuming the resource does not exist.

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

Use `postman_api_get`, `postman_api_post`, `postman_api_put`, `postman_api_patch`, and `postman_api_delete` for plan-specific Postman API paths not represented by a named tool, such as governance, audit logs, tags, SCIM, or secret-scanner endpoints. Raw paths must be relative, for example `/collections`; absolute URLs are rejected.
Metadata-derived Lua example
local result = app.integrations.postman.get_authenticated_user({})
print(result)

Functions

get_authenticated_user Read

Get the API key owner and usage metadata.

Lua path
app.integrations.postman.get_authenticated_user
Full name
postman.postman_me_get
ParameterTypeRequiredDescription
No parameters.
list_workspaces Read

List accessible Postman workspaces.

Lua path
app.integrations.postman.list_workspaces
Full name
postman.postman_workspaces_list
ParameterTypeRequiredDescription
No parameters.
create_workspace Write

Create a Postman workspace.

Lua path
app.integrations.postman.create_workspace
Full name
postman.postman_workspaces_create
ParameterTypeRequiredDescription
No parameters.
get_workspace Read

Retrieve a workspace.

Lua path
app.integrations.postman.get_workspace
Full name
postman.postman_workspaces_get
ParameterTypeRequiredDescription
No parameters.
update_workspace Write

Update a workspace.

Lua path
app.integrations.postman.update_workspace
Full name
postman.postman_workspaces_update
ParameterTypeRequiredDescription
No parameters.
delete_workspace Write

Delete a workspace.

Lua path
app.integrations.postman.delete_workspace
Full name
postman.postman_workspaces_delete
ParameterTypeRequiredDescription
No parameters.
list_collections Read

List accessible Postman collections.

Lua path
app.integrations.postman.list_collections
Full name
postman.postman_collections_list
ParameterTypeRequiredDescription
No parameters.
create_collection Write

Create a Postman collection.

Lua path
app.integrations.postman.create_collection
Full name
postman.postman_collections_create
ParameterTypeRequiredDescription
No parameters.
get_collection Read

Retrieve a collection.

Lua path
app.integrations.postman.get_collection
Full name
postman.postman_collections_get
ParameterTypeRequiredDescription
No parameters.
update_collection Write

Replace a collection.

Lua path
app.integrations.postman.update_collection
Full name
postman.postman_collections_update
ParameterTypeRequiredDescription
No parameters.
delete_collection Write

Delete a collection.

Lua path
app.integrations.postman.delete_collection
Full name
postman.postman_collections_delete
ParameterTypeRequiredDescription
No parameters.
list_collection_forks Read

List forks for a collection.

Lua path
app.integrations.postman.list_collection_forks
Full name
postman.postman_collection_forks_list
ParameterTypeRequiredDescription
No parameters.
fork_collection Write

Create a fork of a collection.

Lua path
app.integrations.postman.fork_collection
Full name
postman.postman_collection_fork_create
ParameterTypeRequiredDescription
No parameters.
list_collection_pull_requests Read

List pull requests for a collection.

Lua path
app.integrations.postman.list_collection_pull_requests
Full name
postman.postman_collection_pull_requests_list
ParameterTypeRequiredDescription
No parameters.
list_environments Read

List accessible environments.

Lua path
app.integrations.postman.list_environments
Full name
postman.postman_environments_list
ParameterTypeRequiredDescription
No parameters.
create_environment Write

Create an environment.

Lua path
app.integrations.postman.create_environment
Full name
postman.postman_environments_create
ParameterTypeRequiredDescription
No parameters.
get_environment Read

Retrieve an environment.

Lua path
app.integrations.postman.get_environment
Full name
postman.postman_environments_get
ParameterTypeRequiredDescription
No parameters.
update_environment Write

Replace an environment.

Lua path
app.integrations.postman.update_environment
Full name
postman.postman_environments_update
ParameterTypeRequiredDescription
No parameters.
delete_environment Write

Delete an environment.

Lua path
app.integrations.postman.delete_environment
Full name
postman.postman_environments_delete
ParameterTypeRequiredDescription
No parameters.
get_globals Read

Retrieve global variables.

Lua path
app.integrations.postman.get_globals
Full name
postman.postman_globals_get
ParameterTypeRequiredDescription
No parameters.
update_globals Write

Update global variables.

Lua path
app.integrations.postman.update_globals
Full name
postman.postman_globals_update
ParameterTypeRequiredDescription
No parameters.
list_apis Read

List APIs or specifications.

Lua path
app.integrations.postman.list_apis
Full name
postman.postman_apis_list
ParameterTypeRequiredDescription
No parameters.
create_api Write

Create an API record.

Lua path
app.integrations.postman.create_api
Full name
postman.postman_apis_create
ParameterTypeRequiredDescription
No parameters.
get_api Read

Retrieve an API record.

Lua path
app.integrations.postman.get_api
Full name
postman.postman_apis_get
ParameterTypeRequiredDescription
No parameters.
update_api Write

Update an API record.

Lua path
app.integrations.postman.update_api
Full name
postman.postman_apis_update
ParameterTypeRequiredDescription
No parameters.
delete_api Write

Delete an API record.

Lua path
app.integrations.postman.delete_api
Full name
postman.postman_apis_delete
ParameterTypeRequiredDescription
No parameters.
list_api_versions Read

List versions for an API.

Lua path
app.integrations.postman.list_api_versions
Full name
postman.postman_api_versions_list
ParameterTypeRequiredDescription
No parameters.
create_api_version Write

Create an API version.

Lua path
app.integrations.postman.create_api_version
Full name
postman.postman_api_versions_create
ParameterTypeRequiredDescription
No parameters.
get_api_version Read

Retrieve an API version.

Lua path
app.integrations.postman.get_api_version
Full name
postman.postman_api_versions_get
ParameterTypeRequiredDescription
No parameters.
update_api_version Write

Update an API version.

Lua path
app.integrations.postman.update_api_version
Full name
postman.postman_api_versions_update
ParameterTypeRequiredDescription
No parameters.
delete_api_version Write

Delete an API version.

Lua path
app.integrations.postman.delete_api_version
Full name
postman.postman_api_versions_delete
ParameterTypeRequiredDescription
No parameters.
list_api_schemas Read

List schemas for an API version.

Lua path
app.integrations.postman.list_api_schemas
Full name
postman.postman_api_schemas_list
ParameterTypeRequiredDescription
No parameters.
create_api_schema Write

Create a schema for an API version.

Lua path
app.integrations.postman.create_api_schema
Full name
postman.postman_api_schemas_create
ParameterTypeRequiredDescription
No parameters.
get_api_schema Read

Retrieve an API schema.

Lua path
app.integrations.postman.get_api_schema
Full name
postman.postman_api_schemas_get
ParameterTypeRequiredDescription
No parameters.
update_api_schema Write

Update an API schema.

Lua path
app.integrations.postman.update_api_schema
Full name
postman.postman_api_schemas_update
ParameterTypeRequiredDescription
No parameters.
delete_api_schema Write

Delete an API schema.

Lua path
app.integrations.postman.delete_api_schema
Full name
postman.postman_api_schemas_delete
ParameterTypeRequiredDescription
No parameters.
list_mock_servers Read

List mock servers.

Lua path
app.integrations.postman.list_mock_servers
Full name
postman.postman_mocks_list
ParameterTypeRequiredDescription
No parameters.
create_mock_server Write

Create a mock server.

Lua path
app.integrations.postman.create_mock_server
Full name
postman.postman_mocks_create
ParameterTypeRequiredDescription
No parameters.
get_mock_server Read

Retrieve a mock server.

Lua path
app.integrations.postman.get_mock_server
Full name
postman.postman_mocks_get
ParameterTypeRequiredDescription
No parameters.
update_mock_server Write

Update a mock server.

Lua path
app.integrations.postman.update_mock_server
Full name
postman.postman_mocks_update
ParameterTypeRequiredDescription
No parameters.
delete_mock_server Write

Delete a mock server.

Lua path
app.integrations.postman.delete_mock_server
Full name
postman.postman_mocks_delete
ParameterTypeRequiredDescription
No parameters.
list_mock_call_logs Read

List calls received by a mock server.

Lua path
app.integrations.postman.list_mock_call_logs
Full name
postman.postman_mocks_call_logs_list
ParameterTypeRequiredDescription
No parameters.
list_monitors Read

List monitors.

Lua path
app.integrations.postman.list_monitors
Full name
postman.postman_monitors_list
ParameterTypeRequiredDescription
No parameters.
create_monitor Write

Create a monitor.

Lua path
app.integrations.postman.create_monitor
Full name
postman.postman_monitors_create
ParameterTypeRequiredDescription
No parameters.
get_monitor Read

Retrieve a monitor.

Lua path
app.integrations.postman.get_monitor
Full name
postman.postman_monitors_get
ParameterTypeRequiredDescription
No parameters.
update_monitor Write

Update a monitor.

Lua path
app.integrations.postman.update_monitor
Full name
postman.postman_monitors_update
ParameterTypeRequiredDescription
No parameters.
delete_monitor Write

Delete a monitor.

Lua path
app.integrations.postman.delete_monitor
Full name
postman.postman_monitors_delete
ParameterTypeRequiredDescription
No parameters.
run_monitor Write

Run a monitor immediately.

Lua path
app.integrations.postman.run_monitor
Full name
postman.postman_monitors_run
ParameterTypeRequiredDescription
No parameters.
create_webhook Write

Create a collection webhook.

Lua path
app.integrations.postman.create_webhook
Full name
postman.postman_webhooks_create
ParameterTypeRequiredDescription
No parameters.
get_webhook Read

Retrieve a webhook.

Lua path
app.integrations.postman.get_webhook
Full name
postman.postman_webhooks_get
ParameterTypeRequiredDescription
No parameters.
delete_webhook Write

Delete a webhook.

Lua path
app.integrations.postman.delete_webhook
Full name
postman.postman_webhooks_delete
ParameterTypeRequiredDescription
No parameters.
list_users Read

List team users when the plan permits it.

Lua path
app.integrations.postman.list_users
Full name
postman.postman_users_list
ParameterTypeRequiredDescription
No parameters.
get_user Read

Retrieve a team user.

Lua path
app.integrations.postman.get_user
Full name
postman.postman_users_get
ParameterTypeRequiredDescription
No parameters.
list_user_groups Read

List team user groups.

Lua path
app.integrations.postman.list_user_groups
Full name
postman.postman_groups_list
ParameterTypeRequiredDescription
No parameters.
get_user_group Read

Retrieve a user group.

Lua path
app.integrations.postman.get_user_group
Full name
postman.postman_groups_get
ParameterTypeRequiredDescription
No parameters.
list_workspace_roles Read

List roles for a workspace.

Lua path
app.integrations.postman.list_workspace_roles
Full name
postman.postman_workspace_roles_list
ParameterTypeRequiredDescription
No parameters.
update_workspace_roles Write

Update workspace role assignments.

Lua path
app.integrations.postman.update_workspace_roles
Full name
postman.postman_workspace_roles_update
ParameterTypeRequiredDescription
No parameters.
get_billing Read

Get billing information when the plan permits it.

Lua path
app.integrations.postman.get_billing
Full name
postman.postman_billing_get
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a safe relative Postman API GET path.

Lua path
app.integrations.postman.api_get
Full name
postman.postman_api_get
ParameterTypeRequiredDescription
No parameters.
api Write

Call a safe relative Postman API POST path.

Lua path
app.integrations.postman.api
Full name
postman.postman_api_post
ParameterTypeRequiredDescription
No parameters.
api_put Write

Call a safe relative Postman API PUT path.

Lua path
app.integrations.postman.api_put
Full name
postman.postman_api_put
ParameterTypeRequiredDescription
No parameters.
api_patch Write

Call a safe relative Postman API PATCH path.

Lua path
app.integrations.postman.api_patch
Full name
postman.postman_api_patch
ParameterTypeRequiredDescription
No parameters.
api_delete Write

Call a safe relative Postman API DELETE path.

Lua path
app.integrations.postman.api_delete
Full name
postman.postman_api_delete
ParameterTypeRequiredDescription
No parameters.