Review work
After an agent takes action on a Business report, Middesk stores a record of its findings and how each finding was applied or not applied to the report. This record is represented as an agent_application in the API.
Understanding the results
Each agent_application answers three questions:
- What did the agent find?
resolutionscontains one entry for each reviewed finding.original_artifactpreserves what the agent proposed and any supporting sources, whileagent_display_nameidentifies the agent that produced it. - What was done with those findings?
outcomerecords how the finding was handled.resolved_artifact,correction, andexclusionshow any adjustments.actionslists the actions taken, andexecution_resultshows whether they were applied, partially applied, left the report unchanged, or failed. - How did the Business report change?
changescontains the effects recorded for completed actions, andreport_transitionssummarizes relevant before-and-after report values. At the application level,review_task_transitionsrecords corresponding changes to the Business’s review tasks.
Checking screenshot capture status
When web evidence screenshot capture is enabled for your agents, the screenshot_captures object tells you whether captures have completed for an agent run.
Only one state indicates pending work, so check for that state rather than for a timestamp:
screenshot_captures reflects the status for the result’s run_id. If another agent run applies findings, its new result may show pending captures even when earlier results are settled.
When a screenshot is available, its source includes a screenshot_id that you can use to retrieve the Document.
If your workflow requires available screenshots in the Business PDF, retrieve the latest PDF when no captures are pending.
Receiving updates through webhooks
Middesk sends a business.updated event after an agent finishes acting on its findings and its agent_application can be reviewed. If screenshots are still pending, Middesk sends another business.updated event after all capture operations finish.
Default webhook payloads don’t include agent_applications. To include these records and their screenshot status, add agent_applications and the nested screenshot_captures field to a custom event schema.
Use the webhook event schema API to configure these fields, then choose which webhook events to subscribe to and when they are sent.
Agent application fields
Select only the fields your integration uses. The following selection shows every available field:
Each result contains these top-level fields:
Automating how findings are applied
Each item in resolutions includes decision_mode, which shows whether its outcome was chosen manually or automatically. Learn about configuring your interrupt policy to control which findings apply automatically and which pause for human review.