GuidesWorking with the API
Change feed
GET /v1/changes keeps your copy of Company files in step: list everything once, then ask only for what changed.
It needs a live key with files:read.
First: list everything
Call it without a cursor. You get every folder and file, parents before children, 500 at a time. While has_more is true, call again with page set to the answer’s next_page. The last page carries a cursor: keep it.
curl "https://api.skanything.io/v1/changes" \ -H "Authorization: Bearer $SA_LIVE_KEY"
Then: ask what changed
Call with ?cursor=. Each item is an upsert (with the item) or a remove (with a reason: trashed or out_of_scope). Every answer has a new cursor — store it; while has_more is true, call again straight away.
{
"items": [
{ "op": "upsert", "id": "7d3f1c9a-2b6e-4a8d-9c0f-5e1b3d7a9c2e", "type": "file", "item": { "name": "Lease agreement.pdf", "…": "…" } },
{ "op": "remove", "id": "b2e6a0d4-8c1f-4e3a-9b7d-2f5c8e1a4d6b", "type": "folder", "reason": "trashed" }
],
"cursor": "…",
"has_more": false,
"reset": false
}- Changes can repeat; applying an
upserttwice is harmless. reset: true(with no cursor) means your cursor no longer works — the key’s access changed, or the cursor is too old. Throw your copy away and list everything again.- Poll at a pace that suits you, or wake up on file and folder webhooks and read the feed then.