Get Setup Audit Trail
sf_get_setup_audit_trailIdentify who changed Salesforce configuration settings and when by querying the Setup Audit Trail. Filter by section, user, or date range for security audits and compliance reporting.
Instructions
Queries the SetupAuditTrail object to see who made what configuration changes to the org, and when. Covers the last 6 months of setup activity.
Returns records with: date, username, section, action, display (human-readable description)
section filter examples: 'Custom Fields', 'Profiles', 'Flows', 'Apex Classes', 'Permission Sets', 'Connected Apps', 'Users'
Useful for:
Security audits (who changed profiles or permissions)
Debugging unexpected configuration changes
Compliance reporting on org configuration changes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to return | |
| endDate | No | End date in ISO format, e.g. '2025-12-31' | |
| section | No | Filter by section, e.g. 'Custom Fields', 'Profiles', 'Flows', 'Apex Classes' | |
| startDate | No | Start date in ISO format, e.g. '2025-01-01' | |
| createdByUsername | No | Filter by the username who made the change |