Skip to content
CLUP.life

Developers Examples

Examples in curl, JavaScript and Python

Copy-and-paste examples for the CLUP.life API: fetch events, page through lists, create an event, handle errors — in curl, JavaScript and Python.

The examples read the key from the environment variable CLUP_API_KEY. Set it before running (export CLUP_API_KEY=clup_k_…). Your chosen language is kept across all pages.

Events in a period#

GET/ext/events

Events in a period

Areas: events:read

curl -H "Authorization: Bearer clup_k_…" \
  "https://api.clup.life/api/v1/ext/events?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z"

Paging through lists#

Lists (posts, announcements, tasks, members) return items and nextCursor. Keep calling with the cursor until it is null.

# erste Seite
curl -H "Authorization: Bearer $CLUP_API_KEY" \
  "https://api.clup.life/api/v1/ext/organizations/mein-verein/posts?limit=50"
# nächste Seite: den Wert von nextCursor einsetzen
curl -H "Authorization: Bearer $CLUP_API_KEY" \
  "https://api.clup.life/api/v1/ext/organizations/mein-verein/posts?limit=50&cursor=<nextCursor>"

Creating an event (organization key)#

POST/ext/organizations/{org}/events

Create an event

Areas: events:writePremium (organization key)

curl -X POST -H "Authorization: Bearer clup_k_…" \
  -H "Content-Type: application/json" \
  -d '{"title":"Sommerfest","startsAt":"2026-07-04T14:00:00Z","endsAt":"2026-07-04T20:00:00Z","visibility":"MEMBERS"}' \
  "https://api.clup.life/api/v1/ext/organizations/mein-verein/events"

Handling errors and retries#

Retry only on 429 (after Retry-After) and on 5xx (with growing back-off). All other 4xx are final: a retry changes nothing.

# --retry wiederholt bei 429/5xx automatisch; --retry-all-errors nicht verwenden (würde auch 4xx wiederholen)
curl --retry 3 --retry-delay 5 --fail-with-body \
  -H "Authorization: Bearer $CLUP_API_KEY" \
  "https://api.clup.life/api/v1/ext/me"

Exports#

iCal and CSV are exports for calendars and spreadsheets. The CSV files use a semicolon, UTF-8 with BOM and protect against formula injection (cells starting with =, +, - or @ are neutralized).

GET/ext/exports/events.ics

Events as iCal

Areas: exports:read

curl -H "Authorization: Bearer clup_k_…" \
  "https://api.clup.life/api/v1/ext/exports/events.ics?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z"
Examples in curl, JavaScript and Python · CLUP.life