KosmoKrator

productivity

SignNow Lua API for KosmoKrator Agents

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

Lua Namespace

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

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.signnow.list_documents({page = 1, per_page = 1}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("signnow"))' --json
kosmo integrations:lua --eval 'print(docs.read("signnow.list_documents"))' --json

Workflow file

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

workflow.lua
local signnow = app.integrations.signnow
local result = signnow.list_documents({page = 1, per_page = 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.signnow, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.signnow.default.* or app.integrations.signnow.work.* when you configured named credential accounts.

MCP-only Lua

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

SignNow Lua API Reference

Namespace: app.integrations.signnow

Use this integration to manage SignNow documents, templates, signing invites, downloads, history, and relative API calls. Returned values are parsed JSON when the API returns JSON. Binary or text download responses are returned as { body = "..." }.

Documents

FunctionPurpose
list_documents({ page?, per_page? })List documents from /user/documentsv2.
get_document({ document_id })Get full document details.
create_document({ file_path, file_name? })Upload a file and create a document.
update_document({ document_id, payload })Update fields, text tags, checks, metadata, or other official document payload fields.
delete_document({ document_id })Delete a document.
download_document({ document_id, type? })Download a document.
get_document_download_link({ document_id, type? })Get a temporary download link.
get_document_history({ document_id })Get document event history.
merge_documents({ document_ids, name?, payload? })Merge multiple documents into one document.

Example:

local docs = app.integrations.signnow.list_documents({ page = 1, per_page = 20 })

for _, doc in ipairs(docs.documents or {}) do
  print(doc.id .. " " .. (doc.document_name or doc.name or "Untitled"))
end

Templates

FunctionPurpose
list_templates({})List available templates.
create_template({ document_id, template_name?, remove_original_document? })Create a template from a document.
duplicate_template({ template_id, document_name? })Copy a template into a new document.
delete_template({ template_id })Delete a template.

Invites

FunctionPurpose
send_invite({ document_id, to, from, subject, message?, payload? })Send a simple signing invite.
send_freeform_invite({ document_id, payload })Send a full official invite payload for advanced routing, roles, reminders, or multiple signers.
cancel_field_invite({ document_id })Cancel active field invites for a document.
cancel_freeform_invite({ invite_id })Cancel a free-form invite by invite ID.

Use send_invite for simple one-recipient emails. Use send_freeform_invite when you need official SignNow fields that are too large or workflow-specific to model as first-class parameters.

Generic API Helpers

FunctionPurpose
api_get({ path, params? })Send GET to a relative SignNow API path.
api_post({ path, payload? })Send POST to a relative SignNow API path.
api_put({ path, payload? })Send PUT to a relative SignNow API path.
api_delete({ path, payload? })Send DELETE to a relative SignNow API path.

Generic helpers reject absolute URLs. Use paths such as /document, /document/{id}/invite, or /template/{id}/copy so host credentials and base URL handling stay centralized.

Current User

get_current_user({}) fetches the authenticated SignNow user from /user. Use it to confirm which account the integration is connected to.

Multi-Account Usage

All functions work under account-specific namespaces:

app.integrations.signnow.list_documents({ page = 1 })
app.integrations.signnow.default.list_documents({ page = 1 })
app.integrations.signnow.legal.list_documents({})
Raw agent markdown
# SignNow Lua API Reference

Namespace: `app.integrations.signnow`

Use this integration to manage SignNow documents, templates, signing invites,
downloads, history, and relative API calls. Returned values are parsed JSON when
the API returns JSON. Binary or text download responses are returned as
`{ body = "..." }`.

## Documents

| Function | Purpose |
|----------|---------|
| `list_documents({ page?, per_page? })` | List documents from `/user/documentsv2`. |
| `get_document({ document_id })` | Get full document details. |
| `create_document({ file_path, file_name? })` | Upload a file and create a document. |
| `update_document({ document_id, payload })` | Update fields, text tags, checks, metadata, or other official document payload fields. |
| `delete_document({ document_id })` | Delete a document. |
| `download_document({ document_id, type? })` | Download a document. |
| `get_document_download_link({ document_id, type? })` | Get a temporary download link. |
| `get_document_history({ document_id })` | Get document event history. |
| `merge_documents({ document_ids, name?, payload? })` | Merge multiple documents into one document. |

Example:

```lua
local docs = app.integrations.signnow.list_documents({ page = 1, per_page = 20 })

for _, doc in ipairs(docs.documents or {}) do
  print(doc.id .. " " .. (doc.document_name or doc.name or "Untitled"))
end
```

## Templates

| Function | Purpose |
|----------|---------|
| `list_templates({})` | List available templates. |
| `create_template({ document_id, template_name?, remove_original_document? })` | Create a template from a document. |
| `duplicate_template({ template_id, document_name? })` | Copy a template into a new document. |
| `delete_template({ template_id })` | Delete a template. |

## Invites

| Function | Purpose |
|----------|---------|
| `send_invite({ document_id, to, from, subject, message?, payload? })` | Send a simple signing invite. |
| `send_freeform_invite({ document_id, payload })` | Send a full official invite payload for advanced routing, roles, reminders, or multiple signers. |
| `cancel_field_invite({ document_id })` | Cancel active field invites for a document. |
| `cancel_freeform_invite({ invite_id })` | Cancel a free-form invite by invite ID. |

Use `send_invite` for simple one-recipient emails. Use
`send_freeform_invite` when you need official SignNow fields that are too large
or workflow-specific to model as first-class parameters.

## Generic API Helpers

| Function | Purpose |
|----------|---------|
| `api_get({ path, params? })` | Send GET to a relative SignNow API path. |
| `api_post({ path, payload? })` | Send POST to a relative SignNow API path. |
| `api_put({ path, payload? })` | Send PUT to a relative SignNow API path. |
| `api_delete({ path, payload? })` | Send DELETE to a relative SignNow API path. |

Generic helpers reject absolute URLs. Use paths such as `/document`,
`/document/{id}/invite`, or `/template/{id}/copy` so host credentials and base
URL handling stay centralized.

## Current User

`get_current_user({})` fetches the authenticated SignNow user from `/user`.
Use it to confirm which account the integration is connected to.

## Multi-Account Usage

All functions work under account-specific namespaces:

```lua
app.integrations.signnow.list_documents({ page = 1 })
app.integrations.signnow.default.list_documents({ page = 1 })
app.integrations.signnow.legal.list_documents({})
```
Metadata-derived Lua example
local result = app.integrations.signnow.list_documents({page = 1, per_page = 1})
print(result)

Functions

list_documents Read

List documents accessible to the authenticated SignNow user. Returns document IDs, names, and status. Supports pagination with page and per_page parameters.

Lua path
app.integrations.signnow.list_documents
Full name
signnow.signnow_list_documents
ParameterTypeRequiredDescription
page integer no Page number for pagination (1-based). Default: 1.
per_page integer no Number of documents per page. Default: 20.
get_document Read

Get full details for a specific SignNow document by ID, including fields, signers, and document status.

Lua path
app.integrations.signnow.get_document
Full name
signnow.signnow_get_document
ParameterTypeRequiredDescription
document_id string yes The unique document identifier.
create_document Write

Upload a file to SignNow to create a new document. The file must be a PDF. Returns the new document ID and details.

Lua path
app.integrations.signnow.create_document
Full name
signnow.signnow_create_document
ParameterTypeRequiredDescription
file_path string yes Absolute path to the PDF file to upload.
file_name string no Name for the uploaded file. Defaults to the basename of file_path.
update_document Write

Update a SignNow document with official document fields such as fields, texts, checks, or document metadata.

Lua path
app.integrations.signnow.update_document
Full name
signnow.signnow_update_document
ParameterTypeRequiredDescription
document_id string yes Document ID.
payload object yes Official document update payload.
delete_document Write

Delete a SignNow document by ID.

Lua path
app.integrations.signnow.delete_document
Full name
signnow.signnow_delete_document
ParameterTypeRequiredDescription
document_id string yes Document ID.
download_document Read

Download a SignNow document and return the response body when the API returns binary or text content.

Lua path
app.integrations.signnow.download_document
Full name
signnow.signnow_download_document
ParameterTypeRequiredDescription
document_id string yes Document ID.
type string no Optional download type accepted by SignNow.
get_document_history Read

Get event history for a SignNow document.

Lua path
app.integrations.signnow.get_document_history
Full name
signnow.signnow_get_document_history
ParameterTypeRequiredDescription
document_id string yes Document ID.
merge_documents Write

Merge multiple SignNow documents into a new document.

Lua path
app.integrations.signnow.merge_documents
Full name
signnow.signnow_merge_documents
ParameterTypeRequiredDescription
document_ids array yes Document IDs to merge.
name string no Merged document name.
payload object no Additional official merge fields.
list_templates Read

List document templates available in the authenticated SignNow account. Templates can be used to create new documents with pre-defined fields.

Lua path
app.integrations.signnow.list_templates
Full name
signnow.signnow_list_templates
ParameterTypeRequiredDescription
No parameters.
create_template Write

Create a SignNow template from an existing document.

Lua path
app.integrations.signnow.create_template
Full name
signnow.signnow_create_template
ParameterTypeRequiredDescription
document_id string yes Source document ID.
template_name string no Optional template name.
remove_original_document boolean no Remove the source document after creating the template.
duplicate_template Write

Duplicate a SignNow template into a new document.

Lua path
app.integrations.signnow.duplicate_template
Full name
signnow.signnow_duplicate_template
ParameterTypeRequiredDescription
template_id string yes Template ID.
document_name string no Optional name for the duplicated document.
delete_template Write

Delete a SignNow template by ID.

Lua path
app.integrations.signnow.delete_template
Full name
signnow.signnow_delete_template
ParameterTypeRequiredDescription
template_id string yes Template ID.
send_signing_invite Write

Send a signing invitation for a SignNow document. The recipient will receive an email with a link to review and sign the document.

Lua path
app.integrations.signnow.send_signing_invite
Full name
signnow.signnow_send_invite
ParameterTypeRequiredDescription
document_id string yes The unique document identifier to send an invite for.
to string yes Recipient email address for the signing invite.
from string yes Sender email address (must be the authenticated user email).
subject string yes Email subject line for the signing invitation.
message string no Optional custom message body for the invitation email.
payload object no Additional official invite fields.
send_freeform_invite Write

Send a SignNow invite using a full official payload for advanced recipient, role, routing, and reminder setups.

Lua path
app.integrations.signnow.send_freeform_invite
Full name
signnow.signnow_send_freeform_invite
ParameterTypeRequiredDescription
document_id string yes Document ID.
payload object yes Full official invite payload.
cancel_field_invite Write

Cancel active field invite signing sessions for a SignNow document.

Lua path
app.integrations.signnow.cancel_field_invite
Full name
signnow.signnow_cancel_field_invite
ParameterTypeRequiredDescription
document_id string yes Document ID.
cancel_freeform_invite Write

Cancel a SignNow free-form invite by invite ID.

Lua path
app.integrations.signnow.cancel_freeform_invite
Full name
signnow.signnow_cancel_freeform_invite
ParameterTypeRequiredDescription
invite_id string yes Invite ID.
get_current_user Read

Get the authenticated SignNow user profile, including name, email, and account details.

Lua path
app.integrations.signnow.get_current_user
Full name
signnow.signnow_get_current_user
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a relative SignNow API GET path, such as "/document". Absolute URLs are rejected.

Lua path
app.integrations.signnow.api_get
Full name
signnow.signnow_api_get
ParameterTypeRequiredDescription
path string yes Relative SignNow API path.
params object no Query parameters.
api_post Write

Call a relative SignNow API POST path. Absolute URLs are rejected.

Lua path
app.integrations.signnow.api_post
Full name
signnow.signnow_api_post
ParameterTypeRequiredDescription
path string yes Relative SignNow API path.
payload object no JSON body.
api_put Write

Call a relative SignNow API PUT path. Absolute URLs are rejected.

Lua path
app.integrations.signnow.api_put
Full name
signnow.signnow_api_put
ParameterTypeRequiredDescription
path string yes Relative SignNow API path.
payload object no JSON body.
api_delete Write

Call a relative SignNow API DELETE path. Absolute URLs are rejected.

Lua path
app.integrations.signnow.api_delete
Full name
signnow.signnow_api_delete
ParameterTypeRequiredDescription
path string yes Relative SignNow API path.
payload object no Optional JSON body.