CloudrawAPI v0
Menu

Guide

Pagination

Lists answer { "items": [...] }. Lists that can grow without bound — the audit log, access history, support cases in polling mode — are paged with an opaque cursor.

Cursor paging

  1. Call the list without cursor. Set limit if you want a different page size (each operation documents its maximum).
  2. If the answer has a non-null next_cursor, call again with ?cursor=<next_cursor> and the same filters.
  3. Stop when next_cursor is null.

Cursors are opaque: pass them back unchanged and do not build or store them long-term. A cursor from another list, or a changed one, answers 400 invalid-cursor. The audit log is newest-first and its pages stay stable while new entries arrive.

Python
def audit_entries(s, tenant, **filters):
    params = {"limit": 1000, **filters}
    while True:
        page = s.get(f"{BASE}/v0/tenants/{tenant}/audit", params=params, timeout=30).json()
        yield from page["items"]
        if not page.get("next_cursor"):
            return
        params["cursor"] = page["next_cursor"]

for e in audit_entries(s, TENANT, since="2026-10-01T00:00:00Z"):
    print(e["at"], e["action"], e.get("actor"))
Node.js
async function* auditEntries(tenant, filters = {}) {
  const params = new URLSearchParams({ limit: "1000", ...filters });
  for (;;) {
    const r = await fetch(`${BASE}/v0/tenants/${tenant}/audit?${params}`, {
      headers: { Authorization: `Bearer ${process.env.CLOUDRAW_TOKEN}` },
    });
    const page = await r.json();
    yield* page.items;
    if (!page.next_cursor) return;
    params.set("cursor", page.next_cursor);
  }
}
PowerShell
$uri = "https://cdapi.cloudraw.com/v0/tenants/$tenant/audit?limit=1000"
$cursor = $null
do {
  $u = if ($cursor) { "$uri&cursor=$([uri]::EscapeDataString($cursor))" } else { $uri }
  $page = Invoke-RestMethod -Uri $u -Headers @{ Authorization = "Bearer $env:CLOUDRAW_TOKEN" }
  $page.items | ForEach-Object { "$($_.at) $($_.action)" }
  $cursor = $page.next_cursor
} while ($cursor)
curl
curl -sS "https://cdapi.cloudraw.com/v0/tenants/$CLOUDRAW_TENANT/audit?limit=1000" \
  -H "Authorization: Bearer $CLOUDRAW_TOKEN"
# then, with the next_cursor from the answer:
curl -sS "https://cdapi.cloudraw.com/v0/tenants/$CLOUDRAW_TENANT/audit?limit=1000&cursor=YTM6MTI4OTA" \
  -H "Authorization: Bearer $CLOUDRAW_TOKEN"

Bounded lists

Lists bounded by your plan — people, groups, devices, connectors, apps, rules, webhooks — return every item in one answer. Their next_cursor (when present) is always null; write your client to follow it anyway, so it keeps working if one of them becomes paged later.

Bulk export

To copy the whole audit log, use GET …/audit/export (newline-delimited JSON, up to 10,000 entries per call) or stream it continuously to your SIEM (Log streaming).