Audit

circle-exclamation

Audit trail for tracking changes and access to system resources.

Queries

auditEvents

Lists audit events for an organization.

auditEvents(
    organizationId: ID!
    filter: AuditEventFilter
    first: Int
    after: String
    last: Int
    before: String
    orderBy: AuditEventOrder = { field: OCCURRED_AT, direction: DESC }
  ): AuditEventConnection!

Arguments

Name
Type
Description

organizationId

ID!

The organization to retrieve audit events for.

filter

AuditEventFilter

Filtering options for the returned audit events.

first

Int

The first n elements from the paginated listarrow-up-right.

after

String

The elements that come after the specified cursorarrow-up-right.

last

Int

The last n elements from the paginated listarrow-up-right.

before

String

The elements that come before the specified cursorarrow-up-right.

orderBy

AuditEventOrder

The ordering options for the returned audit events.

Input types:

chevron-rightAuditEventFilterhashtag

Filtering options for audit events.

Field
Type
Description

actorIds

[ID!]

Filter by actors (OR within field).

aggregateTypes

[Code!]

Filter by entity types (OR within field).

aggregateIds

[ID!]

Filter by specific entity IDs (OR within field).

eventTypes

Filter by event types (OR within field).

sourceTypes

Filter by source types (OR within field).

traceId

String

Filter by trace ID.

from

DateTime

Return events that occurred after this timestamp.

to

DateTime

Return events that occurred before this timestamp.

chevron-rightAuditEventOrderhashtag

Ordering options for audit events.

Field
Type
Description

field

The field to order by.

direction

The direction to order.

Output types:

chevron-rightAuditEventConnectionhashtag

A paginated list of AuditEvent items.

Implements: Connection

Field
Type
Description

edges

A list of edges.

nodes

A list of nodes in the connection (without edge metadata).

pageInfo

Information about the current page.

total

The total count of items matching the filter.

chevron-rightPageInfo (entity)hashtag

Information about the current page in a paginated connection.

Field
Type
Description

hasNextPage

Boolean!

Whether more items exist after the current page.

hasPreviousPage

Boolean!

Whether more items exist before the current page.

startCursor

String

The cursor pointing to the first item in the current page.

endCursor

String

The cursor pointing to the last item in the current page.


entityHistory

Retrieves the change history for any entity.

Arguments

Name
Type
Description

entityId

ID!

The ID of the entity to retrieve history for.

filter

AuditEventFilter

Filtering options for the returned audit events.

first

Int

The first n elements from the paginated listarrow-up-right.

after

String

The elements that come after the specified cursorarrow-up-right.

last

Int

The last n elements from the paginated listarrow-up-right.

before

String

The elements that come before the specified cursorarrow-up-right.

orderBy

AuditEventOrder

The ordering options for the returned audit events.

Input types:

chevron-rightAuditEventFilterhashtag

Filtering options for audit events.

Field
Type
Description

actorIds

[ID!]

Filter by actors (OR within field).

aggregateTypes

[Code!]

Filter by entity types (OR within field).

aggregateIds

[ID!]

Filter by specific entity IDs (OR within field).

eventTypes

Filter by event types (OR within field).

sourceTypes

Filter by source types (OR within field).

traceId

String

Filter by trace ID.

from

DateTime

Return events that occurred after this timestamp.

to

DateTime

Return events that occurred before this timestamp.

chevron-rightAuditEventOrderhashtag

Ordering options for audit events.

Field
Type
Description

field

The field to order by.

direction

The direction to order.

Output types:

chevron-rightAuditEventConnectionhashtag

A paginated list of AuditEvent items.

Implements: Connection

Field
Type
Description

edges

A list of edges.

nodes

A list of nodes in the connection (without edge metadata).

pageInfo

Information about the current page.

total

The total count of items matching the filter.

chevron-rightPageInfo (entity)hashtag

Information about the current page in a paginated connection.

Field
Type
Description

hasNextPage

Boolean!

Whether more items exist after the current page.

hasPreviousPage

Boolean!

Whether more items exist before the current page.

startCursor

String

The cursor pointing to the first item in the current page.

endCursor

String

The cursor pointing to the last item in the current page.


Objects

AuditEvent

An audit log entry recording an event that occurred in the system.

Implements: Node

Field
Type
Description

id

ID!

A globally unique identifier. This ID is opaque and should not be parsed by clients.

organization

The organization context. Null for system events.

actor

The actor who triggered the event.

ipAddress

String

The client IP address.

userAgent

String

The client User-Agent string.

sourceType

The source type of the request.

traceId

String

The distributed tracing ID (32 hex characters) for log correlation.

aggregateType

Code

The type of entity affected.

aggregateId

ID

The ID of the affected entity.

eventType

The type of event that occurred.

eventData

JSON

The event payload with details such as changed fields.

occurredAt

DateTime!

The date and time when the event occurred.


Inputs

AuditEventFilter

Filtering options for audit events.

Field
Type
Description

actorIds

[ID!]

Filter by actors (OR within field).

aggregateTypes

[Code!]

Filter by entity types (OR within field).

aggregateIds

[ID!]

Filter by specific entity IDs (OR within field).

eventTypes

Filter by event types (OR within field).

sourceTypes

Filter by source types (OR within field).

traceId

String

Filter by trace ID.

from

DateTime

Return events that occurred after this timestamp.

to

DateTime

Return events that occurred before this timestamp.


AuditEventOrder

Ordering options for audit events.

Field
Type
Description

field

The field to order by.

direction

The direction to order.


Enums

SourceType

The source type identifying the origin of an API request.

Value
Description

WEB

Request originated from a web browser application.

MOBILE

Request originated from a mobile application (iOS/Android).

API

Request made directly via the API.

INTERNAL

Request generated by an internal system process.

INTEGRATION

Request made by an external integration.


AuditEventType

The type of event recorded in the audit log.

Value
Description

LOGIN

A user successfully authenticated.

LOGOUT

A user ended their session.

FAILED_LOGIN

An authentication attempt failed.

PASSWORD_RESET

A password reset was initiated.

SESSION_EXPIRED

A session was terminated due to inactivity.

CREATED

A new entity was created.

UPDATED

An existing entity was modified.

DELETED

An entity was deleted.

RESTORED

A soft-deleted entity was restored.

ROLE_ASSIGNED

A role was assigned to an actor.

ROLE_REVOKED

A role was removed from an actor.

PERMISSION_GRANTED

A permission was granted to a role.

PERMISSION_REVOKED

A permission was removed from a role.

LINKED

Two entities were linked together.

UNLINKED

A link between entities was removed.

ATTACHED

An entity was added to a group.

DETACHED

An entity was removed from a group.


AuditEventOrderField

Fields available for ordering audit events.

Value
Description

OCCURRED_AT

Order by occurrence date.


Pagination types

AuditEventConnection

A paginated list of AuditEvent items.

Implements: Connection

Field
Type
Description

edges

A list of edges.

nodes

A list of nodes in the connection (without edge metadata).

pageInfo

Information about the current page.

total

The total count of items matching the filter.


AuditEventEdge

An edge in the AuditEvent connection.

Implements: Edge

Field
Type
Description

cursor

String!

An opaque cursor for this edge.

node

The audit event at the end of the edge.


Last updated

Was this helpful?