# Spraay Audit Trail Query

> Spraay Audit Trail Query is a paid API for AI agents from gateway.spraay.app, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Query an audit trail filtered by actor, action, resource, and time range to retrieve historical event logs.

## Facts

- Endpoint: GET https://gateway.spraay.app/api/v1/audit/query
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gateway-spraay-app-1f5f00ee
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LMHrPFY9AyIPo5KhRHz3u

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability gateway-spraay-app-1f5f00ee
```

Example prompt: Show me all the audit log entries for actor 'user:alice' where the action was 'delete' on the 'documents' resource, from January 1 2025 to January 31 2025.

## When to prefer this

Use this endpoint when you need to look up historical audit events filtered by specific criteria such as who performed an action, what action was taken, which resource was affected, or during a specific time window. Prefer this over log query endpoints when the domain is access/audit rather than general system logs.

## Known failure modes

- Invalid or missing time range formats for since/until returning a 400 error
- Unknown actor or resource identifier returning empty results
- Time range too broad causing timeout or truncated results
- Malformed query parameters returning a validation error
- Payment failure via x402 protocol returning 402 Payment Required

## How this service works

Query audit trail by actor, action, resource, time range.

## Output

Returns an array of audit log entries matching the query filters, each entry containing details about the actor, action performed, resource affected, and timestamp of the event.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "actor": "user:alice",
   "since": "2025-01-01T00:00:00Z",
   "until": "2025-01-31T23:59:59Z",
   "action": "delete",
   "resource": "documents"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "actor": {
       "type": "string"
      },
      "since": {
       "type": "string"
      },
      "until": {
       "type": "string"
      },
      "action": {
       "type": "string"
      },
      "resource": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "entries": {
       "type": "array"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gateway-spraay-app-1f5f00ee/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.spraay.app](https://www.zero.xyz/host/gateway.spraay.app/llms.txt)
