Awell Health Developer Hub
Developer Hub

Audit logs are detailed and comprehensible breadcrumbs providing a clear trail of all activities within your care flows and give insights into the precise moments and reasons behind the activation of tracks, steps, actions, and more.

Request

Query

  • graphql
01query GetAuditLogs(
02 $filters: PathwayFactsFilters!
03 $pagination: PaginationParams
04 $sorting: SortingParams
05) {
06 pathwayFacts(filters: $filters, pagination: $pagination, sorting: $sorting) {
07 code
08 success
09 facts {
10 date
11 level
12 pathway_id
13 content
14 }
15 pagination {
16 offset
17 count
18 total_count
19 }
20 sorting {
21 field
22 direction
23 }
24 }
25}

Variables

The pathway_id filter is the sole mandatory variable needed for the query to function.

Pagination and sorting parameters are provided for optional use. If not specified, pagination defaults to an offset of 0 and returns 10 records, while the sorting parameter is automatically set to arrange the audit logs in ascending order according to the date field.

Simple usage

Retrieve the first 10 audit logs for a given pathway in ascending order by date:

  • json
01{
02 "filters": {
03 "pathway_id": "example-pathway-id"
04 }
05}

Advanced usage

Retrieve audit logs for a given pathway with keyword filtering, custom pagination, and sorting. The keyword filter searches within the content of the audit logs, returning entries that contain the specified string in any part of their content.

  • json
01{
02 "filters": {
03 "pathway_id": "example-pathway-id",
04 "keyword": "track",
05 "date": {
06 "gte": "2022-01-01T00:00:00Z"
07 }
08 },
09 "pagination": {
10 "count": "20",
11 "offset": "0"
12 },
13 "sorting": {
14 "direction": "desc",
15 "field": "date"
16 }
17}