1.27. Auditing

DHIS2 does automatic auditing on all update and deletions of aggregate data values, tracked entity data values, tracked entity attribute values, and this chapter will explain the web-api available for fetching this data back out again.

1.27.1. Aggregate data value audits

The endpoint for aggregate data value audits is located at /api/audits/dataValue, and the available parameters are displayed in the table below.

Table 1.50. Aggregate data value query parameters

ParameterOptionDescription
dsData SetOne or more data set identifiers to get data elements from.
deData ElementOne or more data element identifiers.
peISO PeriodOne or more period ISO identifiers.
ouOrganisation UnitOne or more org unit identifiers.
auditTypeUPDATE | DELETEFilter by audit type.
skipPagingfalse | trueTurn paging on / off
page1 (default)If paging is enabled, this parameter decides which page to show


Get all audits for data set with ID "lyLU2wR22tC":

/api/26/audits/dataValue?ds=lyLU2wR22tC

1.27.2. Tracked entity data value audits

The endpoint for tracked entity data value audits is located at /api/audits/trackedEntityDataValue, and the available parameters are displayed in the table below.

Table 1.51. Tracked entity data value query parameters

ParameterOptionDescription
deData ElementOne or more data element identifiers.
psProgram Stage EntityOne or more program stage instance identifiers.
auditTypeUPDATE | DELETEFilter by audit type.
skipPagingfalse | trueTurn paging on / off
page1 (default)If paging is enabled, this parameter decides which page to show

Get all audits which have data element ID eMyVanycQSC or qrur9Dvnyt5:

/api/26/audits/trackedEntityDataValue?de=eMyVanycQSC&de=qrur9Dvnyt5

1.27.3. Tracked entity attribute value audits

The endpoint for tracked entity attribute value audits is located at /api/audits/trackedEntityAttributeValue, and the available parameters are displayed in the table below.

Table 1.52. Tracked entity attribute value query parameters

ParameterOptionDescription
teaTracked Entity AttributesOne or more tracked entity attribute identifiers.
teTracked Entity InstancesOne or more tracked entity instance identifiers.
auditTypeUPDATE | DELETEFilter by audit type.
skipPagingfalse | trueTurn paging on / off
page1 (default)If paging is enabled, this parameter decides which page to show

Get all audits which have attribute with ID VqEFza8wbwA:

/api/26/audits/trackedEntityAttributeValue?tea=VqEFza8wbwA