Audit Entries API

List audit entries

List all audit entries for an account:

GET /audit_lines

Response

Status: 200 OK
[
  {
    "id": 354217,
    "action": "update",
    "created_at": "2017-01-21T14:47:11-06:00",
    "user": {
      "id": 156,
      "display_name": "Ellen Brown",
      "account": {
        "id": "widget",
        "name": "Widget International"
      }
    },
    "audited": "project",
    "project": {
      "id": 7497,
      "display_name": "7497 Digital Operations Center (DOC)"
    }
  },
  {
    "id": 354216,
    "action": "create",
    "created_at": "2017-01-21T14:46:47-06:00",
    "user": {
      "id": 128,
      "display_name": "Howard Tanner",
      "account": {
        "id": "widget",
        "name": "Widget International"
      }
    },
    "audited": "request",
    "request": {
      "id": 70486,
      "display_name": "70486 Unable to access SAP"
    }
  },
  "..."
]

The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of audit entries.

Collection Fields

By default the following fields will appear in collections of Project Categories:

Sorting

By default a collection of Sites is sorted descending by id. The following field is accepted by the ?sort= parameter:

id

Get a single audit entry

GET /audit_lines/:id

Response

Status: 200 OK
{
  "id": 354217,
  "action": "update",
  "created_at": "2017-01-21T14:47:11-06:00",
  "user": {
    "id": 156,
    "display_name": "Ellen Brown",
    "account": {
      "id": "widget",
      "name": "Widget International"
    }
  },
  "audited": "project",
  "project": {
    "id": 7497,
    "display_name": "7497 Digital Operations Center (DOC)"
  },
  "changes": {
    "justification": [
      "compliance",
      "correction"
    ]
  }
}

The response contains these fields.

Fields

action
Readonly enum — The Action field indicates the type of transactions that caused the audit entry to be generated. Possible values are:
  • create: Create
  • update: Update
  • destroy: Destroy
auditable
Readonly reference — The Auditable field provides the ID and display name of the record for which the audit entry was generated. The name of this field is returned as the Audited field value.
audited
Readonly enum — The Audited field contains the record type name of the record for which the audit entry was generated.
changes
Optional hash — The Changes field provides the old and the new value of each field’s value that was set or changed by the transaction that caused the audit entry to be generated.
created_at
Readonly datetime — The date and time at which the audit entry was created.
id
Readonly integer — The unique ID of the audit entry.
user
Readonly reference to Person — The User field is set to the person who caused the audit entry to be generated.