> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Loomio API reference

> API reference for the Loomio plugin in Corsair: every `loomio.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Comments

### create

`comments.create`

Post a comment, or a reply to a comment, on a discussion, in markdown or html

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.comments.create({ discussion_id: 88, body: 'Sounds good to me.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussion_id` | `number` | Yes | The discussion to comment on (its numeric discussion id). |
| `parent_id` | `number` | No | Reply to this comment id. Loomio posts the reply in the parent comment's discussion and ignores `discussion_id`, so pass a parent from the same discussion. |
| `body` | `string` | Yes | The comment text. Required. |
| `body_format` | `md \| html` | No | Format of `body`; `md` (default) or `html`. |

discussion\_id is the numeric discussion id (not the topic id). Set parent\_id to reply to a comment: the reply goes to the parent comment's discussion and Loomio ignores discussion\_id, so use a parent from the same discussion. body\_format takes md (default) or html.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `comment` | `object` | Yes | — |

> [accordion] comment full type
>
> ```ts theme={null}
> {
>   id: number,
>   body?: string | null,
>   body_format?: string | null,
>   mentioned_usernames?: string[] | null,
>   topic_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   parent_id?: number | null,
>   parent_type?: string | null,
>   content_locale?: string | null,
>   versions_count?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null
> }
> ```

***

### delete

`comments.delete`

Soft-delete a comment: its body is hidden and the API cannot restore it

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.comments.delete({ id: 301 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The comment id to soft-delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `comment` | `object` | Yes | — |

> [accordion] comment full type
>
> ```ts theme={null}
> {
>   id: number,
>   body?: string | null,
>   body_format?: string | null,
>   mentioned_usernames?: string[] | null,
>   topic_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   parent_id?: number | null,
>   parent_type?: string | null,
>   content_locale?: string | null,
>   versions_count?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null
> }
> ```

***

### update

`comments.update`

Edit the body of a comment the key user may edit

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.comments.update({ id: 301, body: 'Sounds good to me, with one change.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The comment id. |
| `body` | `string` | Yes | The new comment text. |
| `body_format` | `md \| html` | No | Format of `body`; `md` (default) or `html`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `comment` | `object` | Yes | — |

> [accordion] comment full type
>
> ```ts theme={null}
> {
>   id: number,
>   body?: string | null,
>   body_format?: string | null,
>   mentioned_usernames?: string[] | null,
>   topic_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   parent_id?: number | null,
>   parent_type?: string | null,
>   content_locale?: string | null,
>   versions_count?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null
> }
> ```

***

## Discussions

### create

`discussions.create`

Start a discussion in a group; can notify the whole group and email invitations to recipient addresses

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.discussions.create({ group_id: 12, title: 'Spring palette', description: 'Pick three colours for the rebrand.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group to start the discussion in. |
| `title` | `string` | Yes | The discussion title. Required. |
| `description` | `string` | No | The discussion body. |
| `description_format` | `md \| html` | No | Format of `description`; `md` (default) or `html`. |
| `recipient_audience` | `string` | No | Notify an audience in the group about the new discussion. |
| `recipient_user_ids` | `number[]` | No | Notify these user ids about the new discussion. |
| `recipient_emails` | `string[]` | No | Invite these email addresses to the group with the discussion. |
| `recipient_message` | `string` | No | Message sent to the notified recipients. |

recipient\_audience: group notifies the whole group and recipient\_emails emails invitations, so this is destructive. A permission denial answers the same 403 body a bad key does.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussion` | `object` | Yes | — |

> [accordion] discussion full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   group_id?: number | null,
>   topic_id?: number | null,
>   title?: string | null,
>   content_locale?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   discussion_template_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   context_changed_at?: string | null,
>   versions_count?: number | null,
>   mentioned_usernames?: string[] | null,
>   discarded_at?: string | null
> }
> ```

***

### delete

`discussions.delete`

Soft-delete a discussion; it disappears for members and the API cannot restore it

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.discussions.delete({ id: 88 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The discussion id to soft-delete. |

A soft delete: the record stays with discarded\_at set, hidden from members. The API has no undo.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussion` | `object` | Yes | — |

> [accordion] discussion full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   group_id?: number | null,
>   topic_id?: number | null,
>   title?: string | null,
>   content_locale?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   discussion_template_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   context_changed_at?: string | null,
>   versions_count?: number | null,
>   mentioned_usernames?: string[] | null,
>   discarded_at?: string | null
> }
> ```

***

### get

`discussions.get`

Read one discussion by numeric id or url key, with its author and thread record

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.discussions.get({ id: 'dX2' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| string` | Yes | The discussion, by numeric id or url key. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussion` | `object` | Yes | — |

> [accordion] discussion full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   group_id?: number | null,
>   topic_id?: number | null,
>   title?: string | null,
>   content_locale?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   discussion_template_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   context_changed_at?: string | null,
>   versions_count?: number | null,
>   mentioned_usernames?: string[] | null,
>   discarded_at?: string | null
> }
> ```

***

### list

`discussions.list`

List discussions in one group, filtered by open or closed status, ordered by latest activity

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.discussions.list({ group_id: 12, limit: 20, compact: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group whose discussions to list. Required. |
| `status` | `open \| closed \| all` | No | Filter: `open`, `closed`, or `all`. Omitted, Loomio returns open and closed discussions (the same as `all`). |
| `limit` | `number` | No | Records per page; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

group\_id is required; Loomio answers a missing one with 404 \{"error":404}. status takes open, closed, or all; without it Loomio returns open and closed discussions alike.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussions` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] discussions full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   group_id?: number | null,
>   topic_id?: number | null,
>   title?: string | null,
>   content_locale?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   discussion_template_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   context_changed_at?: string | null,
>   versions_count?: number | null,
>   mentioned_usernames?: string[] | null,
>   discarded_at?: string | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### update

`discussions.update`

Edit a discussion title or context; can notify the group and email invitations to recipient addresses

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.discussions.update({ id: 88, title: 'Spring palette (final)' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The discussion id. |
| `title` | `string` | No | New title. |
| `description` | `string` | No | New context (body). |
| `description_format` | `md \| html` | No | Format of `description`; `md` (default) or `html`. |
| `recipient_audience` | `string \| null` | No | `group` notifies the whole group; null notifies nobody beyond the listed recipients. |
| `recipient_user_ids` | `number[]` | No | Notify or invite these user ids. |
| `recipient_emails` | `string[]` | No | Invite these email addresses; Loomio emails each one. |
| `recipient_message` | `string` | No | Message included in the email invitation. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `discussion` | `object` | Yes | — |

> [accordion] discussion full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   group_id?: number | null,
>   topic_id?: number | null,
>   title?: string | null,
>   content_locale?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   discussion_template_id?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   context_changed_at?: string | null,
>   versions_count?: number | null,
>   mentioned_usernames?: string[] | null,
>   discarded_at?: string | null
> }
> ```

***

## Groups

### get

`groups.get`

Read one group by numeric id, url key, or handle, with its settings and member counts

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.groups.get({ id: 'design' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| string` | Yes | The group, by numeric id, url key, or handle. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

The id accepts a numeric id, a url key, or a handle.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `group` | `object` | Yes | — |

> [accordion] group full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   handle?: string | null,
>   name?: string | null,
>   full_name?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   logo_url?: string | null,
>   created_at?: string | null,
>   creator_id?: number | null,
>   enabled?: boolean | null,
>   parent_id?: number | null,
>   group_privacy?: string | null,
>   membership_granted_upon?: string | null,
>   listed_in_explore?: boolean | null,
>   memberships_count?: number | null,
>   accepted_memberships_count?: number | null,
>   pending_memberships_count?: number | null,
>   admin_memberships_count?: number | null,
>   discussions_count?: number | null,
>   polls_count?: number | null,
>   subgroups_count?: number | null,
>   token?: string | null,
>   members_can_add_members?: boolean | null,
>   members_can_start_discussions?: boolean | null,
>   members_can_edit_discussions?: boolean | null,
>   members_can_edit_comments?: boolean | null,
>   members_can_delete_comments?: boolean | null,
>   members_can_create_subgroups?: boolean | null,
>   members_can_raise_motions?: boolean | null,
>   discarded_at?: string | null
> }
> ```

***

### list

`groups.list`

List the groups the key user belongs to, including subgroups, oldest first

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.groups.list({ limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Records per page, capped at 500; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `groups` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | Offset of the next page, derived from `meta.total`. |

> [accordion] groups full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   handle?: string | null,
>   name?: string | null,
>   full_name?: string | null,
>   description?: string | null,
>   description_format?: string | null,
>   logo_url?: string | null,
>   created_at?: string | null,
>   creator_id?: number | null,
>   enabled?: boolean | null,
>   parent_id?: number | null,
>   group_privacy?: string | null,
>   membership_granted_upon?: string | null,
>   listed_in_explore?: boolean | null,
>   memberships_count?: number | null,
>   accepted_memberships_count?: number | null,
>   pending_memberships_count?: number | null,
>   admin_memberships_count?: number | null,
>   discussions_count?: number | null,
>   polls_count?: number | null,
>   subgroups_count?: number | null,
>   token?: string | null,
>   members_can_add_members?: boolean | null,
>   members_can_start_discussions?: boolean | null,
>   members_can_edit_discussions?: boolean | null,
>   members_can_edit_comments?: boolean | null,
>   members_can_delete_comments?: boolean | null,
>   members_can_create_subgroups?: boolean | null,
>   members_can_raise_motions?: boolean | null,
>   discarded_at?: string | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

## Memberships

### list

`memberships.list`

List a group's memberships with related users; emails only for members the key user invited or in groups it administers

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.memberships.list({ group_id: 12, limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group whose memberships to list. Required. |
| `limit` | `number` | No | Records per page; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

user\_email comes back on memberships the key user invited and on every membership in groups the key user administers; treat any response as possibly holding emails.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `memberships` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] memberships full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   user_id?: number | null,
>   inviter_id?: number | null,
>   admin?: boolean | null,
>   delegate?: boolean | null,
>   title?: string | null,
>   created_at?: string | null,
>   accepted_at?: string | null,
>   revoked_at?: string | null,
>   user_email?: string | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### manage

`memberships.manage`

Invite email addresses to a group (Loomio emails them) and optionally remove every member not listed; group admin only

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.memberships.manage({ group_id: 12, emails: ['new.member@example.org'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group to manage. The key user must be a group admin. |
| `emails` | `string[]` | Yes | Email addresses to invite; Loomio emails each new address. |
| `remove_absent` | `boolean` | No | Remove every current member whose email is not in `emails`. An empty list removes everyone. The plugin first reads the group memberships so an address that differs only in letter case keeps its member. |

Group admin only. remove\_absent: true removes every member whose email is not listed, so an empty or partial list can empty the group. With remove\_absent the plugin first reads the group memberships and sends each listed address in its stored spelling, because Loomio compares the lists case-sensitively.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `added_emails` | `string[] \| null` | No | — |
| `removed_emails` | `string[] \| null` | No | — |

***

## Polls

### create

`polls.create`

Create a poll in a group or on a discussion; can invite the group to vote and email invitations to recipient addresses

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.polls.create({ discussion_id: 88, title: 'Which blue?', poll_type: 'poll', options: ['Sky blue', 'Navy'], closing_at: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString() });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | No | Start the poll in this group. Provide this or `discussion_id`. |
| `discussion_id` | `number` | No | Start the poll on this discussion. Provide this or `group_id`. |
| `title` | `string` | Yes | The poll question. Required. |
| `details` | `string` | No | The poll body text. |
| `details_format` | `md \| html` | No | Format of `details`; `md` (default) or `html`. |
| `poll_type` | `proposal \| poll \| count \| score \| ranked_choice \| meeting \| dot_vote` | Yes | Voting style: proposal, poll, count, score, ranked\_choice, meeting, or dot\_vote. |
| `options` | `string[]` | No | Option texts. For a proposal, Loomio uses agree, disagree, abstain, and block when omitted. |
| `poll_options_attributes` | `object[]` | No | Options with per-option settings; an alternative to `options`. |
| `closing_at` | `string \| null` | No | ISO 8601 close time. Omit or send null to keep the poll a draft with voting disabled. |
| `specified_voters_only` | `boolean` | No | Restrict voting to invited voters. |
| `hide_results` | `off \| until_vote \| until_closed` | No | Hide results until a vote is cast or until the poll closes. |
| `anonymous` | `boolean` | No | Hide voter identities. Needs closing\_at (Loomio refuses anonymous drafts). Options freeze after the first ballot. |
| `shuffle_options` | `boolean` | No | Show options in random order. |
| `stance_reason_required` | `disabled \| optional \| required \| required_for_disagree_or_block \| required_for_block` | No | When a reason statement is required with a vote. |
| `reason_prompt` | `string` | No | Question shown when a reason is requested. |
| `notify_on_closing_soon` | `nobody \| author \| voters_uncast \| voters` | No | Who is reminded before the poll closes. |
| `recipient_audience` | `string` | No | Notify an audience in the group about the poll. |
| `recipient_user_ids` | `number[]` | No | Notify these user ids about the poll. |
| `recipient_emails` | `string[]` | No | Invite these email addresses to vote. |
| `recipient_message` | `string` | No | Message sent to the notified recipients. |
| `notify_recipients` | `boolean` | No | Send the invitation notification. |

Provide group\_id or discussion\_id. Omit closing\_at (or send null) to keep the poll a draft with voting disabled; anonymous polls need closing\_at, because Loomio refuses an anonymous draft with 403 after saving it. For proposals, options default to agree, disagree, abstain, and block. notify\_recipients: true emails everyone invited.

> [accordion] poll\_options\_attributes full type
>
> ```ts theme={null}
> {
>   name: string,
>   meaning?: string,
>   prompt?: string,
>   icon?: string,
>   priority?: number,
>   test_operator?: gte | lte | null,
>   test_percent?: number | null,
>   test_against?: score_percent | voter_percent | null
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `poll` | `object` | Yes | Poll record. The chosen options arrive in the related `poll_options` array and the current outcome in `outcomes`, matched by `current_outcome_id`. |

> [accordion] poll full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   title?: string | null,
>   details?: string | null,
>   details_format?: string | null,
>   poll_type?: string | null,
>   poll_option_names?: string[] | null,
>   closing_at?: string | null,
>   closed_at?: string | null,
>   opening_at?: string | null,
>   opened_at?: string | null,
>   created_at?: string | null,
>   anonymous?: boolean | null,
>   hide_results?: string | null,
>   shuffle_options?: boolean | null,
>   specified_voters_only?: boolean | null,
>   stance_reason_required?: string | null,
>   reason_prompt?: string | null,
>   notify_on_closing_soon?: string | null,
>   notify_on_open?: boolean | null,
>   topic_id?: number | null,
>   group_id?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null,
>   vote_count_cast?: number | null,
>   vote_count_eligible?: number | null,
>   vote_count_uncast?: number | null,
>   participation_pct?: number | null,
>   total_score?: number | string | null,
>   quorum_pct?: number | null,
>   quorum_reached?: boolean | null,
>   quorum_threshold?: number | string | null,
>   quorum_shortfall?: number | string | null,
>   score_min?: number | null,
>   score_max?: number | null,
>   choice_count_min?: number | null,
>   choice_count_max?: number | null,
>   points_per_voter?: number | null,
>   meeting_duration?: number | null,
>   stv_seats?: number | null,
>   stv_method?: string | null,
>   stv_quota?: string | null,
>   chart_type?: string | null,
>   show_none_of_the_above?: boolean | null,
>   weighted_voting?: boolean | null,
>   current_outcome_id?: number | null
> }
> ```

***

### delete

`polls.delete`

Soft-delete a poll; it disappears for voters and the API cannot restore it

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.polls.delete({ id: 63 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The poll id to soft-delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `poll` | `object` | Yes | Poll record. The chosen options arrive in the related `poll_options` array and the current outcome in `outcomes`, matched by `current_outcome_id`. |

> [accordion] poll full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   title?: string | null,
>   details?: string | null,
>   details_format?: string | null,
>   poll_type?: string | null,
>   poll_option_names?: string[] | null,
>   closing_at?: string | null,
>   closed_at?: string | null,
>   opening_at?: string | null,
>   opened_at?: string | null,
>   created_at?: string | null,
>   anonymous?: boolean | null,
>   hide_results?: string | null,
>   shuffle_options?: boolean | null,
>   specified_voters_only?: boolean | null,
>   stance_reason_required?: string | null,
>   reason_prompt?: string | null,
>   notify_on_closing_soon?: string | null,
>   notify_on_open?: boolean | null,
>   topic_id?: number | null,
>   group_id?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null,
>   vote_count_cast?: number | null,
>   vote_count_eligible?: number | null,
>   vote_count_uncast?: number | null,
>   participation_pct?: number | null,
>   total_score?: number | string | null,
>   quorum_pct?: number | null,
>   quorum_reached?: boolean | null,
>   quorum_threshold?: number | string | null,
>   quorum_shortfall?: number | string | null,
>   score_min?: number | null,
>   score_max?: number | null,
>   choice_count_min?: number | null,
>   choice_count_max?: number | null,
>   points_per_voter?: number | null,
>   meeting_duration?: number | null,
>   stv_seats?: number | null,
>   stv_method?: string | null,
>   stv_quota?: string | null,
>   chart_type?: string | null,
>   show_none_of_the_above?: boolean | null,
>   weighted_voting?: boolean | null,
>   current_outcome_id?: number | null
> }
> ```

***

### get

`polls.get`

Read one poll by numeric id or url key, with vote counts and its options

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.polls.get({ id: 63 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| string` | Yes | The poll, by numeric id or url key. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `poll` | `object` | Yes | Poll record. The chosen options arrive in the related `poll_options` array and the current outcome in `outcomes`, matched by `current_outcome_id`. |

> [accordion] poll full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   title?: string | null,
>   details?: string | null,
>   details_format?: string | null,
>   poll_type?: string | null,
>   poll_option_names?: string[] | null,
>   closing_at?: string | null,
>   closed_at?: string | null,
>   opening_at?: string | null,
>   opened_at?: string | null,
>   created_at?: string | null,
>   anonymous?: boolean | null,
>   hide_results?: string | null,
>   shuffle_options?: boolean | null,
>   specified_voters_only?: boolean | null,
>   stance_reason_required?: string | null,
>   reason_prompt?: string | null,
>   notify_on_closing_soon?: string | null,
>   notify_on_open?: boolean | null,
>   topic_id?: number | null,
>   group_id?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null,
>   vote_count_cast?: number | null,
>   vote_count_eligible?: number | null,
>   vote_count_uncast?: number | null,
>   participation_pct?: number | null,
>   total_score?: number | string | null,
>   quorum_pct?: number | null,
>   quorum_reached?: boolean | null,
>   quorum_threshold?: number | string | null,
>   quorum_shortfall?: number | string | null,
>   score_min?: number | null,
>   score_max?: number | null,
>   choice_count_min?: number | null,
>   choice_count_max?: number | null,
>   points_per_voter?: number | null,
>   meeting_duration?: number | null,
>   stv_seats?: number | null,
>   stv_method?: string | null,
>   stv_quota?: string | null,
>   chart_type?: string | null,
>   show_none_of_the_above?: boolean | null,
>   weighted_voting?: boolean | null,
>   current_outcome_id?: number | null
> }
> ```

***

### list

`polls.list`

List polls in one group, filtered by active or closed status, newest first, with current outcomes

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.polls.list({ group_id: 12, status: 'all', limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group whose polls to list. Required. |
| `status` | `active \| closed \| all` | No | Filter: `active` (default), `closed`, or `all`. |
| `limit` | `number` | No | Records per page; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

status takes active (default), closed, or all. Current outcomes ride in the outcomes array; match current\_outcome\_id on each poll.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `polls` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] polls full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   title?: string | null,
>   details?: string | null,
>   details_format?: string | null,
>   poll_type?: string | null,
>   poll_option_names?: string[] | null,
>   closing_at?: string | null,
>   closed_at?: string | null,
>   opening_at?: string | null,
>   opened_at?: string | null,
>   created_at?: string | null,
>   anonymous?: boolean | null,
>   hide_results?: string | null,
>   shuffle_options?: boolean | null,
>   specified_voters_only?: boolean | null,
>   stance_reason_required?: string | null,
>   reason_prompt?: string | null,
>   notify_on_closing_soon?: string | null,
>   notify_on_open?: boolean | null,
>   topic_id?: number | null,
>   group_id?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null,
>   vote_count_cast?: number | null,
>   vote_count_eligible?: number | null,
>   vote_count_uncast?: number | null,
>   participation_pct?: number | null,
>   total_score?: number | string | null,
>   quorum_pct?: number | null,
>   quorum_reached?: boolean | null,
>   quorum_threshold?: number | string | null,
>   quorum_shortfall?: number | string | null,
>   score_min?: number | null,
>   score_max?: number | null,
>   choice_count_min?: number | null,
>   choice_count_max?: number | null,
>   points_per_voter?: number | null,
>   meeting_duration?: number | null,
>   stv_seats?: number | null,
>   stv_method?: string | null,
>   stv_quota?: string | null,
>   chart_type?: string | null,
>   show_none_of_the_above?: boolean | null,
>   weighted_voting?: boolean | null,
>   current_outcome_id?: number | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### update

`polls.update`

Edit a poll (title, details, options, closing time); can change existing votes and email invitations

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.polls.update({ id: 63, closing_at: new Date(Date.now() + 14 * 24 * 60 * 60 * 1000).toISOString() });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The poll id. |
| `title` | `string` | No | New poll title. |
| `details` | `string` | No | New poll details. |
| `details_format` | `md \| html` | No | Format of `details`; `md` (default) or `html`. |
| `options` | `string[]` | No | Replacement option names; may affect existing votes. |
| `poll_options_attributes` | `object[]` | No | Edit options by `id`, add ones without an `id`, remove with `id` + `_destroy: true`. Omitted options stay. |
| `reason_prompt` | `string` | No | Shared reason prompt. |
| `stance_reason_required` | `disabled \| optional \| required \| required_for_disagree_or_block \| required_for_block` | No | When a reason is required with a vote. |
| `closing_at` | `string \| null` | No | ISO 8601 close time; a future time opens voting. |
| `recipient_audience` | `string \| null` | No | `group` notifies the whole group; null notifies nobody beyond the listed recipients. |
| `recipient_user_ids` | `number[]` | No | Notify or invite these user ids. |
| `recipient_emails` | `string[]` | No | Invite these email addresses; Loomio emails each one. |
| `recipient_message` | `string` | No | Message included in the email invitation. |

Edit detailed options by id; add ones without an id; remove one with id and \_destroy: true. Closed polls cannot be edited, and anonymous polls freeze options after the first vote.

> [accordion] poll\_options\_attributes full type
>
> ```ts theme={null}
> {
>   name?: string,
>   meaning?: string,
>   prompt?: string,
>   icon?: string,
>   priority?: number,
>   test_operator?: gte | lte | null,
>   test_percent?: number | null,
>   test_against?: score_percent | voter_percent | null,
>   id?: number,
>   _destroy?: boolean
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `poll` | `object` | Yes | Poll record. The chosen options arrive in the related `poll_options` array and the current outcome in `outcomes`, matched by `current_outcome_id`. |

> [accordion] poll full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   title?: string | null,
>   details?: string | null,
>   details_format?: string | null,
>   poll_type?: string | null,
>   poll_option_names?: string[] | null,
>   closing_at?: string | null,
>   closed_at?: string | null,
>   opening_at?: string | null,
>   opened_at?: string | null,
>   created_at?: string | null,
>   anonymous?: boolean | null,
>   hide_results?: string | null,
>   shuffle_options?: boolean | null,
>   specified_voters_only?: boolean | null,
>   stance_reason_required?: string | null,
>   reason_prompt?: string | null,
>   notify_on_closing_soon?: string | null,
>   notify_on_open?: boolean | null,
>   topic_id?: number | null,
>   group_id?: number | null,
>   author_id?: number | null,
>   discarded_at?: string | null,
>   discarded_by?: number | null,
>   vote_count_cast?: number | null,
>   vote_count_eligible?: number | null,
>   vote_count_uncast?: number | null,
>   participation_pct?: number | null,
>   total_score?: number | string | null,
>   quorum_pct?: number | null,
>   quorum_reached?: boolean | null,
>   quorum_threshold?: number | string | null,
>   quorum_shortfall?: number | string | null,
>   score_min?: number | null,
>   score_max?: number | null,
>   choice_count_min?: number | null,
>   choice_count_max?: number | null,
>   points_per_voter?: number | null,
>   meeting_duration?: number | null,
>   stv_seats?: number | null,
>   stv_method?: string | null,
>   stv_quota?: string | null,
>   chart_type?: string | null,
>   show_none_of_the_above?: boolean | null,
>   weighted_voting?: boolean | null,
>   current_outcome_id?: number | null
> }
> ```

***

## Reports

### get

`reports.get`

Generate a participation report (overview, per-person, or per-country counts) for the key user's groups

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.reports.get({ section: 'users', group_scope: 'custom', group_ids: [12], start_month: '2026-01', end_month: '2026-09' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `section` | `base \| users \| countries` | No | Report section; `users` gives per-person activity rows. |
| `group_scope` | `custom \| my` | No | `my` (all your groups) or `custom` (the `group_ids`). |
| `group_ids` | `number[]` | No | Groups to report on when `group_scope` is `custom`. |
| `start_month` | `string` | No | First month (YYYY-MM); defaults to 12 months ago. |
| `end_month` | `string` | No | Last month (YYYY-MM); defaults to this month. |
| `interval` | `day \| week \| month \| year` | No | Interval for the `base` section. |
| `member_type` | `delegate` | No | With `section: users`, return only current delegates. |

group\_ids outside the key user's memberships are ignored. Anonymous polls are left out of per-person voting counts.

**Output:** `Record<string, any>`

***

## Search

### query

`search.query`

Search visible discussions, comments, polls, votes, and outcomes; up to 20 results

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.search.query({ query: 'quarterly planning', types: ['Discussion'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | No | Search text; exact and fuzzy matches. |
| `group_id` | `number` | No | Restrict to one visible group. |
| `org_id` | `number` | No | Restrict to a parent group and its subgroups; 0 for direct discussions. |
| `types` | `(Discussion \| Comment \| Poll \| Stance \| Outcome)[]` | No | Restrict to these result types. |
| `tag` | `string` | No | Restrict to topics with this tag. |
| `author_id` | `number` | No | Restrict to one author; without `query`, returns that author's recent activity. |
| `order` | `authored_at_desc` | No | Order by authoring time, newest first. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

Returns at most 20 results with no paging. author\_id without a query returns that author's recent activity.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `search_results` | `object[]` | Yes | — |

> [accordion] search\_results full type
>
> ```ts theme={null}
> {
>   id?: number | string | null,
>   searchable_type?: string | null,
>   searchable_id?: number | null,
>   highlight?: string | null,
>   group_id?: number | null,
>   group_name?: string | null,
>   discussion_key?: string | null,
>   poll_key?: string | null,
>   author_id?: number | null,
>   author_name?: string | null,
>   authored_at?: string | null,
>   tags?: string[] | null
> }[]
> ```

***

## Server

### groups.list

`server.groups.list`

Self-hosted Server API: list every group on the install, private ones included (server key)

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.server.groups.list({ limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Records per page; default and maximum 50. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `groups` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] groups full type
>
> ```ts theme={null}
> {
>   id: number,
>   key?: string | null,
>   name?: string | null,
>   handle?: string | null,
>   parent_id?: number | null,
>   group_privacy?: string | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   total?: number | null
> }
> ```

***

### memberships.list

`server.memberships.list`

Self-hosted Server API: list a group's memberships and pending invitations with emails (server key)

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.server.memberships.list({ group_id: 12 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group whose memberships to list. Required. |
| `limit` | `number` | No | Records per page; default and maximum 50. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `memberships` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] memberships full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   user_id?: number | null,
>   user_email?: string | null,
>   user_name?: string | null,
>   admin?: boolean | null,
>   delegate?: boolean | null,
>   accepted_at?: string | null,
>   pending?: boolean | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   total?: number | null
> }
> ```

***

### memberships.revoke

`server.memberships.revoke`

Self-hosted Server API: revoke a membership in its group and subgroups (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.memberships.revoke({ id: 9 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The membership id to revoke. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### memberships.sync

`server.memberships.sync`

Self-hosted Server API: invite emails to a group and optionally revoke everyone not listed (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.memberships.sync({ group_id: 12, emails: ['ada@example.org'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group to sync. |
| `emails` | `string[]` | Yes | Email addresses to invite. New addresses get unverified accounts and invitations. |
| `remove_absent` | `boolean` | No | Revoke members (group and subgroups) whose email is not listed. An empty list removes everyone. |

Self-hosted, server key. remove\_absent: true revokes everyone not listed in the group and its subgroups; an empty list removes everyone.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `added_emails` | `string[] \| null` | No | — |
| `removed_emails` | `string[] \| null` | No | — |

***

### memberships.update

`server.memberships.update`

Self-hosted Server API: grant or remove a member's admin and delegate roles (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.memberships.update({ id: 9, admin: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The membership id. |
| `admin` | `boolean` | No | Grant or remove group admin. |
| `delegate` | `boolean` | No | Grant or remove delegate. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `membership` | `object` | Yes | — |

> [accordion] membership full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   user_id?: number | null,
>   user_email?: string | null,
>   user_name?: string | null,
>   admin?: boolean | null,
>   delegate?: boolean | null,
>   accepted_at?: string | null,
>   pending?: boolean | null
> }
> ```

***

### users.create

`server.users.create`

Self-hosted Server API: create an unverified account without sending an invitation (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.users.create({ email: 'ada@example.org', name: 'Ada' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | Email address. Required. |
| `name` | `string` | No | Display name. |
| `username` | `string` | No | Username; must be unique. |
| `is_admin` | `boolean` | No | Make the user an instance admin. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.deactivate

`server.users.deactivate`

Self-hosted Server API: queue a user deactivation; success means queued, so read the user again and check active is false (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.deactivate({ id: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |

Self-hosted, server key. Loomio queues the deactivation and answers before the job runs, so success: true and user.active: true can come back together. Read the user again and check active is false before treating offboarding as done.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.deactivateByIdentity

`server.users.deactivateByIdentity`

Self-hosted Server API: queue deactivation of a user found by external identity; read again and check active is false (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.deactivateByIdentity({ identity_type: 'saml', uid: 'ada-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |

Self-hosted, server key. Queued like server.users.deactivate: read the user again and check active is false.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.delete

`server.users.delete`

Self-hosted Server API: permanently delete a user and their records (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.delete({ id: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |

Self-hosted, server key. Permanent: the user and associated records are deleted by a background job.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### users.deleteByIdentity

`server.users.deleteByIdentity`

Self-hosted Server API: permanently delete a user found by external identity (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.deleteByIdentity({ identity_type: 'saml', uid: 'ada-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### users.get

`server.users.get`

Self-hosted Server API: read one user account by id (server key)

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.server.users.get({ id: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.getByIdentity

`server.users.getByIdentity`

Self-hosted Server API: find a user by external identity provider and uid (server key)

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.server.users.getByIdentity({ identity_type: 'saml', uid: 'ada-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.list

`server.users.list`

Self-hosted Server API: list every user account with emails and identities (server key)

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.server.users.list({ is_admin: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `is_admin` | `boolean` | No | Only instance admins (true) or only non-admins (false). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `users` | `object[]` | Yes | — |

> [accordion] users full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }[]
> ```

***

### users.reactivate

`server.users.reactivate`

Self-hosted Server API: reactivate a deactivated user (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.users.reactivate({ id: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.reactivateByIdentity

`server.users.reactivateByIdentity`

Self-hosted Server API: reactivate a user found by external identity (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.users.reactivateByIdentity({ identity_type: 'saml', uid: 'ada-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.redact

`server.users.redact`

Self-hosted Server API: irreversibly remove a user's identifying data, keeping their content (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.redact({ id: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |

Self-hosted, server key. Irreversibly removes identifying data while keeping the user's contributions.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### users.redactByIdentity

`server.users.redactByIdentity`

Self-hosted Server API: irreversibly redact a user found by external identity (server key)

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.server.users.redactByIdentity({ identity_type: 'saml', uid: 'ada-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### users.update

`server.users.update`

Self-hosted Server API: change a user's name, username, email, or admin flag (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.users.update({ id: 5, name: 'Ada L.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The user id. |
| `name` | `string` | No | Display name. |
| `username` | `string` | No | Username; must be unique. |
| `email` | `string` | No | Email address. |
| `is_admin` | `boolean` | No | Instance admin flag. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

### users.updateByIdentity

`server.users.updateByIdentity`

Self-hosted Server API: update a user found by external identity (server key)

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.server.users.updateByIdentity({ identity_type: 'saml', uid: 'ada-1', name: 'Ada L.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_type` | `string` | Yes | External identity provider, e.g. `saml` or `oauth`. |
| `uid` | `string` | Yes | The user's id at that provider. |
| `name` | `string` | No | Display name. |
| `username` | `string` | No | Username; must be unique. |
| `email` | `string` | No | Email address. |
| `is_admin` | `boolean` | No | Instance admin flag. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | Yes | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string | null,
>   username?: string | null,
>   email?: string | null,
>   is_admin?: boolean | null,
>   active?: boolean | null,
>   deactivated_at?: string | null,
>   identities?: {
>     id: number,
>     identity_type?: string | null,
>     uid?: string | null,
>     email?: string | null,
>     name?: string | null
>   }[] | null
> }
> ```

***

## Threads

### get

`threads.get`

Read one thread record by topic id, with its discussion or poll in the related arrays

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.threads.get({ topic_id: 55 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic_id` | `number` | Yes | The thread id, which is its `topic_id`. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread` | `object` | Yes | Thread metadata. The thread title is not on this record; join the related `discussions` (or `polls`) array on `topicable_id`. |

> [accordion] thread full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   items_count?: number | null,
>   replies_count?: number | null,
>   active_polls_count?: number | null,
>   last_activity_at?: string | null,
>   discarded_at?: string | null,
>   locked_at?: string | boolean | null,
>   locker_id?: number | null,
>   pinned_at?: string | boolean | null,
>   topicable_id?: number | null,
>   topicable_type?: string | null,
>   has_anonymous_polls?: boolean | null,
>   tags?: string[] | null,
>   topic_reader_id?: number | null,
>   last_read_at?: string | boolean | null
> }
> ```

***

### items

`threads.items`

Read one thread timeline in sequence order: comments, polls, votes, and outcomes as one event stream

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.threads.items({ topic_id: 55, limit: 100, compact: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic_id` | `number` | Yes | The thread id, which is its `topic_id`. |
| `limit` | `number` | No | Records per page, capped at 500; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

Items come back in ascending sequence order and cap limit at 500. Comments, polls, votes, and outcomes ride in related arrays: choose the array by itemable\_type, then match itemable\_id within it (a comment and a poll can share an id).

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id: number,
>   sequence_id?: number | null,
>   position?: number | null,
>   depth?: number | null,
>   child_count?: number | null,
>   kind?: string | null,
>   topic_id?: number | null,
>   created_at?: string | null,
>   itemable_id?: number | null,
>   itemable_type?: string | null,
>   pinned?: boolean | null,
>   pinned_title?: string | null,
>   parent_id?: number | null,
>   actor_id?: number | null,
>   position_key?: string | null,
>   change_note?: string | null,
>   tags?: string[] | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### list

`threads.list`

List the threads the key user can see, ordered by latest activity, across all groups

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.threads.list({ limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Records per page; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |
| `compact` | `boolean` | No | Send compact=1: omit bulky related topics, groups, parents, memberships, reactions, tags, and translations. |
| `exclude_types` | `string[]` | No | Singular related record types to omit, e.g. \["group", "reaction"]. The primary records always stay. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `threads` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] threads full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   items_count?: number | null,
>   replies_count?: number | null,
>   active_polls_count?: number | null,
>   last_activity_at?: string | null,
>   discarded_at?: string | null,
>   locked_at?: string | boolean | null,
>   locker_id?: number | null,
>   pinned_at?: string | boolean | null,
>   topicable_id?: number | null,
>   topicable_type?: string | null,
>   has_anonymous_polls?: boolean | null,
>   tags?: string[] | null,
>   topic_reader_id?: number | null,
>   last_read_at?: string | boolean | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### markdown

`threads.markdown`

Export one thread as a single markdown document; needs export permission on the thread

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.threads.markdown({ topic_id: 55 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic_id` | `number` | Yes | The thread id, which is its `topic_id`. |

Requires export permission on the thread; the thread's whole visible content comes back as one document under markdown.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `markdown` | `string` | Yes | — |

***

## Webhooks

### check

`webhooks.check`

Ask Loomio to send a test message to a webhook destination URL; success does not confirm delivery

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.webhooks.check({ group_id: 12, server: 'https://hooks.example.org/loomio/unguessable-token' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | A group where the key user is an admin. |
| `server` | `string` | Yes | Destination URL that receives the test message. |

Asks Loomio to send a test message (Slack format) to the URL. Loomio answers an empty 200 even when delivery fails, so the plugin returns \{ accepted: true }; confirm receipt at the destination.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accepted` | `true` | Yes | Loomio answered its empty 200. It does not confirm delivery; check the destination. |

***

### create

`webhooks.create`

Create an outgoing webhook or chat integration that posts group events to a URL; group admin only

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.webhooks.create({ group_id: 12, name: 'Planning system', kind: 'webhook', webhook_kind: 'markdown', server: 'https://hooks.example.org/loomio/unguessable-token', event_kinds: ['new_discussion', 'outcome_created'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group; the key user must be a group admin. |
| `name` | `string` | Yes | Admin-facing name. |
| `kind` | `webhook \| matrix` | Yes | `webhook` for an outgoing webhook, `matrix` for Matrix (`server` is then the homeserver URL, with `access_token` and `channel`). |
| `webhook_kind` | `markdown \| slack \| discord \| microsoft \| webex` | No | Payload format; `markdown` suits a general endpoint. |
| `server` | `string` | Yes | Destination URL; must be public HTTPS. Treat it as a secret. |
| `event_kinds` | `(new_discussion \| discussion_edited \| new_comment \| poll_created \| poll_edited \| poll_closing_soon \| poll_expired \| poll_closed_by_user \| poll_reopened \| outcome_created \| outcome_updated \| outcome_review_due \| stance_created \| stance_updated)[]` | No | Events sent automatically. |
| `notification_only` | `boolean` | No | Send only the notification headline. |
| `access_token` | `string` | No | Matrix only: the bot account access token. A secret; Loomio never returns it. |
| `channel` | `string` | No | Matrix only: the room id to post in, e.g. `!abc123:matrix.org`. |

kind: matrix needs server (the homeserver URL), access\_token and channel (the room id). Loomio never returns the access token.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot` | `object` | Yes | — |

> [accordion] chatbot full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   name?: string | null,
>   kind?: string | null,
>   webhook_kind?: string | null,
>   server?: string | null,
>   channel?: string | null,
>   event_kinds?: string[] | null,
>   notification_only?: boolean | null
> }
> ```

***

### delete

`webhooks.delete`

Delete a webhook or chat integration; future deliveries stop

**Risk:** `destructive`

```ts theme={null}
await corsair.loomio.api.webhooks.delete({ id: 456 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The webhook id to delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| string` | Yes | — |

***

### list

`webhooks.list`

List a group's outgoing webhooks and chat integrations, with destination URLs; group admin only

**Risk:** `read`

```ts theme={null}
await corsair.loomio.api.webhooks.list({ group_id: 12 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_id` | `number` | Yes | The group; the key user must be a group admin. |
| `limit` | `number` | No | Records per page, capped at 500; Loomio defaults to 50 when omitted. |
| `offset` | `number` | No | Records to skip for this page; Loomio defaults to 0. |

Group admin only. The response includes destination URLs, which are secrets.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbots` | `object[]` | Yes | — |
| `meta` | `object` | Yes | — |
| `next_offset` | `number` | No | — |

> [accordion] chatbots full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   name?: string | null,
>   kind?: string | null,
>   webhook_kind?: string | null,
>   server?: string | null,
>   channel?: string | null,
>   event_kinds?: string[] | null,
>   notification_only?: boolean | null
> }[]
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   root?: string | null,
>   total?: number | null
> }
> ```

***

### update

`webhooks.update`

Change a webhook's name, destination, format, or events; group admin only

**Risk:** `write`

```ts theme={null}
await corsair.loomio.api.webhooks.update({ id: 456, event_kinds: ['new_discussion'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The webhook id. |
| `name` | `string` | No | Admin-facing name. |
| `kind` | `webhook \| matrix` | No | `webhook` for an outgoing webhook, `matrix` for Matrix (`server` is then the homeserver URL, with `access_token` and `channel`). |
| `webhook_kind` | `markdown \| slack \| discord \| microsoft \| webex` | No | Payload format; `markdown` suits a general endpoint. |
| `server` | `string` | No | Destination URL; must be public HTTPS. Treat it as a secret. |
| `event_kinds` | `(new_discussion \| discussion_edited \| new_comment \| poll_created \| poll_edited \| poll_closing_soon \| poll_expired \| poll_closed_by_user \| poll_reopened \| outcome_created \| outcome_updated \| outcome_review_due \| stance_created \| stance_updated)[]` | No | Events sent automatically. |
| `notification_only` | `boolean` | No | Send only the notification headline. |
| `access_token` | `string` | No | Matrix only: the bot account access token. A secret; Loomio never returns it. |
| `channel` | `string` | No | Matrix only: the room id to post in, e.g. `!abc123:matrix.org`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot` | `object` | Yes | — |

> [accordion] chatbot full type
>
> ```ts theme={null}
> {
>   id: number,
>   group_id?: number | null,
>   name?: string | null,
>   kind?: string | null,
>   webhook_kind?: string | null,
>   server?: string | null,
>   channel?: string | null,
>   event_kinds?: string[] | null,
>   notification_only?: boolean | null
> }
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.