How to fetch CMDB audit logs via Table API - which tables to query?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 11:48 PM
I need to retrieve CMDB-related logs programmatically using the Table API.
I'm looking for guidance on:
- Which tables contain CMDB audit/change logs?
- What's the correct API endpoint structure?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2025 05:59 AM
To retrieve CMDB-related logs programmatically using the ServiceNow Table API, you're essentially looking to query the tables that store audit and change history for CMDB records.
Table Names:
Sys_audit
sys_history_line
sys_history_set
cmdb_ci
Note: Audit must be enabled for the relevant CMDB tables/fields to populate sys_audit.
To retrieve all changes made to CMDB records in the last 7 days:
GET /api/now/table/sys_audit?sysparm_query=document_table=cmdb_ci^sys_created_on>=javascript:gs.daysAgoStart(7)