Search tasks

distru-search-tasksRead

Searches the caller's company's tasks — to-dos assigned to a user with a due date, optionally linked to one record.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
limitintegerNoDefault: 10
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
idsstring[]No
searchstringNoCase-insensitive substring of name. Ranked by name similarity; sortBy ignored.
statusesenum[]
ACTIVECOMPLETED
No
ownerIdsstring[]NoAssignees. Resolve via distru-search-users.
dueDateAfterstringNoInclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset.
dueDateBeforestringNoInclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset.
relatedTypesenum[]
ASSEMBLYBATCHCOMPANYCONTACTINVOICEORDER_SHIPMENTPRODUCTPURCHASE_ORDERREQUESTRETURNSALES_ORDERSTOCK_TRANSFER
NoTasks linked to any record of these types. Not combinable with the record ID filters (companyIds, salesOrderIds, …).
assemblyIdsstring[]NoResolve via distru-search-assemblies.
batchIdsstring[]NoResolve via distru-search-batches.
companyIdsstring[]NoResolve via distru-search-companies.
contactIdsstring[]NoResolve via distru-search-contacts.
invoiceIdsstring[]NoResolve via distru-search-invoices.
productIdsstring[]NoResolve via distru-search-products.
purchaseOrderIdsstring[]NoResolve via distru-search-purchase-orders.
returnIdsstring[]NoResolve via distru-search-returns.
salesOrderIdsstring[]NoResolve via distru-search-sales-orders.
customFieldsobject[]NoSet one of contains, anyOf or onOrAfter/onOrBefore per entry. Records with no value for the field never match.
customFields[].customFieldIdstringYesResolve via distru-search-custom-fields.
customFields[].containsstringNoTEXT: case-insensitive substring.
customFields[].anyOfstring[]NoDROPDOWN, CHECKBOX: any of these options, case-sensitive.
customFields[].onOrAfterstringNoDATE: YYYY-MM-DD, company timezone.
customFields[].onOrBeforestringNoDATE: YYYY-MM-DD, company timezone.
sortByobjectNoDefault UPDATED_AT DESC. Ignored when search is set.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
DUE_DATEINSERTED_ATNAMEUPDATED_AT
Yes

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].descriptionstringCan be null
items[].statusenum
ACTIVECOMPLETED
Always
items[].dueDatestringAlways
items[].insertedAtstringAlways
items[].updatedAtstringAlways
items[].relatedTypeenum
ASSEMBLYBATCHCOMPANYCONTACTINVOICEORDER_SHIPMENTPRODUCTPURCHASE_ORDERREQUESTRETURNSALES_ORDERSTOCK_TRANSFER
Can be null
items[].companyobjectNull or absent
items[].company.idstringAlways
items[].company.namestringNull or absent
items[].salesOrderobjectCan be null
items[].salesOrder.idstringAlways
items[].salesOrder.orderNumberstringAlways
items[].purchaseOrderobjectCan be null
items[].purchaseOrder.idstringAlways
items[].purchaseOrder.purchaseNumberstringAlways
items[].invoiceobjectCan be null
items[].invoice.idstringAlways
items[].invoice.invoiceNumberstringAlways
items[].productobjectCan be null
items[].product.idstringAlways
items[].product.namestringAlways
items[].product.skustringAlways
items[].batchobjectCan be null
items[].batch.idstringAlways
items[].batch.namestringAlways
items[].contactobjectCan be null
items[].contact.idstringAlways
items[].contact.profileobjectAlways
items[].contact.profile.fullNamestringAlways
items[].assemblyobjectCan be null
items[].assembly.idstringAlways
items[].assembly.numberstringAlways
items[].returnobjectCan be null
items[].return.idstringAlways
items[].return.returnNumberstringAlways
items[].ownerobjectCan be null
items[].owner.idstringAlways
items[].owner.profileobjectAlways
items[].owner.profile.fullNamestringAlways
items[].creatorobjectCan be null
items[].creator.idstringAlways
items[].creator.profileobjectAlways
items[].creator.profile.fullNamestringAlways
items[].locationobjectCan be null
items[].location.idstringAlways
items[].location.namestringAlways
items[].customFieldsobject[]Always
items[].customFields[].customFieldobjectAlways
items[].customFields[].customField.idstringAlways
items[].customFields[].customField.namestringAlways
items[].customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
items[].customFields[].valuestringCan be null
What the AI reads

Searches the caller's company's tasks — to-dos assigned to a user with a due date, optionally linked to one record. Use it to list what is due or overdue, what a user has to do, or what is open on a record. owner is the assignee. The linked record sits under the key for relatedType (company, salesOrder, purchaseOrder, invoice, product, batch, contact, assembly or return); the others are null. It is also null when the caller cannot see it or it was deleted, and for stock transfers, order shipments and requests, which only relatedType names. At most one record ID filter (companyIds, salesOrderIds, purchaseOrderIds, invoiceIds, productIds, batchIds, contactIds, assemblyIds, returnIds).