Get audit records
The audit retrieval endpoint allows administrators to access detailed audit records for their tenant. Use this endpoint to track and analyze operational activities such as user logins, device usage, configuration changes, and role assignments.
You can filter audit events by status, resource type, resource ID, action, actor type, and time range to focus on specific events.
The response includes comprehensive details for each event, including the actor, affected resource, action performed, timestamps, and a human-readable description. All filter parameters are optional and can be combined as needed to refine your search. The retrieved audit records reflect data from one hour prior to your call.
On this page:
Prerequisites
This endpoint requires a user with Administrator role.
Limitations
This endpoint is available upon request. To have it enabled in your cloud, contact Perfecto Support.
Endpoint URL
|
URL |
Copy
|
|
Method |
|
Header parameters
|
Name |
Description |
Notes |
|---|---|---|
|
Perfecto-Authorization |
Only an Administrator user can access this url |
Request body
|
Parameter |
Type | Description |
Sample values |
|---|---|---|---|
|
|
string |
Outcome of the action |
Success Failure |
|
|
string |
What is affected: |
|
|
|
string |
|
User: Device ID: Test execution ID: Artifact name: Directory name: Feature setting name: Script name: User name: Group name: |
|
|
string |
Verb describing what happened: |
|
|
|
string |
Human-readable summary of the action |
|
|
|
string |
|
|
|
|
string |
Link to system log trace (Unique value) |
|
|
|
string |
The user or system that performed the action (Email ID of that user) |
|
|
|
string |
Starting TimeStamp for getting a Logs |
|
|
|
string |
End TimeStamp for getting a Logs |
|
|
|
integer |
How many audit records to retrieve. By default, 1000 records are retrieved. |
|
|
|
integer |
Page number |
|
Examples
To fetch audit logs based on status:
To fetch audit logs based on resource:
To fetch audit logs based on resourceId:
To fetch audit logs based on filter action:
To fetch audit logs based on filter description:
To fetch audit logs based on filter actorType:
To fetch audit logs based on filter traceId:
To fetch audit logs based on filter actorId:
To fetch audit logs based on filter timestampFrom:
To fetch audit logs based on filter timestampTo:
To fetch audit logs based on filter size:
To fetch audit logs based on filter from:
Passing all parameters in a request:
JSON request
{
"status": "SUCCESS",
"resourceType": "user",
"resourceId": "z-automation-Audit_User23",
"action": "Update User",
"description": "Updating a user details",
"actorType": "user",
"traceId": "fa10c3efcd3342b9872471a2891ecf30",
"actorId": "bob.smith@example.com",
"timestampFrom": "2025-12-17T00:00:00.000Z",
"timestampTo": "2025-12-17T00:00:00.000Z",
"size": 500,
"from": 3
}
Success response
Code 200 OK
JSON response
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 4,
"successful": 4,
"skipped": 2,
"failed": 0
},
"hits": {
"total": {
"value": 166,
"relation": "eq"
},
"max_score": null,
"hits": [
{
"_index": "perfecto-000058",
"_id": "FeQU6ZoB-PNmllGN05rh",
"_score": null,
"_source": {
"status": "SUCCESS",
"service": "feature-settings-service",
"timestamp": "2025-12-04T11:17:24.983Z",
"resourceId": "user-plans.license.gold.virtualDevice",
"actorType": "user",
"@timestamp": "2025-12-04T11:17:27.000Z",
"@version": "1",
"region": "01",
"description": "Publish a new feature setting",
"action": "Publish feature setting",
"actorId": "offline_job",
"resourceType": "config",
"tags": [
"tail.0"
],
"trace_id": "bf686bab4d924859801155dccb936680",
"custom_fields": {
"value": "true",
"tenantId": "[demo, <your-tenant>]",
"name": "user-plans.license.gold.virtualDevice"
},
"hostname": "7f78f374eedc",
"tenant_id": "operator",
"module": "feature-settings",
"changes": {
"description": {
"old": "Control code generation feature for a particular tenant independently of the license",
"new": "Enable the code generation feature for AI commands"
},
"value": {
"old": "false",
"new": "true"
},
"permissions": {
"old": "{readPermissions=[], writePermissions=[rnd_admin]}",
"new": "{readPermissions=[], writePermissions=[rnd_admin, conf_admin]}"
}
},
"product_name": "perfecto"
},
"sort": [
1764847044983
]
},
{
"_index": "perfecto-000058",
"_id": "_-QT6ZoB-PNmllGNi5kd",
"_score": null,
"_source": {
"status": "SUCCESS",
"service": "feature-settings-service",
"timestamp": "2025-12-04T11:16:03.158Z",
"resource_id": "scriptless-mobile-ide.ai-validations.feedback.email.group",
"actor_type": "user",
"@timestamp": "2025-12-04T11:16:03.000Z",
"@version": "1",
"region": "01",
"description": "Updating a system setting",
"action": "Update system setting",
"actor_id": "offline_job",
"resource_type": "config",
"tags": [
"tail.0"
],
"trace_id": "ed6b797ce28c46be8722126ace036678",
"custom_fields": {
"name": "scriptless-mobile-ide.ai-validations.feedback.email.group"
},
"hostname": "2477096963f1",
"tenant_id": "operator",
"module": "system-settings",
"changes": {
"value": {
"old": "ai-perfecto-feedback@perforce.com",
"new": "perfecto.noreply@perforce.com"
}
},
"product_name": "perfecto"
},
"sort": [
1764846963158
]
}
]
},
"status": 200
}
Error response
|
Field |
Description |
|---|---|
userMessage
|
Error message is shown |
developerMessage
|
You can send this value to Perfecto support to check errors and see if further investigation is needed |
JSON response
[
{
"userMessage":"ERROR_MESSAGE",
"developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
}
]
Sample Error response
A customer tried to search for audit data when Audit search functionality is not enabled
JSON response
[
{
"userMessage": "Audit search is not enabled for this tenant. Please contact Perfecto administrator to enable audit search logs.",
"developerMessage": "0d53607ba9ec46c39e1b2657ca83cf90"
}
]
User does not have permission to get audit logs:
JSON response
[
{
"userMessage": "operation for getting audit logs is not permitted for current user",
"developerMessage": "e47ee6ea72b3406ea054e7fbe088914b"
}
]
Passing status other than success/failure:
JSON response
[
{
"userMessage": "Status should be success or failure",
"developerMessage": "7317780cee0443af842944180832e96c"
}
]
Passing resourceType other than allowed values:
JSON response
[
{
"userMessage": "Resource type should be one of the resource types. Please refer to the documentation for the complete list.",
"developerMessage": "aa2788defb2d4dad8f586863bddc7269"
}
]
Passing action other than allowed values:
JSON response
[
{
"userMessage": "Action should be one of the allowed actions. Please refer to the documentation for the complete list.",
"developerMessage": "aa2788defb2d4dad8f586863bddc7269"
}
]
Passing description other than allowed values:
JSON response
[
{
"userMessage": "Description should be one of the allowed descriptions. Please refer to the documentation for the complete list.",
"developerMessage": "aa2788defb2d4dad8f586863bddc7269"
}
]
Passing actorType other than allowed values:
JSON response
[
{
"userMessage": "Actor type should be either 'admin' or 'user'",
"developerMessage": "aa2788defb2d4dad8f586863bddc7269"
}
]
Passing timestamp in another format:
JSON response
[
{
"userMessage": "Timestamp should be in ISO8601 format",
"developerMessage": "aa2788defb2d4dad8f586863bddc7269"
}
]