import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const auditEventListResponse of client.auditEvents.list()) {
console.log(auditEventListResponse.id);
}{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "550e8400-e29b-41d4-a716-446655440001",
"record_type": "audit_event",
"resource_id": "550e8400-e29b-41d4-a716-446655440002",
"alternate_resource_id": "+14155551234",
"change_made_by": "organization_member",
"changes": [
{
"field": "field.name",
"to": "old value",
"from": "new value"
}
],
"organization_id": "550e8400-e29b-41d4-a716-446655440003",
"change_type": "update",
"created_at": "2023-01-01T00:00:00Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 1,
"total_results": 50,
"page_size": 10
}
}Retrieve a list of audit log entries. Audit logs are a best-effort, eventually consistent record of significant account-related changes.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const auditEventListResponse of client.auditEvents.list()) {
console.log(auditEventListResponse.id);
}{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "550e8400-e29b-41d4-a716-446655440001",
"record_type": "audit_event",
"resource_id": "550e8400-e29b-41d4-a716-446655440002",
"alternate_resource_id": "+14155551234",
"change_made_by": "organization_member",
"changes": [
{
"field": "field.name",
"to": "old value",
"from": "new value"
}
],
"organization_id": "550e8400-e29b-41d4-a716-446655440003",
"change_type": "update",
"created_at": "2023-01-01T00:00:00Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 1,
"total_results": 50,
"page_size": 10
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated filter parameter (deepObject style). Originally: filter[created_before], filter[created_after]
Set the order of the results by the creation date.
asc, desc "desc"
A list of audit log entries.
Show child attributes
Unique identifier for the audit log entry.
"550e8400-e29b-41d4-a716-446655440000"
Unique identifier for the user who made the change.
"550e8400-e29b-41d4-a716-446655440001"
The type of the resource being audited.
"audit_event"
Unique identifier for the resource that was changed.
"550e8400-e29b-41d4-a716-446655440002"
An alternate identifier for a resource which may be considered unique enough to identify the resource but is not the primary identifier for the resource. For example, this field could be used to store the phone number value for a phone number when the primary database identifier is a separate distinct value.
"+14155551234"
Indicates if the change was made by Telnyx on your behalf, the organization owner, a member of your organization, or in the case of managed accounts, the account manager.
telnyx, account_manager, account_owner, organization_member "organization_member"
Details of the changes made to the resource.
Show child attributes
The name of the field that was changed. May use the dot notation to indicate nested fields.
"nested.field.name"
The new value of the field. Can be any JSON type.
12345
The previous value of the field. Can be any JSON type.
54321
[
{
"field": "field.name",
"to": "old value",
"from": "new value"
}
]Unique identifier for the organization that owns the resource.
"550e8400-e29b-41d4-a716-446655440003"
The type of change that occurred.
"update"
ISO 8601 formatted date indicating when the change occurred.
"2023-01-01T00:00:00Z"
Was this page helpful?