An agent never puts work in a queue: your system gets the answer and acts on it. Each
call is recorded as a run under the agent, with a summary of what was sent, the
answer it gave, which version answered and any actions it set off. An agent set to keep
records also keeps the document in equate, beside everything your pipelines
process.
Settings
An agent has every pipeline setting that means something for a single call.
Some pipeline settings are left out on purpose. They describe how documents arrive or who
works on them, and an agent has neither:
- Invoice source, triggers and timing. Your code sends the document, when it wants.
- Teams. Nothing lands in a review queue, so there is nobody to route it to.
- Documents at once. An agent has per-minute and per-day limits instead.
- Unknown senders and adding suppliers automatically. These are about email routing.
How matching is decided
An agent’s match runs through the same rules as a pipeline’s. Where it looks. Only in the booking data sources connected to the agent. A source that is switched off is skipped. If none of its sources can be used, nothing matches. How deep it compares. The depth is decided in this order:- On a plan without matching customisation, every match is held to Tier 1.
- The agent’s own depth, when one is set. Set one when supplier rules are off.
- The supplier’s depth, when the agent takes supplier rules and the document’s supplier is one of yours.
- Your workspace’s default depth.
- With sector rules on, the tier moves and tolerances you set per sector apply.
- With supplier rules on, the supplier’s own depth, tier moves and tolerances apply, and win over a sector rule on the same field.
- Your custom fields are read from the document and take part in the match, as on a pipeline. A required custom field that disagrees holds the match for review.
AUTO_MATCHED. A likely booking with a
disagreement is NEEDS_REVIEW. An agent never offers a booking that shares no reference,
name or amount with the document. That is NO_MATCH.
Documents that aren’t invoices
With Documents on (and document handling in your plan), the agent says what each document is:- An invoice is matched as described above.
- Anything else is named with the same document types a pipeline uses. If you have an enabled document handler for that type, the agent takes it. The document’s own columns are read, the data is narrowed to the fields the type carries, and it is matched field for field, with no tiers. A field the handler says must match, and that disagrees, holds the match for review. A handler set to pass documents on without a booking is answered as matched, with no booking.
- A document no handler covers is answered as not handled. It is read and named, not matched.
- A handler limited to specific pipelines does not cover agents. Only a handler set to cover every pipeline does.
- A handler’s own actions run for documents that arrive through a pipeline. For a document an agent takes, the agent’s actions run. A handler in test mode still puts its documents in test mode.
Actions
An agent can run the same actions as a pipeline: a webhook, an email, an export, an FTP upload or a row in a Google Sheet. Pick them from your action library and say which outcome each runs on.- An action can be limited to principal or agent bookings. It then only runs when the matched booking says so.
- Actions run after the agent has answered. A slow or failing destination never delays
or fails your call. The response lists what was set off under
actions, and each delivery and how it went is listed on the run’s page. - A delivery is tried up to three times, and never sent twice for the same run.
- In test mode nothing is run. The response still lists the actions, with the status
SKIPPED_TEST_MODE, so you can see what a live run would do. Runs from the playground never run actions, and report them the same way. - An action set to attach or link the agent copy sends the document the call sent, when the agent keeps files. Without a kept file, or for an action that only asks for a client copy or an email’s other attachments (a run has neither), it is sent without a file and the delivery says so.
- In a delivery’s payload,
jobIdis the id of the run (therunIdthe API answered with). - An action that runs once per batch (the batch summary email) cannot be added to an agent. An action set to run only by hand never runs from an agent.
Records
With Keep a record in equate on, each document the agent answers is kept as a record. New agents start with it on.- Where it shows. In the Invoice log (status Agent), in Reports (pick the Agent queue, or use the Agent and Agent outcome fields), in Analytics under Agents, and in the history of the booking it matched. Opening one shows what was read and the match, as for any invoice.
- It is never work. A record joins no queue. Nobody is asked to review it, it is not routed to a team, and it cannot be flagged, corrected, rematched or closed. Your system received the answer and acted on it.
- It stays out of your pipeline figures. Auto-match, issue and error rates, the dashboard and the daily digest count what your pipelines processed. Agents are reported on their own.
- Bookings count towards your plan. A booking an agent matches automatically
(
AUTO_MATCHED) is counted once, exactly as a pipeline’s match is. A booking a pipeline or another agent has already matched in the period is not counted again. Runs that end any other way, includingNEEDS_REVIEW, count nothing. - The file is kept only if you ask. Keep the file too stores the document with its record, where it follows your retention period. With it off, the record holds what was read and no file.
- Not everything is recorded. Playground tests, test mode and calls that could not read the document keep nothing.
Agents published before records existed keep none until you publish them again. Open the
agent, choose what to keep under Records, then publish.
Seen before
An agent that keeps records addsseenBefore to every answer. It is null when the
invoice is not on record. When equate already has an invoice with the same supplier and
reference, from an earlier call to an agent that keeps records or from a pipeline that
delivered it, it says so:
kindisduplicatewhen every field reads the same, andchangedwhen something differs.moneyChangedis true when the total, commission or VAT differs.changedFieldsnames what differs.handledByisagentorpipeline.
Outcomes
Every run that could read the document answers200 with an outcome:
Shaping the response
Every result carries three fields whatever the output settings say:documentis what the document is:type(invoice, a document type’s name, orother) andisInvoice. A handled document also carries its type’s own columns underfields.outcomeis one of the outcomes above.actionslists the actions the outcome set off, each with itsstatus.
seenBefore.
The output settings shape the rest:
datais the extracted fields, optionally limited to a chosen subset.matchis the match:matched,decision,confidence,bookingReference,bookingId,reasonand a field-by-field comparison. It is included whenever the agent has booking data and match output is on. For a document that was not matched,reasonsays why.filesis the document itself. It is off unless you switch Document on, since your system usually still holds the file it sent. Return it in the answer (contentBase64) or as a link (url, which works untilexpiresAt: 15 minutes to 7 days). A link is to the file the agent keeps, so it needs the agent to keep files; test mode and the playground keep none and return no link. Each entry also hasrole(original),fileName,contentTypeandsizeBytes.- Fixed values are constants you add at the top level, such as a
tenanttag. They can never replace one of the fields above.
The full request and response schemas are in the
API reference.
How a document is read
An agent reads a document the way a pipeline does, on the same models.- A PDF with a text layer is read from its text, and the supplier is also identified from the logos on it, so a supplier that appears only as a logo is still found.
- A scanned PDF with no text layer is sent to the model as the file. Logos are not read from it, and it cannot be named if it is not an invoice.
- A password-protected PDF cannot be read and is refused with a
400. - Text, sent inline or as a text or CSV file, is read as it is.
Lifecycle
1
Create a draft
Go to Agents and choose New agent. Name it, connect booking data if it should
match, and set the rest.
2
Test in the playground
Paste text or upload a file and run it against the draft. The result shows the
document, the outcome and the actions a live run would set off. Nothing is sent.
3
Publish
Publishing saves the settings as a version that never changes. Only a published
version answers API calls, and its number comes back in every response.
4
Change it safely
Keep editing the draft and publish again for a new version. Every run records the
version that answered it, and you can put an earlier version back into production
from the agent’s version history.
Agents created before they had these settings keep working as they did: sector rules
on, supplier rules off, the one depth they were given, every supplier, every document
read as an invoice, and no actions. Change the settings and publish to move one on.
Calling an agent
Every API call needs a workspace API key. Past runs, with
what was sent, what was answered and any deliveries, are listed under the agent.
Try it with the API quickstart
Build an agent and make your first API call end to end.