KosmoKrator

forms

Tally Lua API for KosmoKrator Agents

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

6 functions 6 read 0 write Bearer token auth

Lua Namespace

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

Tally Forms — Lua API Reference

list_forms

List all Tally forms accessible to the authenticated user. Returns form IDs, titles, status, and submission counts.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)
limitintegernoNumber of forms per page (default: 20, max: 100)

Example

local forms = app.integrations.tally.list_forms({ limit = 10 })

for _, form in ipairs(forms.data) do
  print(form.title .. " (" .. form.status .. ") - " .. form.numberOfResponses .. " responses")
end

get_form

Get full details of a specific Tally form, including form structure, fields, and settings.

Parameters

NameTypeRequiredDescription
form_idstringyesThe Tally form ID (e.g., "mVlBRN")

Example

local form = app.integrations.tally.get_form({ form_id = "mVlBRN" })
print("Form: " .. form.title)
print("Status: " .. form.status)
print("Fields: " .. #form.questions)

list_submissions

List all submissions for a specific Tally form. Returns respondent answers, submission dates, and metadata. Supports pagination.

Parameters

NameTypeRequiredDescription
form_idstringyesThe Tally form ID
pageintegernoPage number for pagination (default: 1)
limitintegernoNumber of submissions per page (default: 20, max: 100)

Example

local result = app.integrations.tally.list_submissions({
  form_id = "mVlBRN",
  limit = 50
})

for _, submission in ipairs(result.data) do
  print("Submitted at: " .. submission.createdAt)
  for _, response in ipairs(submission.questions) do
    print("  " .. response.question .. ": " .. tostring(response.value))
  end
end

get_submission

Get full details of a specific form submission by its ID, including all field responses and metadata.

Parameters

NameTypeRequiredDescription
submission_idstringyesThe Tally submission ID

Example

local sub = app.integrations.tally.get_submission({ submission_id = "sub_abc123" })
print("Submitted: " .. sub.createdAt)
for _, response in ipairs(sub.questions) do
  print(response.question .. ": " .. tostring(response.value))
end

list_workspaces

List all workspaces accessible to the authenticated Tally user.

Parameters

None.

Example

local workspaces = app.integrations.tally.list_workspaces({})
for _, ws in ipairs(workspaces.data) do
  print("Workspace: " .. ws.name .. " (ID: " .. ws.id .. ")")
end

get_current_user

Get the authenticated user’s profile information, including name and email.

Parameters

None.

Example

local user = app.integrations.tally.get_current_user({})
print("Logged in as: " .. user.name .. " (" .. user.email .. ")")

Common Workflows

List all forms and their recent submissions

local forms = app.integrations.tally.list_forms({ limit = 20 })

for _, form in ipairs(forms.data) do
  print("== " .. form.title .. " ==")

  if form.numberOfResponses and form.numberOfResponses > 0 then
    local submissions = app.integrations.tally.list_submissions({
      form_id = form.id,
      limit = 5
    })

    for _, sub in ipairs(submissions.data) do
      print("  " .. sub.createdAt)
    end
  else
    print("  No submissions yet")
  end
end

Find a form by title and get its submissions

local forms = app.integrations.tally.list_forms({ limit = 100 })
local target = nil

for _, form in ipairs(forms.data) do
  if form.title == "Contact Form" then
    target = form
    break
  end
end

if target then
  local subs = app.integrations.tally.list_submissions({
    form_id = target.id,
    limit = 50
  })

  print("Found " .. #subs.data .. " submissions")
end

Notes

  • Form IDs are short alphanumeric strings (e.g., "mVlBRN")
  • Pagination is page-based; increase page to get more results
  • Submission responses are in the questions array of each submission object
  • Rate limits may apply; use pagination rather than requesting large limits

Multi-Account Usage

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

-- Default account (always works)
app.integrations.tally.list_forms({})

-- Explicit default (portable across setups)
app.integrations.tally.default.list_forms({})

-- Named accounts
app.integrations.tally.work.list_forms({})
app.integrations.tally.personal.list_forms({})

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

Raw agent markdown
# Tally Forms — Lua API Reference

## list_forms

List all Tally forms accessible to the authenticated user. Returns form IDs, titles, status, and submission counts.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `limit` | integer | no | Number of forms per page (default: 20, max: 100) |

### Example

```lua
local forms = app.integrations.tally.list_forms({ limit = 10 })

for _, form in ipairs(forms.data) do
  print(form.title .. " (" .. form.status .. ") - " .. form.numberOfResponses .. " responses")
end
```

---

## get_form

Get full details of a specific Tally form, including form structure, fields, and settings.

### Parameters

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

### Example

```lua
local form = app.integrations.tally.get_form({ form_id = "mVlBRN" })
print("Form: " .. form.title)
print("Status: " .. form.status)
print("Fields: " .. #form.questions)
```

---

## list_submissions

List all submissions for a specific Tally form. Returns respondent answers, submission dates, and metadata. Supports pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `form_id` | string | yes | The Tally form ID |
| `page` | integer | no | Page number for pagination (default: 1) |
| `limit` | integer | no | Number of submissions per page (default: 20, max: 100) |

### Example

```lua
local result = app.integrations.tally.list_submissions({
  form_id = "mVlBRN",
  limit = 50
})

for _, submission in ipairs(result.data) do
  print("Submitted at: " .. submission.createdAt)
  for _, response in ipairs(submission.questions) do
    print("  " .. response.question .. ": " .. tostring(response.value))
  end
end
```

---

## get_submission

Get full details of a specific form submission by its ID, including all field responses and metadata.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `submission_id` | string | yes | The Tally submission ID |

### Example

```lua
local sub = app.integrations.tally.get_submission({ submission_id = "sub_abc123" })
print("Submitted: " .. sub.createdAt)
for _, response in ipairs(sub.questions) do
  print(response.question .. ": " .. tostring(response.value))
end
```

---

## list_workspaces

List all workspaces accessible to the authenticated Tally user.

### Parameters

None.

### Example

```lua
local workspaces = app.integrations.tally.list_workspaces({})
for _, ws in ipairs(workspaces.data) do
  print("Workspace: " .. ws.name .. " (ID: " .. ws.id .. ")")
end
```

---

## get_current_user

Get the authenticated user's profile information, including name and email.

### Parameters

None.

### Example

```lua
local user = app.integrations.tally.get_current_user({})
print("Logged in as: " .. user.name .. " (" .. user.email .. ")")
```

---

## Common Workflows

### List all forms and their recent submissions

```lua
local forms = app.integrations.tally.list_forms({ limit = 20 })

for _, form in ipairs(forms.data) do
  print("== " .. form.title .. " ==")

  if form.numberOfResponses and form.numberOfResponses > 0 then
    local submissions = app.integrations.tally.list_submissions({
      form_id = form.id,
      limit = 5
    })

    for _, sub in ipairs(submissions.data) do
      print("  " .. sub.createdAt)
    end
  else
    print("  No submissions yet")
  end
end
```

### Find a form by title and get its submissions

```lua
local forms = app.integrations.tally.list_forms({ limit = 100 })
local target = nil

for _, form in ipairs(forms.data) do
  if form.title == "Contact Form" then
    target = form
    break
  end
end

if target then
  local subs = app.integrations.tally.list_submissions({
    form_id = target.id,
    limit = 50
  })

  print("Found " .. #subs.data .. " submissions")
end
```

## Notes

- Form IDs are short alphanumeric strings (e.g., `"mVlBRN"`)
- Pagination is page-based; increase `page` to get more results
- Submission responses are in the `questions` array of each submission object
- Rate limits may apply; use pagination rather than requesting large limits

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.tally.list_forms({})

-- Explicit default (portable across setups)
app.integrations.tally.default.list_forms({})

-- Named accounts
app.integrations.tally.work.list_forms({})
app.integrations.tally.personal.list_forms({})
```

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

Metadata-Derived Lua Example

local result = app.integrations.tally.tally_get_current_user({})
print(result)

Functions

tally_get_current_user

Get the authenticated user's profile information, including name, email, and account details.

Operation
Read read
Full name
tally.tally_get_current_user
ParameterTypeRequiredDescription
No parameters.

tally_get_form

Get full details of a specific Tally form by its ID, including form structure, fields, and settings.

Operation
Read read
Full name
tally.tally_get_form
ParameterTypeRequiredDescription
form_id string yes The Tally form ID (e.g., "mVlBRN").

tally_get_submission

Get full details of a specific form submission by its ID, including all field responses and metadata.

Operation
Read read
Full name
tally.tally_get_submission
ParameterTypeRequiredDescription
submission_id string yes The Tally submission ID.

tally_list_forms

List all Tally forms accessible to the authenticated user. Returns form IDs, titles, status, and submission counts. Supports pagination.

Operation
Read read
Full name
tally.tally_list_forms
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of forms per page (default: 20, max: 100).

tally_list_submissions

List all submissions for a specific Tally form. Returns respondent answers, submission dates, and metadata. Supports pagination.

Operation
Read read
Full name
tally.tally_list_submissions
ParameterTypeRequiredDescription
form_id string yes The Tally form ID to retrieve submissions for (e.g., "mVlBRN").
page integer no Page number for pagination (default: 1).
limit integer no Number of submissions per page (default: 20, max: 100).

tally_list_workspaces

List all workspaces accessible to the authenticated Tally user. Returns workspace names, IDs, and member info.

Operation
Read read
Full name
tally.tally_list_workspaces
ParameterTypeRequiredDescription
No parameters.