Testing APIs with Swagger UI
CredVault ships an interactive OpenAPI explorer (Swagger UI). You can call real endpoints from the browser, see responses, and copy working request shapes — no client code required.
Open the API explorer
Go to:
https://credvault.net/api-docs
Or from any CredVault page, open /api-docs on the same host.
You should see the CredVault API title, a server selector, and tagged public data endpoints. The machine-readable OpenAPI document is also available at /swagger.json.
If you still see a CredVault “Page not found” screen, the edge proxy has not been updated yet. After Caddy routes
/api-docsto the backend, this link works.
Before you test
- Create an API key in the dashboard (API Keys → Create New Key).
- Copy the key once (
cvk_…). It is only shown at creation time. - Grant at least the scopes you plan to try (
data:read,data:write,webhooks:manage, etc.).
Authorize Swagger
- Click Authorize (padlock) at the top of Swagger UI.
- Prefer ApiKeyAuth — paste your full key into the
X-API-Keyvalue field. - You can also use BearerAuth with
cvk_…as the bearer token (same key). - Click Authorize, then Close.
Every Try it out request will include that credential until you log out of the padlock dialog.
Try an endpoint
- Expand a path (for example
GET /api/v1/data/{collection}). - Click Try it out.
- Fill path/query fields (collection name, optional filters).
- Click Execute.
- Read the status code and JSON body below.
Quick smoke test
| Step | Action |
|---|---|
| 1 | Authorize with cvk_… |
| 2 | POST /api/v1/data/{collection} with a small JSON body |
| 3 | GET /api/v1/data/{collection} and confirm the document appears |
| 4 | GET /api/v1/data/{collection}/{id} with the returned _id |
What is documented here
The explorer focuses on the public data API mounted at /api/v1/data:
- Query / read documents
- Create, update, delete documents
- SQL-style LakeVault queries (
POST /sql) - Batch operations
- Webhook registration
Dashboard session routes (billing UI, admin, etc.) are not the primary surface in this explorer — use your cvk_… key against /api/v1/data/....
Curl equivalent
Swagger’s “Try it out” is the same request as:
curl -sS https://credvault.net/api/v1/data/users \
-H "X-API-Key: cvk_YOUR_KEY_HERE" \
-H "Content-Type: application/json"
Or with bearer style:
curl -sS https://credvault.net/api/v1/data/users \
-H "Authorization: Bearer cvk_YOUR_KEY_HERE"
Common responses
| Status | Meaning | What to do |
|---|---|---|
| 200 / 201 | Success | Use the JSON body |
| 401 | Missing or invalid key | Re-authorize; confirm the key starts with cvk_ |
| 403 | Key valid but scope too narrow | Add data:read / data:write / webhooks:manage |
| 404 | No active cluster or missing document | Create a cluster first, or check the id |
| 429 | Rate limited | Wait, then retry |