View as Markdown

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"
{ "object": "list", "has_more": false }

1. List your requests

GET /v1/request_logs 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)
{
  "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:

ParameterMatches
created_gte, created_lteA time range
status_class, status_code4xx, or one status such as 404
method, routePOST, or a route template such as /v1/webhook_endpoints/:id
api_key_idRequests made with one key
idempotency_keyEvery attempt that sent one Idempotency-Key
request_idThe request behind an error's request_id
object_idRequests that touched an object, such as an endpoint or an approval

2. Open one request

GET /v1/request_logs/{id} 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"
{
  "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:

WhatHow 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 numbersThe last 2 digits
Email addressesThe first letter and the domain
IP addressesRemoved
Passkey attestations and assertions, base64 imagesTheir 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_statusMeaning
availableBoth bodies are shown.
not_recordedLive mode on a deployment without a body encryption key: metadata only.
unreadableThe bodies were sealed under an earlier encryption key (a changed key, or a sandbox restart).
hiddenYour console role sees metadata only (analysts).

3. Find the errors that matter

GET /v1/request_logs/errors_summary 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"
{ "object": "errors_summary", "window": "24h" }

4. List events

GET /v1/events 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 /v1/events/{id} adds the deliveries made of it to your endpoints.

curl -s "$PROVENANCE_API/v1/events?limit=3" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{ "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

PlanRequest logs and eventsWebhook deliveries and attempts
Free7 days30 days
Pro30 days30 days
Growth90 days30 days
Enterprise90 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

SymptomCauseFix
404 resource_missingThe ID belongs to another account or environment, or it's past your plan's windowCheck the key's environment; open logs within the window.
400 parameter_invalidA filter's value is malformed, such as status_class=9xxUse the values in the table above.
body_status is hiddenYour console role is analystAsk an owner or developer to open it.

See also