Skip to the page

Using the API

Pagination and logs

Most lists answer in full. The two records that grow without end page with a cursor, and logs are read on from where you stopped.

Lists with a cursor

OperationOrderAsk withRead on with
activity.listNewest firstlimit 1 to 1000 (default 100)before = the answer's next
organisations.auditOldest firstlimit 1 to 5000 (default 1000)after = the answer's next

Both answer { "events": [...], "next": ... }; next is null on the last page. Treat the cursor as opaque. Both also take format=csv for a file of the whole record at once, and activity takes filters (environment, product, actor, action, outcome, since, until) that hold across pages.

Paging activity
# The newest 100 events
curl "https://api.rykloud.com/v1/organisations/$ORG_ID/activity?limit=100" \
  -H "Authorization: Bearer $RYKLOUD_TOKEN"
# {"events": [...], "next": 81723}

# The 100 before them
curl "https://api.rykloud.com/v1/organisations/$ORG_ID/activity?limit=100&before=81723" \
  -H "Authorization: Bearer $RYKLOUD_TOKEN"
# ... until "next" is null

Logs as they grow

OperationStart withThen
services.buildLogsafter=0Up to 1000 lines a call; pass the answer's next as after.
resources.logsA service: tail (default 500)Pass the answer's cursor as after for newer lines only.
environments.logssince (default 1h) and limit (up to 5000)No cursor; truncated says lines were left out. Narrow by component or level.

Environment logs are read inside the environment, so each call takes a moment; poll every ten seconds or so, not faster. rykloud services logs --follow and rykloud services build-logs do this for you.

Lists with a fixed size

A few lists answer the newest items only: changes (100), builds (50), deploys (200), product transfers (200), CLI sessions (100), notifications (50), terminal sessions (limit up to 200, default 50). Every other list answers in full.