Batch Operations
Read or update many secrets in a single request. Useful when an application needs several credentials at startup, or when a config loader wants a whole subtree at once.
Base path: /v1/secrets/batch/
Batch read#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Partial success is the default behavior — missing or denied paths show up in errors, everything else is in secrets. Pass "fail_fast": true to abort the whole batch on first error.
Options#
| Option | Description |
|---|---|
include_metadata |
Include full metadata in each result (default: false) |
fail_fast |
Abort on first error (default: false) |
version |
Read all paths at a specific version. Useful for coordinated config snapshots. |
Limits#
- Maximum 100 paths per request.
- Each path is evaluated against policies individually — a batch doesn't bypass access control.
- A batch read counts as 1 call against the batch-read rate limit and N calls against the read rate limit (where N is the number of paths successfully returned).
Batch metadata#
Like batch read, but returns metadata only — no values. Policies still apply, but secrets:list is sufficient; full secrets:read is not required.
1 2 3 4 5 6 7 | |
With expand_wildcards: true, path patterns are expanded server-side to the actual matching paths.
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Batch write#
Not supported. Writes are explicitly one-at-a-time. Two reasons:
- Atomicity. Batch writes imply "all or nothing" — ScaiVault has no distributed transaction to make that guarantee cleanly across versioning, policies, and audit.
- Auditability. Per-write audit entries make it obvious who wrote what when. A single batch entry hides what changed.
If you need to seed many secrets, loop over PUT /v1/secrets/{path}. The rate limits allow bursts of ~100/min per identity.
Startup pattern#
A service that needs N secrets at startup:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
With fail_fast: true, any missing or denied secret fails the service startup loudly — which is what you want in this situation. A service that starts partially healthy is worse than one that fails to start.
When to use batch vs individual reads#
| Use batch | Use individual |
|---|---|
| Known fixed set of paths loaded together | Paths discovered at runtime |
| Startup / config loading | Per-request lookups (with cache) |
| Inventory and dashboards (metadata variant) | Long-lived connections with rotation subscription |
Batch isn't always faster — ScaiVault validates each path against policies and fetches each from storage. For a single path, the overhead is indistinguishable from a direct GET.
What's next#
- Managing Secrets — the single-secret API.
- Your First Integration — realistic loading patterns.
- Python SDK —
client.secrets.batch_read(paths).