KosmoKrator

other

Signnow Lua API for KosmoKrator Agents

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

6 functions 4 read 2 write Manual OAuth token auth

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.

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

list_documents

List documents accessible to the authenticated user.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (1-based). Default: 1.
per_pageintegernoNumber of documents per page. Default: 20.

Examples

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

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

get_document

Get full details for a specific document by ID.

Parameters

NameTypeRequiredDescription
document_idstringyesThe unique document identifier.

Examples

local result = app.integrations.signnow.get_document({
  document_id = "abc123def456"
})

print("Document: " .. (result.name or "Untitled"))
print("Status: " .. (result.status or "unknown"))

create_document

Upload a PDF file to create a new document in SignNow.

Parameters

NameTypeRequiredDescription
file_pathstringyesAbsolute path to the PDF file to upload.
file_namestringnoName for the uploaded file. Defaults to the basename of file_path.

Examples

local result = app.integrations.signnow.create_document({
  file_path = "/tmp/contract.pdf",
  file_name = "Client Contract.pdf"
})

print("Created document ID: " .. result.id)

list_templates

List document templates available in your SignNow account.

Parameters

None.

Examples

local result = app.integrations.signnow.list_templates({})

for _, tmpl in ipairs(result.templates or {}) do
  print(tmpl.id .. ": " .. (tmpl.name or "Unnamed Template"))
end

send_invite

Send a signing invitation for a document. The recipient receives an email with a link to sign.

Parameters

NameTypeRequiredDescription
document_idstringyesThe document to send an invite for.
tostringyesRecipient email address.
fromstringyesSender email address (must be the authenticated user email).
subjectstringyesEmail subject line for the invite.
messagestringnoOptional custom message body for the invitation email.

Examples

local result = app.integrations.signnow.send_invite({
  document_id = "abc123def456",
  to = "[email protected]",
  from = "[email protected]",
  subject = "Please sign the NDA",
  message = "Hi, please review and sign the attached NDA at your earliest convenience."
})

print("Invite sent successfully")

get_current_user

Get the authenticated SignNow user profile.

Parameters

None.

Examples

local result = app.integrations.signnow.get_current_user({})

print("User: " .. (result.email or "unknown"))
print("Name: " .. (result.first_name or "") .. " " .. (result.last_name or ""))

Multi-Account Usage

If you have multiple SignNow accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.signnow.list_documents({page = 1})

-- Explicit default (portable across setups)
app.integrations.signnow.default.list_documents({page = 1})

-- Named accounts
app.integrations.signnow.legal.list_documents({})
app.integrations.signnow.hr.list_documents({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# SignNow — Lua API Reference

## list_documents

List documents accessible to the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (1-based). Default: 1. |
| `per_page` | integer | no | Number of documents per page. Default: 20. |

### Examples

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

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

---

## get_document

Get full details for a specific document by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_id` | string | yes | The unique document identifier. |

### Examples

```lua
local result = app.integrations.signnow.get_document({
  document_id = "abc123def456"
})

print("Document: " .. (result.name or "Untitled"))
print("Status: " .. (result.status or "unknown"))
```

---

## create_document

Upload a PDF file to create a new document in SignNow.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `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. |

### Examples

```lua
local result = app.integrations.signnow.create_document({
  file_path = "/tmp/contract.pdf",
  file_name = "Client Contract.pdf"
})

print("Created document ID: " .. result.id)
```

---

## list_templates

List document templates available in your SignNow account.

### Parameters

None.

### Examples

```lua
local result = app.integrations.signnow.list_templates({})

for _, tmpl in ipairs(result.templates or {}) do
  print(tmpl.id .. ": " .. (tmpl.name or "Unnamed Template"))
end
```

---

## send_invite

Send a signing invitation for a document. The recipient receives an email with a link to sign.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_id` | string | yes | The document to send an invite for. |
| `to` | string | yes | Recipient email address. |
| `from` | string | yes | Sender email address (must be the authenticated user email). |
| `subject` | string | yes | Email subject line for the invite. |
| `message` | string | no | Optional custom message body for the invitation email. |

### Examples

```lua
local result = app.integrations.signnow.send_invite({
  document_id = "abc123def456",
  to = "[email protected]",
  from = "[email protected]",
  subject = "Please sign the NDA",
  message = "Hi, please review and sign the attached NDA at your earliest convenience."
})

print("Invite sent successfully")
```

---

## get_current_user

Get the authenticated SignNow user profile.

### Parameters

None.

### Examples

```lua
local result = app.integrations.signnow.get_current_user({})

print("User: " .. (result.email or "unknown"))
print("Name: " .. (result.first_name or "") .. " " .. (result.last_name or ""))
```

---

## Multi-Account Usage

If you have multiple SignNow accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.signnow.list_documents({page = 1})

-- Explicit default (portable across setups)
app.integrations.signnow.default.list_documents({page = 1})

-- Named accounts
app.integrations.signnow.legal.list_documents({})
app.integrations.signnow.hr.list_documents({})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.signnow.signnow_list_documents({
  page = 1,
  per_page = 1
})
print(result)

Functions

signnow_list_documents

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

Operation
Read read
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.

signnow_get_document

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

Operation
Read read
Full name
signnow.signnow_get_document
ParameterTypeRequiredDescription
document_id string yes The unique document identifier.

signnow_create_document

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

Operation
Write write
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.

signnow_list_templates

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

Operation
Read read
Full name
signnow.signnow_list_templates
ParameterTypeRequiredDescription
No parameters.

signnow_send_invite

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

Operation
Write write
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.

signnow_get_current_user

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

Operation
Read read
Full name
signnow.signnow_get_current_user
ParameterTypeRequiredDescription
No parameters.