Audits
Retrieve Audit
Get a single audit using its id.
Grouping Tasks
By default, the audit's tasks array contains a flat list of audit_task objects. If you'd like the tasks grouped by item or by layout, pass a group_by query parameter. When group_by is supplied, tasks will be returned as an empty array and the tasks will be returned under either by_item (a map of item_id to tasks) or by_layout (a map of layout_id to tasks).
- group_by - Can be
by_itemorby_layout.
List Audits
Example
When you want to retrieve multiple audits, your data property on the result will always be an array even if you don't have any audits.
Pagination
If the has_more property on the pagination object is set to true, there are more audits in the database that have not been returned. The pagination object also has a page property indicating your current offset and a limit property. The total_count property returns the total number of audits in the database.
By default the page is set to 1 and the limit is 25.
Filter
You can filter audits by location_id, item_id, layout_id, reason_code_id, assignee, status, priority, overdue, complete_at, finished_at, created_at, updated_at, created_by, and updated_by.
- location_id - Filter audits at a specific location. For example:
location_id=loc_czhgjrk5JaVvyATPDbyURp
item_id - Filter audits that contain a task for a specific item. For example:
item_id=item_5TngYZKdRFTSkcVCvNa885layout_id - Filter audits that contain a task for a specific layout. For example:
layout_id=lay_vgM65sMYtakxwfXkTCC8FBreason_code_id - Filter audits that contain a task with a specific reason code. For example:
reason_code_id=rsnc_aBcDeFgHiJkLmNoPqRsTassignee - Filter audits assigned to a specific contact. For example:
assignee=ctct_czhgjrk5JaVvyATPDbyURpstatus - Filter audits by status. Supports the filter operators (
eq,!eq,in,!in). Valid statuses arecreated,processing,in_review,recount,approved, andcanceled. For example:status=in:processing,in_review
priority - Filter audits by priority. Valid priorities are
low,medium, andhigh. For example:priority=highoverdue - Filter audits by their overdue flag. Accepts
trueorfalse. For example:overdue=truecomplete_at - Filter audits by their scheduled completion date. Supports date filter operators (
eq,!eq,gt,gte,lt,lte,bwe,bwi,in,!in). For example:complete_at=gte:1739898954finished_at - Filter audits by the date they were approved. Supports date filter operators (
eq,!eq,gt,gte,lt,lte,bwe,bwi,in,!in). For example:finished_at=gte:1739898954created_at - Filter audits by creation date. Supports date filter operators (
eq,!eq,gt,gte,lt,lte,bwe,bwi,in,!in). For example:created_at=gte:1739898954updated_at - Filter audits by last updated date. Supports date filter operators (
eq,!eq,gt,gte,lt,lte,bwe,bwi,in,!in). For example:updated_at=gte:1739898954created_by - Filter audits by the user or API key that created them. Accepts a
user_orkey_prefixed ID. For example:created_by=user_czhgjrk5JaVvyATPDbyURpupdated_by - Filter audits by the user or API key that last updated them. Accepts a
user_orkey_prefixed ID. For example:updated_by=user_czhgjrk5JaVvyATPDbyURp
Grouping
You can also group the tasks within each returned audit using the same group_by parameter described above. The behavior matches the retrieve endpoint: tasks are returned under by_item or by_layout instead of the flat tasks array.
- group_by - Can be
by_itemorby_layout.
Sorting
Sorting describes in what order you want your responses to come in. You can select an available property by which to sort, as well as the direction.
- order_by - The property by which to sort. Available properties are:
created_at,updated_at,complete_at,finished_at,priority. - direction - The direction to sort. Available directions are:
ascanddesc.
By default, audits will be sorted by created_at in descending order, meaning the most recently created audits are returned first.
Search
You can do a fuzzy, typo-tolerant search of every audit in the database by providing the search query parameter.
Searchable Properties
number
To search, simply provide a string to search by using the search query param. If you want to highlight matching search results for a frontend, we provide a special property for search-returned audit objects called _search which will have the matched text surrounded with <mark> handles.
Ordering Search Results
By default, search results are ordered by relevance. However, if you include an order_by parameter along with your search query, the results will be ordered by the specified property instead of by relevance.