Audit Logs

JSON Format

AuditLog have the following keys:

Name Type Read-only Mandatory Comment
id integer yes no Automatically assigned upon creation
action string yes no create/update/destroy
actor_id integer yes no id of the user creating the ticket
source_id integer yes no id of the item being audited
source_type string yes no type of the item being audited
source_label string yes no name of the item being audited
changes_description string yes no description of the change that occurred
ip_address string yes no ip of the user doing the audit
created_at date yes no The time the audit got created
Example
{
  "id":           498483,
  "actor_id":     1234,
  "source_id":    3456,
  "source_type":  "user",
  "source_label": "John Doe",
  "action":       "update",
  "changes_description": "Role changed from Administrator to End User"
  "ip_address":   "209.119.38.228",
  "created_at":  "2012-03-05T11:32:44Z",
  "url":          "https://company.zendesk.com/api/v2/audit_logs/498483.json",
}

Listing Audit Logs

GET /api/v2/audit_logs.json

Allowed For
  • Admins on accounts that have audit-log access
Using curl
 curl https://helpdesk.zendesk.com/api/v2/audit_logs.json \
   -v -u {email_address}:{password}
Filtering
By source type:
?filter[source_type]=user
?filter[source_type]=rule

By exact source:
?filter[source_type]=user&filter[source_id]=123

By actor:
?filter[actor_id]=123

By IP address:
?filter[ip_address]=127.0.0.1

By time of creation:
?filter[created_at][]=2013-01-01T00:00:00Z&filter[created_at][]=2013-01-01T23:59:59Z

Control sort order (default is `sort_by=created_at`, `sort_order=desc`):
?sort_by=actor_id&sort_order=asc
 curl -g 'https://helpdesk.zendesk.com/api/v2/audit_logs.json?filter[source_type]=user&filter[source_id]=123' \
   -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "audit_logs": [
    {
      "id":           498483,
      "actor_id":     1234,
      "source_id":    3456,
      "source_type":  "user",
      "source_label": "John Doe",
      "action":       "update",
      "change_description": "Role changed from Administrator to End User"
      "ip_address":   "209.119.38.228",
      "created_at":   "2012-03-05T11:32:44Z",
      "url":          "https://company.zendesk.com/api/v2/audit_logs/498483.json",
    },
    ...
  ]
}

Getting Audit Logs

GET /api/v2/audit_logs/{id}.json

Allowed For
  • Admins on accounts that have audit-log access
Using curl
 curl https://helpdesk.zendesk.com/api/v2/audit_logs/{id}.json \
   -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "audit_log": {
    "id":           498483,
    "actor_id":     1234,
    "source_id":    3456,
    "source_type":  "user",
    "source_label": "John Doe",
    "action":       "update",
    "changes_description": "Role changed from Administrator to End User"
    "ip_address":   "209.119.38.228",
    "created_at":  "2012-03-05T11:32:44Z",
    "url":          "https://company.zendesk.com/api/v2/audit_logs/498483.json",
  }
}