Skip to content

List audit logs

GET
/v1/audit-logs

Get a paginated list of audit logs.

Token scope required: audit-logs:list

cursor
string

Cursor value at which to start the results, provided in nextCursor or prevCursor of a prior request

Example
bmV4dA.eyJsb2dzLmNyZQ5iIiwiX3ZhbHVlIjo9In19
pageSize
integer
default: 25 <= 500

Number of records to return in each page

sortDirection
string
default: asc
Allowed values: asc desc

Order in which to return results. Each endpoint sorts on its own key (for example, hosts by name and audit logs by creation time). Matching is case-insensitive, and any value other than desc sorts ascending.

filter.targetID
string

Return only audit logs for the specified target

filter.targetType
string
Allowed values: apiKey host network role user ca oidcProvider tag organization route endpointOIDC domain

Return only audit logs matching the specified target type

Successful operation

object
data
required
Array<object>
object
id
required
string
organizationID
required
string
timestamp
required
string format: date-time
actor
required
Any of:
apiKey
object
type
required

An API key which used to perform the action.

string
Allowed values: apiKey
id
required
string
name
required

Null if the API key has since been deleted.

string | null
target
required

The entity being acted upon.

object
id
required
string
type
required

The kind of entity acted upon. New values may be added, so clients should accept values not listed here.

Known values:

  • apiKey
  • ca
  • domain
  • endpointOIDC
  • host
  • network
  • oidcProvider
  • organization
  • role
  • route
  • tag
  • user
string
event
required

Information about what happened, including relevant values before & after the change.

object
type
required

The type of event that occurred. New values may be added, so clients should accept values not listed here.

Known values:

  • CREATED
  • UPDATED
  • DELETED
  • DELETED_TOTP
  • CREATED_TOTP
  • SUCCEEDED_AUTH
  • FAILED_AUTH
  • ENROLLED
  • RENEWED
  • CREATED_ENROLL_CODE
  • SET_NETWORK_CA
  • BLOCKED_HOST
  • UNBLOCKED_HOST
  • SET_OVERRIDES
  • UPDATED_TOTP
  • UPDATED_SUBSCRIPTION
  • CHANGED_DOMAIN_VERIFICATION
  • CREATED_WEBAUTHN
  • DELETED_WEBAUTHN
  • UPDATED_WEBAUTHN
  • ENABLED_MANAGED_LIGHTHOUSE
  • SIGNED_MANAGED_LIGHTHOUSE
  • RENEWED_NETWORK_ACCESS
string
before
required

The state of the target before the change was made. The shape depends on the target and event type. Can also be a string or null (e.g. target was created).

object | null
after
required

The state of the target after the change was made. The shape depends on the target and event type. Can also be a string or null (e.g. target was deleted).

object | null
metadata
required
object
totalCount

The total number of resources existing in the account. Only present when includeCounts is true.

integer
hasNextPage
required

Is there a page of data that can be fetched using the nextCursor?

boolean
hasPrevPage
required

Is there a page of data that can be fetched using the prevCursor?

boolean
nextCursor

An opaque string that can be used to fetch the next page of results. Not provided if result set is empty.

string
prevCursor

An opaque string that can be used to fetch the previous page of results. Not provided if result set is empty.

string
page

Only present when includeCounts is true.

object
count
required

The number of results returned in the response.

integer
start
required

The zero-based index of the first result within the overall list. For example, the first page will have a start of 0. If 25 results are fetched, and the nextCursor used to fetch a new page of results, the second request’s start will be 25.

integer
Examples

Paginated list of audit logs

{
"data": [
{
"id": "log-F3TTIDMKZH5XFH37RTRLIP3TOA",
"organizationID": "org-F63A24JGCLJV3ZEUTLCBISGETA",
"timestamp": "2023-02-15T13:59:09.828868Z",
"actor": {
"id": "dnkey-DXALSPQONG7H45QZAVTPRDMAPU",
"name": "example api key",
"type": "apiKey"
},
"target": {
"id": "role-LO4SPDSWTZNJC676WFCZKUB3ZQ",
"type": "role"
},
"event": {
"type": "CREATED",
"before": null,
"after": {
"name": "My New Role",
"description": "",
"firewallRules": null
}
}
}
],
"metadata": {
"hasNextPage": true,
"hasPrevPage": true,
"nextCursor": "bmV4dA.bHVlIjoieGJVS0UvYkRjQmZsY1pUbGJCc",
"prevCursor": "cHJldg.SI6ImIiLCJfdmFsdWUiOiI0dDVuREQreU"
}
}

The API key is missing, invalid or expired.

object
errors
required
Array<object>
object
code
required

A static name for the error type

string
message
required

A short human readable description of the error

string
path

Describes the variable missing or malformed

string
param

The query parameter the error relates to, such as filter.targetType

string
extra

Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.

object
limit

The maximum number of resources allowed

integer
limitName

The kind of resource the limit applies to

string
key
additional properties
any
Example
{
"errors": [
{
"code": "ERR_UNAUTHORIZED",
"message": "unauthorized"
}
]
}

The API key lacks a required scope.

object
errors
required
Array<object>
object
code
required

A static name for the error type

string
message
required

A short human readable description of the error

string
path

Describes the variable missing or malformed

string
param

The query parameter the error relates to, such as filter.targetType

string
extra

Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.

object
limit

The maximum number of resources allowed

integer
limitName

The kind of resource the limit applies to

string
key
additional properties
any
Examples

The API key lacks a required scope.

{
"errors": [
{
"code": "ERR_FORBIDDEN",
"message": "api key must support the following scopes: hosts:read"
}
]
}

The organization has exceeded its API request rate limit. Retry the request after a short delay.

object
errors
required
Array<object>
object
code
required

A static name for the error type

string
message
required

A short human readable description of the error

string
path

Describes the variable missing or malformed

string
param

The query parameter the error relates to, such as filter.targetType

string
extra

Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.

object
limit

The maximum number of resources allowed

integer
limitName

The kind of resource the limit applies to

string
key
additional properties
any
Example
{
"errors": [
{
"code": "ERR_TOO_MANY_REQUESTS",
"message": "too many requests"
}
]
}