Quickstart
This reads a group’s details and its upcoming events with a group key, which is the quickest way in.
1. Make a group key
Section titled “1. Make a group key”A group owner:
- Opens the group in Grouperly, then Settings → Developers.
- Under API access, creates a key with a name (“Calendar sync”) and the scopes it needs. For this quickstart,
readis enough. - Copies the key. It starts
gk_, and it’s shown only once.
A key belongs to one group. It acts as the leader who made it: if that person stops being a leader, the key stops working.
2. Find the group’s id
Section titled “2. Find the group’s id”It’s in the group’s address in Grouperly: https://app.grouperly.com/groups/<groupId>.
3. Call the API
Section titled “3. Call the API”export GROUPERLY_KEY=gk_...export GROUP_ID=...
# The groupcurl -s https://app.grouperly.com/api/v2/groups/$GROUP_ID \ -H "Authorization: Bearer $GROUPERLY_KEY"
# Events from today on, with their RSVP countscurl -s "https://app.grouperly.com/api/v2/groups/$GROUP_ID/events?from=$(date -u +%Y-%m-%dT00:00:00Z)&include=rsvpCounts" \ -H "Authorization: Bearer $GROUPERLY_KEY"A list comes back as { "items": [...], "nextCursor": "..." }. Pass nextCursor back as ?cursor= until it’s null. See Conventions.
With the SDK
Section titled “With the SDK”import { createGrouperlyClient, unwrap, allItems } from '@grouperly/sdk';
const grouperly = createGrouperlyClient({ token: process.env.GROUPERLY_KEY });
const group = unwrap( await grouperly.GET('/groups/{groupId}', { params: { path: { groupId } } }));
for await (const event of allItems((cursor) => grouperly.GET('/groups/{groupId}/events', { params: { path: { groupId }, query: { from: new Date().toISOString(), include: 'rsvpCounts', cursor } }, }))) { console.log(event.name, event.startsAt);}- Every path, parameter and response is typed from the OpenAPI document.
unwrapreturns the data, or throws aGrouperlyErrorwith the API’scode,statusandparameter.allItemsfollowsnextCursorfor you.
- What each scope allows: Authentication.
- Being told when something changes, instead of polling: webhooks are still on v1 for now. A key with the
webhooks:managescope registers them withPOST https://app.grouperly.com/api/v1/groups/{groupId}/webhooks, and Settings → Developers lists them. - Every endpoint: the API reference.