Loomio API /api/b2
/api/b2 was released in October 2023. It will replace the previous /api/b1
Your API key is:
This user account is a human. You may want to
setup a bot account
for API requests.
create discussion
example
curl -X POST -H 'Content-Type: application/json' -d '{"group_id": 123, "title":"example thread", "recipient_emails":[""], "api_key": ""}' https://www.loomio.com/api/b2/discussions
params
group_id | group where thread will exist |
title | title of the thread (required) |
description | context for the thread (optional) |
description_format | string. either 'md' or 'html' (optional, default: md) |
recipient_audience | string 'group' or null. if 'group' whole group will be notified about the new thread (optional) |
recipient_user_ids | array of user ids to notify or invite to the thread (optional) |
recipient_emails | array of email addresses of people to invite to the thread (optional) |
recipient_message | string. message to include in the email invitation (optional) |
show discussion
Fetch a discussion using the discussion id (an integer) or key (a string) using the following request format
example
curl https://www.loomio.com/api/b2/discussions/abc123?api_key=
create poll
example
curl -X POST -H 'Content-Type: application/json' -d '{"group_id": 123, "title":"example poll", "poll_type": "proposal", "options": ["agree", "disagree"], "closing_at": "2024-11-28T11:00:00Z", "recipient_emails":[""], "api_key": ""}' https://www.loomio.com/api/b2/polls
params
group_id | integer. optional. default: null. id of group for poll. If discussion_id is passed, group_id is ignored. |
discussion_id | integer. optional. default: null. id of discussion thread to add this poll to. |
title | string. required. title of the poll |
poll_type | string. required. values: 'proposal', 'poll', 'count', 'score', 'ranked_choice', 'meeting', 'dot_vote' |
details | string. optional. the body text of the poll |
details_format | string. optional. default: md. values: 'md' or 'html'. |
options | array of strings. If poll_type is proposal then valid values are 'agree', 'disagree', 'abstain', 'block'. If poll_type is meeting then a provide iso8601 date or datetime strings '2021-02-01' or '2022-02-15T23:32:39Z'. For all other poll_types, any string is valid. |
closing_at | iso8601 string or null. default: null. Specify when the poll closes with an iso8601 string such as '2024-11-28T11:00:00Z'. If null then voting is disabled and poll is considered "Work in progress". |
specified_voters_only | boolean. optional. default: false. true: only specified people can vote, false: everyone in the group will be invited to vote |
hide_results | string. optional. default: 'off'. values: 'off', 'until_vote', 'until_closed'. allow voters to see the results before the poll has closed |
shuffle_options | boolean. default false. display options to voters in random order. |
anonymous | boolean. optional. default: false. true: hide identities of voters. |
recipient_audience | string 'group' or null. optional. default: null. if 'group' whole group will be notified about the new thread. |
notify_on_closing_soon | string. optional. default: 'nobody'. values: 'nobody', 'author', 'undecided_voters' or 'voters'. specify the who to send a reminder notification to, 24 hours before the poll closes. |
recipient_user_ids | array of user ids to notify or invite |
recipient_emails | array of email addresses of people to invite to vote |
recipient_message | message to include in the email invitation |
notify_recipients | boolean. default false. false: add people to a poll without sending notifications. true: everyone invited (in this request) will get a notification email. |
show poll
Fetch a poll using the poll id (an integer) or key (a string)
example
curl https://www.loomio.com/api/b2/polls/abc123?api_key=
list memberships
https://www.loomio.com/api/b2/memberships?api_key=&group_id=123curl https://www.loomio.com/api/b2/memberships?api_key=&group_id=123
manage memberships
send a list of emails. it will invite all the new email addresses to the group.
curl -X POST -H 'Content-Type: application/json' -d '{"group_id": 123, "emails":["[email protected]"], "api_key": ""}' https://www.loomio.com/api/b2/memberships
if you pass remove_absent=1 then any members of the group who were not included in the list will be removed from the group. be careful, you could remove everyone in your group!
curl -X POST -H 'Content-Type: application/json' -d '{"group_id": 123, "emails":["[email protected]"], "remove_absent": 1, "api_key": ""}' https://www.loomio.com/api/b2/memberships
params
emails | array of strings. required. email addresses of people to invite into the group |
remove_absent | boolean. If true, remove anyone from the group who's email is not present in the list |
this returns an object with {added_emails: ["[email protected]"], removed_emails: ["[email protected]"]}.