Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

List audit events

Requires audit:read. Events about Roles, memberships, invitations, OAuth applications, single sign-on and sign-ins, newest first, including denials and their origin. The Platform API serves the events about projects, environments, components and clusters with the same schema and filters.

GET/organizations/{organizationId}/audit-events
Authorization
AuthorizationBearer token (JWT) · headerrequired

An access token issued by this service (RFC 9068), in the Authorization header as Bearer <token>.

Path parameters
organizationIdstring<uuid>required
Query parameters
actionstring[]

Only events with one of these actions.

max items 20
actor_idstring

Only events by this user or client, or that the system recorded on their behalf (metadata.initiated_by).

target_typestring

With target_id, only events about this object, as their primary target or an ancestor of it.

target_idstring<uuid>
affected_user_idstring<uuid>
outcomestring
Allowed:alloweddenied
changed_fieldstring

Only events that changed this field.

sincestring<date-time>

Only events at or after this time.

untilstring<date-time>

Only events before this time.

cursorstring

The next_cursor of the previous page.

limitinteger
min 1 · max 100 · default: 50
Responses
200

A page of events.

eventsaudit_event[]required

Newest first.

Show properties
Array of audit_event
idstring<uuid>required

UUIDv7, unique within its source.

sourcestringrequired
Allowed:authengine
organization_idstring<uuid> | null

Null for events before an organization is known, such as a failed sign-in.

occurred_atstring<date-time>required

Transaction time of the change, from the source's database clock.

actionstringrequired

Dotted name from the source's closed catalog, such as member.roles_updated or environment.deleted.

actoraudit_actorrequired

Who acted, as they were when they did.

Show properties
typestringrequired
Allowed:userclientsystem
idstringrequired

The user or client UUID, system, or unknown for someone who did not prove who they are.

emailstring | null
namestring | null
targetsaudit_target[]required

The objects the event acted on (primary) and the objects containing them (ancestor), as named then.

Show properties
Array of audit_target
typestringrequired

A Resource Type, such as role, project, environment or kapplication.

idstring<uuid>required
namestring | null

The object's name when the event happened, if known.

relationstringrequired
Allowed:primaryancestor
affected_useraudit_person | null

The person acted upon, when it is not the actor; id is null for an invitee without an account.

Show properties
idstring<uuid> | null
emailstring | null
namestring | null
outcomestringrequired
Allowed:alloweddenied
denial_reasonstring | null

Why a denied action was refused, such as the missing Permission.

changed_fieldsstring[]required
changesaudit_changes | null

Values of the changed fields before and after; a field holding a secret is in changed_fields but never here.

Show properties
beforeobject | null
afterobject | null
metadataobjectrequired

Small action-specific details. Two keys are reserved for what the system records on behalf of someone, when work they started finishes later: initiated_by, the actor who started it (type, id, and email or name when known), and caused_by, the id of the event that started it. A refusal that stands for repeats of itself carries repeats, how many identical refusals were dropped since the previous one recorded.

originaudit_originrequired

Where the request came from. Omitted fields are not shown to resource readers.

Show properties
ipstring | null
user_agentstring | null
entry_pointstringrequired
Allowed:httpwebinternal
request_idstring | null
next_cursorstring | null

Pass as cursor for the next, older page; null on the last page.

default

The request failed.

errorstringrequired

Stable machine-readable code.

Allowed:invalid_requestunauthorizedforbiddennot_foundconflictgoneunavailableinternal
messagestringrequired

Human-readable explanation.

Request
curl -X GET 'https://auth.kapten.io/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/audit-events' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "events": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "source": "auth",
      "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
      "occurred_at": "2019-08-24T14:15:22Z",
      "action": "string",
      "actor": {
        "type": "user",
        "id": "string",
        "email": "string",
        "name": "string"
      },
      "targets": [
        {
          "type": "string",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "relation": "primary"
        }
      ],
      "affected_user": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "email": "string",
        "name": "string"
      },
      "outcome": "allowed",
      "denial_reason": "string",
      "changed_fields": [
        "string"
      ],
      "changes": {
        "before": {},
        "after": {}
      },
      "metadata": {},
      "origin": {
        "ip": "string",
        "user_agent": "string",
        "entry_point": "http",
        "request_id": "string"
      }
    }
  ],
  "next_cursor": "string"
}

Was this page helpful?