Getting started
The VaultLens REST API lets your own scripts and services do what the VaultLens app does: list your connected Knack apps, start syncs, run archives, download archive files and read records from your analytics copy. The same rules apply as in the app. Plan limits and your Knack API budget count for API calls too.
- Base URL:
https://api.vaultlens.studio/v1 - Format: JSON in and out (archive file downloads are CSV)
- Full endpoint list: the API reference, generated from the OpenAPI document at
GET /v1/openapi.json - Earlier scripts that use
https://vaultlens-studio.web.app/api/v1keep working; it’s the same API.
Create an API key
Only workspace owners and admins can manage API keys (see team and roles).
- In VaultLens, open Settings → API keys and click Create key.
- Fill in the form:
- Name: what uses the key, for example “Nightly report script”.
- Scopes: what the key may do (see below). Read is ticked by default.
- Apps: leave All apps, including ones connected later ticked, or untick it and pick the apps the key may use.
- Expires: Never, In 30 days, In 90 days or In 1 year. HIPAA workspaces don’t offer Never.
- Only from these IP addresses (optional): exact IPv4 or IPv6 addresses, or IPv4 ranges such as
198.51.100.0/24, separated by commas or spaces.
- Click Create key, then copy the key from the Copy your API key now dialog. It’s shown once. VaultLens keeps only a hash of it, so store it in a password manager or your secrets store.
Keys look like this:
vls_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
vls_, an 8-character id, _, and a 32-character secret. The first 12 characters (vls_XXXXXXXX) are the key’s prefix, which the API keys page shows so you can tell keys apart.
The examples in these guides read the key from an environment variable:
export VAULTLENS_API_KEY="vls_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Scopes
A key acts with an admin’s access, narrowed by its scopes. Pick the fewest the job needs.
| Scope | Label in the app | Allows |
|---|---|---|
read |
Read | Apps, schema, workflows, sync status, jobs, archive settings and runs, archived record lookup. No record values. |
write |
Write | Start clones and syncs, pause or resume live sync, create, change and delete archive settings, dry runs and test-mode archive runs. |
archive:run |
Run archives | Real archive runs that remove records from Knack or reset their flag. Needs write too. |
data:query |
Query data | Read records from the analytics copy, and download archive files. |
phi:read |
Read PHI | HIPAA workspaces only: needed on top of the other scopes to read record values. See HIPAA workspaces. |
The scope each endpoint needs is listed in the API reference. A call without it gets 403 PERMISSION_DENIED with a message naming the missing scope.
App, IP and expiry limits
- Apps. A key limited to some apps only sees those apps in
GET /appsandGET /jobs. Calling another app’s endpoints returns403 PERMISSION_DENIED(“This key can’t access that app.”). - IP addresses. A call from any other address returns
403 PERMISSION_DENIED(“This API key can’t be used from this IP address.”). Use the address your requests leave from, as seen from the internet. - Expiry. After the expiry date, calls return
401 UNAUTHENTICATED(“This API key has expired.”). Create a new key before then, or use Rotate.
On the API keys page, Rotate gives you a new key with the same settings, and Revoke turns a key off. Either way the old key stops working immediately. A key also stops working if the person who created it is removed from the workspace or is no longer an owner or admin.
Keyed endpoints don’t send CORS headers, so a browser page on another site can’t call them. Call the API from a server or script, and keep the key out of client-side code.
Your first call: who am I
GET /me returns the workspace, the key’s settings, the plan and the key’s rate limit. It needs the read scope and is the quickest way to check a key works.
curl
curl https://api.vaultlens.studio/v1/me \
-H "Authorization: Bearer $VAULTLENS_API_KEY"
Node
// Node 18+ (global fetch). Save as me.mjs and run: node me.mjs
const res = await fetch('https://api.vaultlens.studio/v1/me', {
headers: { Authorization: `Bearer ${process.env.VAULTLENS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.error.requestId})`);
console.log(body.workspace.name, body.key.scopes, body.rateLimitPerMinute);
Python
import os
import requests
res = requests.get(
"https://api.vaultlens.studio/v1/me",
headers={"Authorization": f"Bearer {os.environ['VAULTLENS_API_KEY']}"},
timeout=30,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
print(body["workspace"]["name"], body["key"]["scopes"], body["rateLimitPerMinute"])
A successful response:
{
"workspace": { "id": "Wk7dQ2mFz9LpT4xR8bN1", "name": "Acme", "hipaa": false },
"key": {
"id": "k1",
"name": "Reporting",
"prefix": "vls_a1B2c3D4",
"scopes": ["read"],
"appIds": null,
"expiresAt": null
},
"plan": { "id": "studio", "standing": "ok", "analytics": true, "archive": true },
"rateLimitPerMinute": 120
}
key.appIds is null when the key can use every app. plan.analytics and plan.archive say whether the workspace’s plan includes those features. A 401 UNAUTHENTICATED here means the key is missing, mistyped, revoked or expired.
List your apps
GET /apps lists the Knack apps connected to the workspace (only the key’s apps, if it’s limited). Every other app endpoint takes an app’s id as <appId>.
curl
curl https://api.vaultlens.studio/v1/apps \
-H "Authorization: Bearer $VAULTLENS_API_KEY"
Node
const res = await fetch('https://api.vaultlens.studio/v1/apps', {
headers: { Authorization: `Bearer ${process.env.VAULTLENS_API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const { data } = await res.json();
for (const app of data) console.log(app.id, app.name, app.totalRecords);
Python
import os
import requests
res = requests.get(
"https://api.vaultlens.studio/v1/apps",
headers={"Authorization": f"Bearer {os.environ['VAULTLENS_API_KEY']}"},
timeout=30,
)
res.raise_for_status()
for app in res.json()["data"]:
print(app["id"], app["name"], app["totalRecords"])
Response (trimmed to one app):
{
"data": [
{
"id": "6b05a32b031b09796ccc7d52",
"name": "Sales CRM",
"knackAppId": "6b05a32b031b09796ccc7d52",
"timezone": "America/Denver",
"connectedAt": "2026-11-20T15:04:05.000Z",
"schemaStatus": "ready",
"schemaFetchedAt": "2026-11-20T15:04:31.000Z",
"objectCount": 12,
"totalRecords": 48210,
"apiDailyLimit": 2000,
"knackHost": "standard",
"credentialsRevoked": false
}
],
"nextCursor": null
}
Lists in this API share one shape: data holds the items and nextCursor is null on the last page. For lists that page (GET /jobs, GET /archive-runs, records), pass cursor=<nextCursor> to get the next page and limit to set the page size.
From here, GET /apps/<appId>/schema lists the app’s tables (Knack objects such as object_1) and fields, and GET /apps/<appId>/workflows shows what’s set up for analytics and archive.
Next steps
- Run a sync and wait for it to finish.
- Archive records through the API.
- Read the analytics copy with filters and incremental pulls.
- Receive webhooks instead of polling.
- Handle errors and rate limits.
- Connect an AI assistant instead of writing code: see VaultLens for AI.