API and MCP
Automate Provenby from CI, scripts or an AI assistant. Authentication, limits, errors and the MCP server.
Everything in the console is available over a REST API at https://provenby.com/v1. The full, interactive reference is at /docs/api (OpenAPI schema: /openapi.json).
Authenticate
Create an API key under Settings → API keys (owners and admins). A key looks like sk_…, is shown once, and is stored by us only as a hash. Send it either way:
curl https://provenby.com/v1/targets -H "Authorization: Bearer sk_..."
curl https://provenby.com/v1/targets -H "X-API-Key: sk_..."
A key carries a role (admin, operator or viewer, never above your own) and can be narrowed further:
- Expiry:
expires_in_days; no expiry if left empty. - IP allowlist:
allowed_cidrs, for example your CI runners' range. - Scopes:
resource:read,resource:write,resource:*or*, where the resource is the first part of the path (targets,runs,results,reports, …). A key withresults:readcan read findings and nothing else.
Revoke a key with DELETE /v1/api-keys/{id}. Create keys over the API with POST /v1/api-keys.
Run a test from CI
Start a pentest after a deploy, then poll until it finishes:
API=https://provenby.com/v1
AUTH="Authorization: Bearer $PROVENBY_KEY"
RUN=$(curl -s -X POST $API/runs -H "$AUTH" -H "Content-Type: application/json" \
-d '{"target_id": "tgt_...", "tier": "agent"}' | jq -r .id)
while true; do
STATE=$(curl -s $API/runs/$RUN -H "$AUTH" | jq -r .state)
case "$STATE" in completed|failed|cancelled) break ;; esac
sleep 30
done
curl -s "$API/results?target_id=tgt_...&state=open&severity=high" -H "$AUTH"
Use "tier": "light" for a free quick check. Instead of polling, you can receive run.completed with a webhook.
Limits
- Rate limit: 1,200 requests per minute per workspace. Over it, the API answers
429with aRetry-Afterheader. - Sign-in endpoints: limited separately, per IP address and per account.
- Concurrent runs: 2 per workspace by default; more runs queue. Ask support to raise it.
Lists and pagination
List endpoints return {"data": ……………………, "next_cursor": "..."}, newest first. Pass ?cursor=<next_cursor> for the next page and ?limit= (up to 200) to change the page size. next_cursor is null on the last page.
Errors
Errors share one shape, with a stable code you can match on and, for validation errors, the field at fault:
{"error": {"code": "target_unverified", "message": "Target is not verified. Verify ownership before launching a run."}}
| Status | Meaning |
|---|---|
| 401 | Missing, invalid, expired or revoked credential. |
| 403 | The credential is valid but its role, scope or IP allowlist doesn't permit this. |
| 404 | Not found, or not in your workspace. |
| 409 | Conflicts with the current state, for example starting a run on an unverified target. |
| 422 | A field is missing or invalid; see field. |
| 429 | Rate limited; retry after Retry-After seconds. |
MCP (for AI assistants)
Provenby is an MCP server (Model Context Protocol, Streamable HTTP with JSON responses) at https://provenby.com/v1/mcp. Point an MCP-capable assistant at it with an API key in the Authorization: Bearer header. It offers these tools:
| Tool | What it does | Scope it needs |
|---|---|---|
list_targets | List your targets. | targets:read |
trigger_run | Start a run on a verified, authorized target. | runs:write |
list_runs | List runs, newest first. | runs:read |
get_run | Get one run. | runs:read |
list_results | List findings, by target, severity or state. | results:read |
get_report | The aggregate findings report, optionally for one target. | reports:read |
The key's role, scopes, expiry and IP allowlist apply to MCP exactly as to the REST API. For an assistant that should only read findings, give it a results:read key that expires.