Autotask icon

Autotask

Interact with Kaseya's Autotask PSA REST API to manage companies, tickets, contracts, and more.

Actions1078

Purchase Approval → Get Many (Advanced)

AI-generated

Summary

Retrieves multiple Purchase Approvals from Autotask using a custom JSON filter query conforming to the Autotask API. The advanced filter must include a "filter" array with query criteria, and may optionally include a "MaxRecords" value, which is validated to be an integer between 1 and 500 to avoid server errors.

Inputs

  • advancedFilter (required) — Must be a JSON string containing a "filter" array with Autotask API query criteria. Optionally, the JSON can include a "MaxRecords" integer between 1 and 500 (inclusive); values outside this range cause a clear validation error. Use 'Get Field Info' to confirm exact field names, then use 'Search Filter Build' to construct the filter JSON. (Autotask API docs: https://ww4.autotask.net/help/DeveloperHelp/Content/APIs/REST/API_Calls/REST_Basic_Query_Calls.htm)
  • maxRecords — Maximum number of records to return (1-500). Only used if 'Get All' is disabled.
  • returnAll — Whether to return all results or limit the count. When enabled, 'maxRecords' is ignored.
  • addPicklistLabels — Automatically adds '_label' fields for picklist values with human-readable text.
  • addReferenceLabels — Automatically adds '_label' fields for reference fields with human-readable text.
  • selectColumns — Selects specific fields to include in the response. If empty, all fields are returned. The ID field is always included.
  • flattenUdfs — Brings user-defined fields to the top level of each object instead of nesting them in 'userDefinedFields'.

Output shape

A list of items, each containing the fields of a Purchase Approval object.

Fields are returned based on the 'Select Columns' and 'Flatten User-Defined Fields' settings. Picklist and reference labels are added if their respective options are enabled.

Examples

Example 1: Fetch the first 10 Purchase Approvals from the current year.

Get All: false, Max Records: 10, Advanced Filter: 'requestDate', '>=', '2024-01-01'

Example 2: Retrieve all pending approvals for a specific company.

Get All: true, Advanced Filter: 'status', '==', 'Pending', 'companyID', '==', '12345'

Links

Discussion