Audit Trail

Segment offers an in-app 90 day Audit Trail for Business Tier accounts.

The Segment Public API lets you automate consuming these Audit Trail events.

List Audit Events

Returns a list of Audit Trail events.

Securitytoken
Request
query Parameters
startTime
string (startTime)

Filter response to events that happened after this time.

This parameter exists in v1.

endTime
string (endTime)

Filter response to events that happened before this time. Defaults to the current time, or the end time from the pagination cursor.

This parameter exists in v1.

resourceId
string (resourceId)

Filter response to events that affect a specific resource, for example, a single Source.

This parameter exists in v1.

Example: resourceId=9aQ1Lj62S4bomZKLF4DPqW
resourceType
string (resourceType)

Filter response to events that affect a specific type, for example, Sources, Warehouses, and Tracking Plans.

This parameter exists in v1.

object (PaginationInput)

Defines the pagination parameters.

This parameter exists in v1.

Example: pagination=pagination.count=2
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/audit-events
Request samples
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript'

const api = configureApis('/* Insert your Public API token here */')

try {
  const result = await unwrap(api.auditTrail.listAuditEvents())
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}