Every app's audit events form a hash chain. Each event has a sequence_number, its own event_hash and the previous_event_hash of the event before it, so a removed or edited event breaks the chain. These endpoints export the events and check the chain.
Both take the app's key (or a workspace key above it) in Authorization and an M2M token in X-Authorization, and need the token's read scope. See Authentication.
Export the audit log#
Returns the app's events, oldest first.
/v1/apps/:app_id/audit_log/exportAPI key + M2M tokencurl "https://api.scute.io/v1/apps/$SCUTE_APP_ID/audit_log/export?start_date=2026-11-01T00:00:00Z&category=auth" \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "app_id": "0193f8aa-9999-7aaa-8bbb-cccccccccccc", "exported_at": "2026-11-19T10:00:00Z", "count": 1, "events": [ { "id": "0193fb00-0000-7000-8000-000000000123", "sequence_number": 4182, "slug": "auth.login.new_device", "category": "auth", "note": "Sign-in from a new device", "app_user_id": "0193f900-aaaa-7bbb-8ccc-000000000001", "ip_address": "203.0.113.10", "user_agent": "Mozilla/5.0", "metadata": {}, "event_hash": "9f2c...e41a", "previous_event_hash": "51b0...7d03", "created_at": "2026-11-18T14:02:11Z" } ]}The CSV has the columns id, sequence_number, timestamp, slug, category, note, app_user_id, ip_address, user_agent, metadata, event_hash, previous_event_hash.
A date that cannot be parsed returns 400 with Invalid date format: ....
Verify the chain#
Recomputes the hashes of the newest limit events, or of the limit events up to and including to_sequence, and reports whether the chain is intact.
/v1/apps/:app_id/audit_log/verifyAPI key + M2M tokencurl "https://api.scute.io/v1/apps/$SCUTE_APP_ID/audit_log/verify?limit=5000" \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "app_id": "0193f8aa-9999-7aaa-8bbb-cccccccccccc", "verified_at": "2026-11-19T10:00:00Z", "chain_integrity": "valid", "total_checked": 4182, "valid": 4182, "invalid": 0, "newest_sequence": 4182, "oldest_sequence": 1, "complete": true, "head": { "sequence": 4182, "event_hash": "9f2c...e41a" }, "errors": []}| Field | Meaning |
|---|---|
| chain_integrity | valid when no event failed, else broken |
| complete | true when the check reached the first event of the chain. When false, call again with to_sequence set to oldest_sequence - 1 |
| head | The newest event checked. Keep it outside Scute to prove later that nothing was cut off the end |
| errors | The first 20 failures |
Errors#
| Status | When |
|---|---|
| 401 | No valid key, or no valid M2M token |
| 403 | The key does not own the app, or the token's app is outside the app's workspace and the workspaces above it |
| 404 | The app does not exist |