Audit Logs
The audit log shows various changes in a Zendesk account since the account was created. Records of these changes are saved indefinitely and you can view the entire change history. For more information, see Viewing the audit log for changes in Zendesk help.
The Audit Logs endpoints are only available on the Enterprise plan.
JSON format
Audit Logs are represented as JSON objects with the following properties:
| Name | Type | Read-only | Mandatory | Description |
|---|---|---|---|---|
| action | string | true | false | Type of change made. Possible values are "create", "destroy", "exported", "login", and "update" |
| action_label | string | true | false | Localized string of action field |
| actor_id | integer | true | false | id of the user or system that initiated the change |
| actor_name | string | true | false | Name of the user or system that initiated the change |
| change_description | string | true | false | The description of the change that occurred |
| created_at | string | true | false | The time the audit got created |
| id | integer | true | false | The id automatically assigned upon creation |
| ip_address | string | true | false | The IP address of the user doing the audit |
| source_id | integer | true | false | The id of the item being audited |
| source_label | string | true | false | The name of the item being audited |
| source_type | string | true | false | Item type being audited. Typically describes the system where the change was initiated. Possible values vary based on your account's Zendesk products and activity. Common values include "apitoken", "rule", "ticket", "user", and "zendesk/app_market/app". The "rule" value is used for automations, macros, triggers, views, and other automated business rules |
| url | string | true | false | The URL to access the audit log |
Example
{"action": "update","action_label": "Updated","actor_id": 1234,"actor_name": "Sameer Patel","change_description": "Role changed from Administrator to End User","created_at": "2012-03-05T11:32:44Z","id": 498483,"ip_address": "209.119.38.228","source_id": 3456,"source_label": "John Doe","source_type": "user","url": "https://company.zendesk.com/api/v2/audit_logs/498483"}
List Audit Logs
GET /api/v2/audit_logs
Allowed For
- Admins on accounts that have audit log access
Pagination
- Cursor pagination (recommended)
- Offset pagination
See Pagination.
Returns a maximum of 100 records per page.
Filtering by multiple values
To filter by multiple values for the same field, repeat the filter parameter and append empty square brackets "[]" to the name of each repeated parameter. For example, to return audit logs where action is "create", "update", or "destroy":
/api/v2/audit_logs?filter[action][]=create&filter[action][]=update&filter[action][]=destroy
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| filter[action] | string | Query | false | Filter audit logs by the action |
| filter[actor_id] | integer | Query | false | Filter audit logs by the actor id |
| filter[created_at] | string | Query | false | Filter audit logs by the time of creation. When used, you must specify filter[created_at] twice in your request, first with the start time and again with an end time |
| filter[ip_address] | string | Query | false | Filter audit logs by the ip address |
| filter[source_id] | integer | Query | false | Filter audit logs by the source id. Requires filter[source_type] to also be set |
| filter[source_type] | string | Query | false | Filter audit logs by the source type. For example, user or rule |
| page | object | Query | false | Cursor-based pagination parameters (JSON:API style). Supports nested parameters: - page[size] - Number of records per page (default varies by endpoint, typically 100) - page[after] - Cursor token to fetch records after this position - page[before] - Cursor token to fetch records before this position Example: ?page[size]=50&page[after]=eyJvIjoiaWQiLCJ2IjoiYVFFPSJ9 |
| per_page | integer | Query | false | Number of records to return per page. Note: Default and maximum values vary by endpoint. Check endpoint-specific documentation for limits. |
| sort | string | Query | false | Cursor pagination only. Sort audit logs. Default is sort=-created_at |
| sort_by | string | Query | false | Offset pagination only. Sort audit logs. Default is sort_by=created_at |
| sort_order | string | Query | false | Offset pagination only. Sort audit logs. Default is sort_order=desc |
Code Samples
curl
curl -g 'https://helpdesk.zendesk.com/api/v2/audit_logs?filter[source_type]=user&filter[source_id]=123' \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/audit_logs?filter[action]=&filter[actor_id]=&filter[created_at]=&filter[ip_address]=&filter[source_id]=&filter[source_type]=&page=&per_page=50&sort=&sort_by=&sort_order="method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")