KosmoKrator

forms

Jotform Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write API key auth

Lua Namespace

Agents call this integration through app.integrations.jotform.*. Use lua_read_doc("integrations.jotform") 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.

Jotform — Lua API Reference

list_forms

List all forms owned by the authenticated Jotform user.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of forms to return (default: 20, max: 1000)
offsetintegernoOffset for pagination
orderbystringnoOrder field: "created_at", "title", "id", "updated_at"
statusstringnoFilter by status: "ENABLED" or "DISABLED"
titlestringnoFilter by form title (partial match)

Example

local result = app.integrations.jotform.list_forms({
  limit = 10,
  orderby = "created_at"
})

for _, form in ipairs(result) do
  print(form.title .. " (ID: " .. form.id .. ")")
end

get_form

Get detailed information about a specific form.

Parameters

NameTypeRequiredDescription
form_idstringyesThe form ID (e.g., "231234567890123")

Example

local result = app.integrations.jotform.get_form({
  form_id = "231234567890123"
})

print("Title: " .. result.title)
print("URL: " .. result.url)
print("Status: " .. result.status)
print("Created: " .. result.created_at)

list_submissions

List submissions for a specific form.

Parameters

NameTypeRequiredDescription
form_idstringyesThe form ID
limitintegernoMaximum number of submissions (default: 20, max: 1000)
offsetintegernoOffset for pagination
orderbystringnoOrder field: "created_at" (default) or "id"
created_atstringnoFilter by creation date (format: "YYYY-MM-DD HH:mm:ss" or date range)
statusstringnoFilter by status: "ACTIVE" or "DELETED"

Example

local result = app.integrations.jotform.list_submissions({
  form_id = "231234567890123",
  limit = 10,
  orderby = "created_at"
})

for _, sub in ipairs(result) do
  print("Submission " .. sub.id .. " at " .. sub.created_at)
  for key, answer in pairs(sub.answers) do
    print("  " .. answer.name .. ": " .. tostring(answer.answer))
  end
end

get_submission

Get details for a specific submission.

Parameters

NameTypeRequiredDescription
submission_idstringyesThe submission ID (e.g., "512345678901234567")

Example

local result = app.integrations.jotform.get_submission({
  submission_id = "512345678901234567"
})

for key, answer in pairs(result.answers) do
  print(answer.name .. ": " .. tostring(answer.answer))
end

create_form

Create a new form in Jotform.

Parameters

NameTypeRequiredDescription
titlestringyesThe title of the form
questionsarraynoArray of question definitions (see below)
propertiesobjectnoAdditional form properties

Question Types

TypeDescription
control_textboxSingle-line text input
control_textareaMulti-line text input
control_emailEmail input
control_dropdownDropdown select
control_radioRadio button group
control_checkboxCheckbox group
control_numberNumber input
control_phonePhone number input
control_datetimeDate/time picker
control_fileuploadFile upload
control_scaleRating scale
control_matrixMatrix / grid
control_fullnameFull name (first + last)
control_addressAddress (street, city, state, zip, country)
control_hiddenHidden field
control_buttonSubmit button

Example

local result = app.integrations.jotform.create_form({
  title = "Contact Form",
  questions = {
    {
      type = "control_fullname",
      name = "Name",
      order = "1",
      required = "Yes"
    },
    {
      type = "control_email",
      name = "Email",
      order = "2",
      required = "Yes"
    },
    {
      type = "control_textarea",
      name = "Message",
      order = "3"
    }
  }
})

print("Created form: " .. result.id)
print("URL: " .. result.url)

list_questions

List all questions (form fields) for a specific form.

Parameters

NameTypeRequiredDescription
form_idstringyesThe form ID
offsetintegernoOffset for pagination

Example

local result = app.integrations.jotform.list_questions({
  form_id = "231234567890123"
})

for key, question in pairs(result) do
  print(question.type .. ": " .. question.name .. " (order: " .. question.order .. ")")
end

get_current_user

Get profile information for the authenticated user.

Parameters

None.

Example

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

print("Username: " .. result.username)
print("Email: " .. result.email)
print("Account type: " .. result.account_type)
print("Forms used: " .. result.usage.forms .. " / " .. result.usage.form_limit)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.jotform.function_name({...})

-- Explicit default (portable across setups)
app.integrations.jotform.default.function_name({...})

-- Named accounts
app.integrations.jotform.work.function_name({...})
app.integrations.jotform.client.function_name({...})

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

Raw agent markdown
# Jotform — Lua API Reference

## list_forms

List all forms owned by the authenticated Jotform user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of forms to return (default: 20, max: 1000) |
| `offset` | integer | no | Offset for pagination |
| `orderby` | string | no | Order field: `"created_at"`, `"title"`, `"id"`, `"updated_at"` |
| `status` | string | no | Filter by status: `"ENABLED"` or `"DISABLED"` |
| `title` | string | no | Filter by form title (partial match) |

### Example

```lua
local result = app.integrations.jotform.list_forms({
  limit = 10,
  orderby = "created_at"
})

for _, form in ipairs(result) do
  print(form.title .. " (ID: " .. form.id .. ")")
end
```

---

## get_form

Get detailed information about a specific form.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `form_id` | string | yes | The form ID (e.g., `"231234567890123"`) |

### Example

```lua
local result = app.integrations.jotform.get_form({
  form_id = "231234567890123"
})

print("Title: " .. result.title)
print("URL: " .. result.url)
print("Status: " .. result.status)
print("Created: " .. result.created_at)
```

---

## list_submissions

List submissions for a specific form.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `form_id` | string | yes | The form ID |
| `limit` | integer | no | Maximum number of submissions (default: 20, max: 1000) |
| `offset` | integer | no | Offset for pagination |
| `orderby` | string | no | Order field: `"created_at"` (default) or `"id"` |
| `created_at` | string | no | Filter by creation date (format: `"YYYY-MM-DD HH:mm:ss"` or date range) |
| `status` | string | no | Filter by status: `"ACTIVE"` or `"DELETED"` |

### Example

```lua
local result = app.integrations.jotform.list_submissions({
  form_id = "231234567890123",
  limit = 10,
  orderby = "created_at"
})

for _, sub in ipairs(result) do
  print("Submission " .. sub.id .. " at " .. sub.created_at)
  for key, answer in pairs(sub.answers) do
    print("  " .. answer.name .. ": " .. tostring(answer.answer))
  end
end
```

---

## get_submission

Get details for a specific submission.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `submission_id` | string | yes | The submission ID (e.g., `"512345678901234567"`) |

### Example

```lua
local result = app.integrations.jotform.get_submission({
  submission_id = "512345678901234567"
})

for key, answer in pairs(result.answers) do
  print(answer.name .. ": " .. tostring(answer.answer))
end
```

---

## create_form

Create a new form in Jotform.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | The title of the form |
| `questions` | array | no | Array of question definitions (see below) |
| `properties` | object | no | Additional form properties |

### Question Types

| Type | Description |
|------|-------------|
| `control_textbox` | Single-line text input |
| `control_textarea` | Multi-line text input |
| `control_email` | Email input |
| `control_dropdown` | Dropdown select |
| `control_radio` | Radio button group |
| `control_checkbox` | Checkbox group |
| `control_number` | Number input |
| `control_phone` | Phone number input |
| `control_datetime` | Date/time picker |
| `control_fileupload` | File upload |
| `control_scale` | Rating scale |
| `control_matrix` | Matrix / grid |
| `control_fullname` | Full name (first + last) |
| `control_address` | Address (street, city, state, zip, country) |
| `control_hidden` | Hidden field |
| `control_button` | Submit button |

### Example

```lua
local result = app.integrations.jotform.create_form({
  title = "Contact Form",
  questions = {
    {
      type = "control_fullname",
      name = "Name",
      order = "1",
      required = "Yes"
    },
    {
      type = "control_email",
      name = "Email",
      order = "2",
      required = "Yes"
    },
    {
      type = "control_textarea",
      name = "Message",
      order = "3"
    }
  }
})

print("Created form: " .. result.id)
print("URL: " .. result.url)
```

---

## list_questions

List all questions (form fields) for a specific form.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `form_id` | string | yes | The form ID |
| `offset` | integer | no | Offset for pagination |

### Example

```lua
local result = app.integrations.jotform.list_questions({
  form_id = "231234567890123"
})

for key, question in pairs(result) do
  print(question.type .. ": " .. question.name .. " (order: " .. question.order .. ")")
end
```

---

## get_current_user

Get profile information for the authenticated user.

### Parameters

None.

### Example

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

print("Username: " .. result.username)
print("Email: " .. result.email)
print("Account type: " .. result.account_type)
print("Forms used: " .. result.usage.forms .. " / " .. result.usage.form_limit)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.jotform.function_name({...})

-- Explicit default (portable across setups)
app.integrations.jotform.default.function_name({...})

-- Named accounts
app.integrations.jotform.work.function_name({...})
app.integrations.jotform.client.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.jotform.jotform_list_forms({
  limit = 1,
  offset = 1,
  orderby = "example_orderby",
  status = "example_status",
  title = "example_title"
})
print(result)

Functions

jotform_list_forms

List all forms owned by the authenticated Jotform user. Returns form IDs, titles, creation dates, and status. Supports pagination and filtering.

Operation
Read read
Full name
jotform.jotform_list_forms
ParameterTypeRequiredDescription
limit integer no Maximum number of forms to return (default: 20, max: 1000).
offset integer no Offset for pagination — pass the number of forms to skip.
orderby string no Field to order by: "created_at" (default), "title", "id", "updated_at".
status string no Filter by status: "ENABLED" or "DISABLED".
title string no Filter by form title (partial match).

jotform_get_form

Get detailed information about a specific Jotform form, including its properties, status, URL, and creation date.

Operation
Read read
Full name
jotform.jotform_get_form
ParameterTypeRequiredDescription
form_id string yes The form ID (e.g., "231234567890123").

jotform_list_submissions

List submissions for a specific Jotform form. Returns submission IDs, timestamps, and answers. Supports pagination, filtering by date, and ordering.

Operation
Read read
Full name
jotform.jotform_list_submissions
ParameterTypeRequiredDescription
form_id string yes The form ID to list submissions for (e.g., "231234567890123").
limit integer no Maximum number of submissions to return (default: 20, max: 1000).
offset integer no Offset for pagination — pass the number of submissions to skip.
orderby string no Field to order by: "created_at" (default) or "id".
created_at string no Filter by creation date (format: "YYYY-MM-DD HH:mm:ss" or date range).
status string no Filter by submission status: "ACTIVE" or "DELETED".

jotform_get_submission

Get detailed information about a specific Jotform submission, including all form answers, metadata, and timestamps.

Operation
Read read
Full name
jotform.jotform_get_submission
ParameterTypeRequiredDescription
submission_id string yes The submission ID (e.g., "512345678901234567").

jotform_create_form

Create a new form in Jotform. Provide form properties such as title, questions (fields), and other settings. Returns the created form with its ID and URL.

Operation
Write write
Full name
jotform.jotform_create_form
ParameterTypeRequiredDescription
title string yes The title of the form.
questions array no Array of question definitions. Each question should have "type" (e.g., "control_textbox", "control_email", "control_textarea", "control_dropdown", "control_radio", "control_checkbox"), "name" (field label), and "order" (position).
properties object no Additional form properties (e.g., "redirect", "thankurl", "form_pagination", "height"). Pass as an object.

jotform_list_questions

List all questions (form fields) for a specific Jotform form. Returns field types, labels, names, and configuration options.

Operation
Read read
Full name
jotform.jotform_list_questions
ParameterTypeRequiredDescription
form_id string yes The form ID (e.g., "231234567890123").
offset integer no Offset for pagination.

jotform_get_current_user

Get profile information for the currently authenticated Jotform user, including username, email, account type, and usage stats.

Operation
Read read
Full name
jotform.jotform_get_current_user
ParameterTypeRequiredDescription
No parameters.