API guides

Getting started

From an account to your first page of documents.

The API isn’t switched on in this environment yet. Everything below is accurate; the examples come from the published contract rather than a live read.

The Rivet API reads everything and, where the environment has writes enabled, writes documents too. It answers with the same documents and payment rollups your team already sees in the app, projected for your organization — never for the counterparty. Four steps get you from nothing to a page of documents.

1. Create an account

There is no separate developer account. A key acts as your organization, so it belongs to the organization your team already works in. Sign up the normal way; if your company is already on Rivet, ask an admin instead.

2. Mint a key

An organization admin opens Settings → Developers, names the key and picks its scopes. The secret appears once, on creation. Admins can also mint a key with their session token:

Create a key
From the published contract
curl -X POST "https://api.rivet.network/v1/keys" \
  -H "Authorization: Bearer <your admin session token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"Warehouse sync","scopes":["documents:read","payments:read"]}'
Staging mints keys that start with rk_test_ and only work against the staging host. Production mints rk_live_. A key from one environment is unknown to the other — that is the whole point of the prefix.

3. Your first request

Send the key as a bearer token. The key is your organization, so there is no organization id to pass and no way to ask for someone else’s data.

List documents
From the published contract
curl "https://api.rivet.network/v1/documents?type=invoice&limit=2" \
  -H "Authorization: Bearer rk_live_…"

Every response carries Rivet-Api-Version — the spec version it was produced under — and authenticated calls carry the rate-limit headers.

4. Read the whole list

Lists come back newest first with a next_cursor. Pass it back as cursor until it returns null:

Next page
From the published contract
curl "https://api.rivet.network/v1/documents?cursor=MTc1NjM…" \
  -H "Authorization: Bearer rk_live_…"

Where to go next