Integrate · Guide
Inspect requests and events
Use request logs and events to see what your integration sent, what the API answered and what happened on your account. Every request made with your API keys or in the console is logged, and every event is stored whether or not a webhook endpoint subscribes to it. Both are free on every plan.
Before you begin: export the sandbox account's All products key (request logs and events take an All products key or the console, never a key restricted to some products), then make a request to have something to look at.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5
curl -s $PROVENANCE_API/v1/webhook_endpoints \
-H "Authorization: Bearer $PROVENANCE_KEY"
const api = process.env.PROVENANCE_API;
const headers = { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` };
await fetch(`${api}/v1/webhook_endpoints`, { headers });
import os, httpx
api = os.environ["PROVENANCE_API"]
headers = {"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}
httpx.get(f"{api}/v1/webhook_endpoints", headers=headers)
{ "object": "list", "has_more": false }
1. List your requests
GET / lists requests newest first. Each item is metadata: the method, route, status, latency, the key that made it, the Idempotency-Key and the IDs it touched.
curl -s "$PROVENANCE_API/v1/request_logs?limit=1&route=/v1/webhook_endpoints&method=GET" \
-H "Authorization: Bearer $PROVENANCE_KEY" | tee logs.json
export REQUEST_LOG_ID=$(jq -r '.data[0].id' logs.json)
const logs = await (await fetch(`${api}/v1/request_logs?limit=1&route=/v1/webhook_endpoints&method=GET`, { headers })).json();
const requestLogId = logs.data[0].id;
logs = httpx.get(f"{api}/v1/request_logs", params={"limit": 1, "route": "/v1/webhook_endpoints", "method": "GET"}, headers=headers).json()
request_log_id = logs["data"][0]["id"]
{
"object": "list",
"data": [
{
"id": "rlog_01M6V8P4WQ4Y7V92HPEPNYQW4R",
"object": "request_log",
"request_id": "req_01M6V8P4WMPDW3HRZEEGSDJ4VQ",
"method": "GET",
"route": "/v1/webhook_endpoints",
"path": "/v1/webhook_endpoints",
"status_code": 200,
"source": "api_key",
"error_code": null,
"truncated": false
}
]
}
Filter with these query parameters, together or alone:
| Parameter | Matches |
|---|---|
created_, created_ | A time range |
status_, status_ | 4xx, or one status such as 404 |
method, route | POST, or a route template such as / |
api_ | Requests made with one key |
idempotency_ | Every attempt that sent one Idempotency-Key |
request_ | The request behind an error's request_ |
object_ | Requests that touched an object, such as an endpoint or an approval |
2. Open one request
GET / returns the request with its bodies. Pass a request log ID, or the request_id from an error body.
curl -s $PROVENANCE_API/v1/request_logs/$REQUEST_LOG_ID \
-H "Authorization: Bearer $PROVENANCE_KEY"
const log = await (await fetch(`${api}/v1/request_logs/${requestLogId}`, { headers })).json();
log = httpx.get(f"{api}/v1/request_logs/{request_log_id}", headers=headers).json()
{
"id": "rlog_01M6V8P4WQ4Y7V92HPEPNYQW4R",
"object": "request_log",
"method": "GET",
"status_code": 200,
"body_status": "available",
"request": { "headers": { "authorization": "[redacted]" }, "query": {}, "body": null },
"response": { "body": { "object": "list", "data": [], "has_more": false, "next_cursor": null } }
}
Bodies are redacted before they're stored, so the log can't leak what it was given:
| What | How it's stored |
|---|---|
| Secrets shown once (API keys, webhook and OAuth client secrets, authenticator seeds, recovery codes), intent and mandate tokens, link tokens | [redacted] |
Authorization, Cookie and X-CSRF-Token headers | [redacted] |
| Phone numbers | The last 2 digits |
| Email addresses | The first letter and the domain |
| IP addresses | Removed |
| Passkey attestations and assertions, base64 images | Their type and size |
| Bodies over 16 KB (request) or 32 KB (response) | Cut, with truncated: true |
| Link tokens and codes in a path | [redacted] in path |
Pages anyone with the link can open, such as a capture link or an approval link, aren't logged, even when you open them signed in to the console. With an API key, only an All products key reads the log and events; a key limited to some products gets insufficient_scope.
body_status says when bodies aren't shown:
body_status | Meaning |
|---|---|
available | Both bodies are shown. |
not_ | Live mode on a deployment without a body encryption key: metadata only. |
unreadable | The bodies were sealed under an earlier encryption key (a changed key, or a sandbox restart). |
hidden | Your console role sees metadata only (analysts). |
3. Find the errors that matter
GET / returns the most frequent 4xx and 5xx error codes in the last hour, day or week, with up to three example requests each.
curl -s "$PROVENANCE_API/v1/request_logs/errors_summary?window=24h" \
-H "Authorization: Bearer $PROVENANCE_KEY"
const summary = await (await fetch(`${api}/v1/request_logs/errors_summary?window=24h`, { headers })).json();
summary = httpx.get(f"{api}/v1/request_logs/errors_summary", params={"window": "24h"}, headers=headers).json()
{ "object": "errors_summary", "window": "24h" }
4. List events
GET / lists every event on your account, newest first, in the same envelope your webhook endpoints receive. It takes the same time range and object_id filters as request logs, plus type (comma-separated). GET / adds the deliveries made of it to your endpoints.
curl -s "$PROVENANCE_API/v1/events?limit=3" \
-H "Authorization: Bearer $PROVENANCE_KEY"
const events = await (await fetch(`${api}/v1/events?limit=3`, { headers })).json();
events = httpx.get(f"{api}/v1/events", params={"limit": 3}, headers=headers).json()
{ "object": "list" }
5. Use them in the console
In the console, Developers → Logs lists requests with the same filters, the errors summary at the top and a drawer with both bodies. Developers → Events lists events. Turn on Live on either page to watch new requests and events as they happen. An object's page (an approval, a grant, an endpoint) has a Timeline tab with the requests and events that touched it, in order.
How long they're kept
| Plan | Request logs and events | Webhook deliveries and attempts |
|---|---|---|
| Free | 7 days | 30 days |
| Pro | 30 days | 30 days |
| Growth | 90 days | 30 days |
| Enterprise | 90 days, or longer by arrangement (up to a year) | 30 days |
An account export includes every request log with its bodies and every event; deleting the account removes them.
Errors you might see
| Symptom | Cause | Fix |
|---|---|---|
404 resource_ | The ID belongs to another account or environment, or it's past your plan's window | Check the key's environment; open logs within the window. |
400 parameter_ | A filter's value is malformed, such as status_ | Use the values in the table above. |
body_ is hidden | Your console role is analyst | Ask an owner or developer to open it. |
See also
- Test webhooks: attempts, resend, replay and forwarding events to your machine
- Webhooks
- Errors