Skip to main content
An agent does to a document what a pipeline does: it reads it, says what it is, matches it to a booking under your business rules and sets off your actions. The difference is how it is driven. A pipeline works through documents as they arrive and puts what it is unsure of in a queue for a person. An agent is called by your own code over the API, one document at a time, and answers in the same request. Agents and pipelines are separate. A pipeline does not run on an agent, and you do not need an agent to use pipelines. Use an agent when a program, not a person, should see the result first. See agent mode vs workflow mode.
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.
The rules that compare a document with ones equate processed earlier do not apply either: duplicates, re-issues, “already in your system”, superseded invoices, guest copy waits and quality sampling. They hold a document for a person, and an agent has nobody to hold it for. An agent that keeps records tells you instead: the answer says when the invoice is on record already, and your system decides what a repeat means. A file holding several documents is read as one document, and agent and client copies are not paired. If you need any of these, push the document into a pipeline instead.

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:
  1. On a plan without matching customisation, every match is held to Tier 1.
  2. The agent’s own depth, when one is set. Set one when supplier rules are off.
  3. The supplier’s depth, when the agent takes supplier rules and the document’s supplier is one of yours.
  4. Your workspace’s default depth.
Which rules apply.
  • 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.
The document’s supplier is the one of your suppliers whose name the document carries. A match that agrees on every field in force is 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.
Two differences from a pipeline:
  • 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.
With Documents off, every document is read as an invoice.

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, jobId is the id of the run (the runId the 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, including NEEDS_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.
With it off, nothing is kept beyond the run and no booking is counted.
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 adds seenBefore 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:
  • kind is duplicate when every field reads the same, and changed when something differs.
  • moneyChanged is true when the total, commission or VAT differs.
  • changedFields names what differs.
  • handledBy is agent or pipeline.
It is a flag, never a hold. The document is still read, matched and answered, and its actions still run. A document that is not an invoice is never looked up.

Outcomes

Every run that could read the document answers 200 with an outcome:

Shaping the response

Every result carries three fields whatever the output settings say:
  • document is what the document is: type (invoice, a document type’s name, or other) and isInvoice. A handled document also carries its type’s own columns under fields.
  • outcome is one of the outcomes above.
  • actions lists the actions the outcome set off, each with its status.
An agent that keeps records also answers with seenBefore. The output settings shape the rest:
  • data is the extracted fields, optionally limited to a chosen subset.
  • match is the match: matched, decision, confidence, bookingReference, bookingId, reason and 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, reason says why.
  • files is 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 until expiresAt: 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 has role (original), fileName, contentType and sizeBytes.
  • Fixed values are constants you add at the top level, such as a tenant tag. They can never replace one of the fields above.
Document fields and the match result each return every field, or a set you choose: pick Choose fields and tick them in the searchable list.
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.
A version fixes every setting above, including which actions are linked and which suppliers it takes. The actions themselves live in your action library, so changing where a webhook posts takes effect straight away for every agent and pipeline that uses it.
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.