Docs
/
/

Audit logs mAPI reference

Complete reference documentation for the Audit logs resource.

Audit logs

#

Audit logs record actions taken on your Knock account.

List entries across every environment and branch, including account-level entries that have no environment. The list includes user-visible changes and environment merges. Commits are returned by the commits endpoint.

List audit logs

#

Returns a paginated list of audit log entries for the current account, across every environment and branch, including account-level entries that have no environment. Entries are ordered from most recent first.

The list includes user-visible changes and environment merges. Commits are returned by the commits endpoint. Entries outside the account's data retention window are omitted.

Endpoint

GET/v1/audit_logs

Query parameters

environment
string

The environment slug. When omitted, the list is account-wide and does not use the account's default environment. When set, limits entries to that environment or branch and omits account-level entries.

action
2 possible types

Filter by action. Accepts one action or an array of actions, matched exactly.

actor_id
2 possible types

Filter by the id of the user who performed the action. Accepts one id or an array of ids.

resource_type
2 possible types

Filter by resource type. Accepts one type or an array of types. channel includes channel environment settings, and source includes source environment settings.

since
string(date-time)

Only return entries inserted at or after this RFC 3339 timestamp.

until
string(date-time)

Only return entries inserted at or before this RFC 3339 timestamp.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

Returns

PaginatedAuditLogResponse

A paginated list of AuditLog. Contains a list of entries and page information.

entries

A list of entries.

action
string
Required

The action that was performed, such as workflow.updated or seat.removed.

actorRequired

The Knock user who performed the action.

email
string
Required

The email address of the user.

id
string(uuid)
Required

The unique identifier for the user.

name
string

The name of the user.

agent_session_id
string(uuid)
Required

The agent session that performed the action, when the source is an agent.

environment
string
Required

The slug of the environment or branch where the action happened. Null for account-level actions.

id
string(uuid)
Required

The unique identifier for the audit log entry.

inserted_at
string(date-time)
Required

The timestamp of when the action happened.

ip_address
string
Required

The IP address of the request that performed the action.

locationRequired

The location derived from the request IP address.

city
string

The city.

country_code
string

The country code.

region_code
string

The region code.

project_id
string(uuid)
Required

The project the action belongs to. Null for account-level actions.

request_id
string
Required

The id of the request that performed the action.

request_source
enum(string)
Required

Where the action originated.

dashboardmapiagent
resourceRequired

The resource the action changed. type and identifier follow the commit resource for promotable resources, including reusable_request. identifier is null when the resource has no public handle or the row no longer exists.

id
string
Required

The stored id of the resource. External user and object ids are not UUIDs.

identifier
string

The public handle for the resource, such as a key, slug, email, or locale/namespace for a translation.

type
enum(string)
Required

The type of the resource.

accountaccount_userapi_keyassetaudiencebroadcastchannelchannel_groupemail_layoutenvironmentenvironment_defaultsevent_action_mappingexternal_audiencegoalguideguide_groupinvitemembermessage_typeobjectpartialpermission_grouppreference_categorypreference_centerpreference_center_domainreusable_requestservice_tokensigning_keysourcesubscriptiontagtranslationuservariableviewwebhookworkflowunknown
page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

AuditLog

#

An account audit log entry. Commit rows are returned by the commits endpoint. The entry does not include the stored change diff.

Attributes

action
string

The action that was performed, such as workflow.updated or seat.removed.

The Knock user who performed the action.

email
string

The email address of the user.

id
string(uuid)

The unique identifier for the user.

name
string

The name of the user.

agent_session_id
string(uuid)

The agent session that performed the action, when the source is an agent.

environment
string

The slug of the environment or branch where the action happened. Null for account-level actions.

id
string(uuid)

The unique identifier for the audit log entry.

inserted_at
string(date-time)

The timestamp of when the action happened.

ip_address
string

The IP address of the request that performed the action.

The location derived from the request IP address.

city
string

The city.

country_code
string

The country code.

region_code
string

The region code.

project_id
string(uuid)

The project the action belongs to. Null for account-level actions.

request_id
string

The id of the request that performed the action.

request_source
enum(string)

Where the action originated.

dashboardmapiagent

The resource the action changed. type and identifier follow the commit resource for promotable resources, including reusable_request. identifier is null when the resource has no public handle or the row no longer exists.

id
string

The stored id of the resource. External user and object ids are not UUIDs.

identifier
string

The public handle for the resource, such as a key, slug, email, or locale/namespace for a translation.

type
enum(string)

The type of the resource.

accountaccount_userapi_keyassetaudiencebroadcastchannelchannel_groupemail_layoutenvironmentenvironment_defaultsevent_action_mappingexternal_audiencegoalguideguide_groupinvitemembermessage_typeobjectpartialpermission_grouppreference_categorypreference_centerpreference_center_domainreusable_requestservice_tokensigning_keysourcesubscriptiontagtranslationuservariableviewwebhookworkflowunknown

AuditLogActor

#

The Knock user who performed the action.

Attributes

email
string

The email address of the user.

id
string(uuid)

The unique identifier for the user.

name
string

The name of the user.

AuditLogResource

#

The resource the action changed. type and identifier follow the commit resource for promotable resources, including reusable_request. identifier is null when the resource has no public handle or the row no longer exists.

Attributes

id
string

The stored id of the resource. External user and object ids are not UUIDs.

identifier
string

The public handle for the resource, such as a key, slug, email, or locale/namespace for a translation.

type
enum(string)

The type of the resource.

accountaccount_userapi_keyassetaudiencebroadcastchannelchannel_groupemail_layoutenvironmentenvironment_defaultsevent_action_mappingexternal_audiencegoalguideguide_groupinvitemembermessage_typeobjectpartialpermission_grouppreference_categorypreference_centerpreference_center_domainreusable_requestservice_tokensigning_keysourcesubscriptiontagtranslationuservariableviewwebhookworkflowunknown

AuditLogLocation

#

The location derived from the request IP address.

Attributes

city
string

The city.

country_code
string

The country code.

region_code
string

The region code.

New chat