Skip to content
Website

List audit events

GET/api/v1/audit/events

List audit events

Query ParametersExpand Collapse
action: optional string
environment: optional "sandbox" or "production"

Environment to list audit events from. Defaults to sandbox when omitted.

One of the following:
"sandbox"
"production"
from: optional string
formatdate-time
outcome: optional "success" or "client_error" or "server_error"
One of the following:
"success"
"client_error"
"server_error"
page: optional number
minimum1
per_page: optional number
minimum1
maximum100
target_id: optional string
target_type: optional string
to: optional string
formatdate-time
ReturnsExpand Collapse
data: array of object { id, action, actor, 12 more }
id: string
formatuuid
action: "users.business.register" or "users.auth.login" or "users.auth.refresh" or 13 more
One of the following:
"users.business.register"
"users.auth.login"
"users.auth.refresh"
"users.auth.revoke"
"users.password_reset.request"
"users.password_reset.complete"
"users.beta.apply"
"users.api_key.create"
"users.api_key.revoke"
"accounts.account.create"
"accounts.account.update_status"
"accounts.account.close"
"accounts.money.deposit"
"accounts.money.withdraw"
"accounts.money.transfer"
"ledger.transaction.post"
actor: object { id, type, roles }
id: string
type: "user" or "api_key" or "internal_service" or "anonymous"
One of the following:
"user"
"api_key"
"internal_service"
"anonymous"
roles: optional array of string
correlation_id: string
created_at: string
formatdate-time
environment: "sandbox" or "production"
One of the following:
"sandbox"
"production"
metadata: map[string]
occurred_at: string
formatdate-time
organization_id: string
formatuuid
outcome: "success" or "client_error" or "server_error"
One of the following:
"success"
"client_error"
"server_error"
request: object { id, method, path, 2 more }
id: string
method: string
path: string
ip: optional string
user_agent: optional string
schema_version: 1
source_service: "users" or "accounts" or "ledger"
One of the following:
"users"
"accounts"
"ledger"
target: object { id, type }
id: string
type: string
reason: optional string
maxLength500

List audit events

curl https://rails-client-server-staging.up.railway.app/api/v1/audit/events \
    -H "X-API-Key: $RAILS_API_KEY"
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "action": "users.business.register",
      "actor": {
        "id": "id",
        "type": "user",
        "roles": [
          "string"
        ]
      },
      "correlation_id": "correlation_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "environment": "sandbox",
      "metadata": {
        "foo": "string"
      },
      "occurred_at": "2019-12-27T18:11:19.117Z",
      "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "outcome": "success",
      "request": {
        "id": "id",
        "method": "method",
        "path": "path",
        "ip": "ip",
        "user_agent": "user_agent"
      },
      "schema_version": 1,
      "source_service": "users",
      "target": {
        "id": "id",
        "type": "type"
      },
      "reason": "reason"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 1,
    "total_count": 0,
    "total_pages": 0
  }
}
Returns Examples
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "action": "users.business.register",
      "actor": {
        "id": "id",
        "type": "user",
        "roles": [
          "string"
        ]
      },
      "correlation_id": "correlation_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "environment": "sandbox",
      "metadata": {
        "foo": "string"
      },
      "occurred_at": "2019-12-27T18:11:19.117Z",
      "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "outcome": "success",
      "request": {
        "id": "id",
        "method": "method",
        "path": "path",
        "ip": "ip",
        "user_agent": "user_agent"
      },
      "schema_version": 1,
      "source_service": "users",
      "target": {
        "id": "id",
        "type": "type"
      },
      "reason": "reason"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 1,
    "total_count": 0,
    "total_pages": 0
  }
}