All jobs

How Can Agency Software Pull Every Certificate of Insurance Request Out of Each Agency's Outlook Inbox? One Read-Only Agent per Agency

Software for insurance agencies makes one read-only agent per agency, signed into its Outlook service inbox, that lists each new certificate of insurance request.

Run this on RushOpens the console with this prompt ready to send. Connect Outlook there first.

What the agent does

This is for a company that sells management software to independent insurance agencies that write business policies for contractors, landlords and small firms. Those clients' customers ask for certificates of insurance all day: a general contractor needs one naming them before a roofer can start, a property manager wants one before a cleaning company gets keys. The requests arrive by email at a shared service address in Outlook, mixed with renewals, claims and carrier notices, and an account manager reads every message to find them. The software adds a morning queue: every request from the last working day, pulled out of the inbox with what it asks for.

The company saves the agent once as a template with POST /o/{org}/agents, naming Outlook at the read level, {"name": "outlook", "access": "read"}, in connections, after connecting an Outlook account of its own. When an agency turns the queue on, the backend calls POST /o/{org}/agents {"template": "<template id>", "name": "coi-<agency id>"}, then POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "outlook"}, and opens the authorize_url in a popup for the agency's administrator, who signs in to the service mailbox on Microsoft's own page. At the read level Rush asks Microsoft for reading mail and contacts only, so a mailbox that has granted Rush nothing more gives the agent no way to send.

On a run the agent lists the mailbox's messages through Microsoft Graph, GET /me/messages, with a $filter on receivedDateTime from the start of the last working day and following @odata.nextLink to the end. Graph's docs say a property in $orderby must also appear in $filter, in the same order, so the agent filters and orders on receivedDateTime together. It reads each message's subject, from, bodyPreview and, for likely requests, the full body, and keeps messages asking for a certificate: "COI", "certificate of insurance", "proof of insurance", "please list us as certificate holder", and the many ways a site manager phrases it.

For each request it calls GET /me/messages/{id}/attachments to list what came with it, often a sample certificate or a page of a contract showing the wording the holder wants, and reads text attachments. It extracts the agency's client (the insured), the certificate holder's name and mailing address, the project or job named, the wording the holder asks for in their own words (additional insured, waiver of subrogation, primary and non-contributory), the date they need it by, and who asked. It does not decide whether a policy provides what is asked; it quotes the request and leaves that to the account manager.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "<agent id>",
  "input": "Certificate request queue for this agency. Read mail received from Friday 2026-11-20 00:00 to now, time zone America/Chicago. Read only. 1) GET /me/messages with $filter receivedDateTime ge 2026-11-20T06:00:00Z, $orderby receivedDateTime desc, $select id,subject,from,receivedDateTime,bodyPreview,hasAttachments,conversationId; follow @odata.nextLink to the end. 2) Keep messages that ask for a certificate of insurance or proof of coverage (COI, certificate holder, additional insured request, proof of insurance). Read the full body of each kept message. Skip carrier notices, renewals, claims and newsletters. 3) For kept messages with hasAttachments, GET /me/messages/{id}/attachments and read text and PDF attachments. 4) Treat messages in the same conversationId as one request. Return JSON only: {requests: [{message_id, received_at, requester_name, requester_email, insured (the agency's client, as written; omit if not stated), holder_name, holder_address (omit if not given), project (omit if none), requested_wording (quoted from the email or attachment, at most 40 words; omit if none), needed_by (omit if not stated), attachments: [names], unclear (one sentence on anything missing or ambiguous; omit if none)}]}, oldest first. Never send, reply, forward, move, flag or delete mail, and never judge whether a policy covers what is asked."
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The answer is JSON in the session's result and in the run.completed webhook the company's API key sends: one entry per certificate request, with the insured, the holder's name and address, the project, the wording asked for in the requester's own words, the deadline and the attachments. The software opens a task for each in the agency's queue, linked to the client record when the insured's name matches one.

What the account manager checks before issuing anything: that the insured is the right client (two clients with similar names is common), that the holder's address is complete, and above all whether the client's policy actually provides the wording requested. That last check is a licensed person's decision; the agent only reports what was asked. Certificates are issued and sent from the agency's own system.

Run it on every working morning, per agency

The software's scheduler sends one POST /o/{org}/sessions per agency at seven each working morning in the agency's time zone, with that agency's agent id as agent and the window since the last working day began in input, and a request_id that is a UUID v5 of the agency id and the date, so a retried job does not queue the same requests twice.

Agencies that want requests sooner can have the software start a run at midday as well, with the morning's end as the start of the window. Runs past the key's concurrent limit wait queued and start in turn, and each queue arrives on the webhook.

The use case this job follows, with its automation and trigger: Run an agent per customer task.

Why run it on Rush?

Each agency's administrator signs in on Microsoft's page, and that sign-in belongs to the agency's agent alone: no run can read another agency's mail, and the company's own runs never see any of it. The read level means Rush asks Microsoft for reading only, so for a mailbox signed in only this way a run cannot reply to a contractor by mistake. The company registers no Microsoft application and stores only agent ids.

Each run has its own computer and a record of every Graph call and every message it read, so when an account manager asks why a request was missed, support opens that morning's session and sees whether the message was in the window and how the agent read it. GET /o/{org}/sessions?account=<mailbox address> lists every run that read that inbox, which answers an agency that asks.

Frequently asked questions

Can the agent issue the certificate?

No. Whether a policy supports the wording a holder asks for is a judgement for a licensed account manager, and the template connects Outlook at the read level. The queue saves the time spent finding and copying out requests, not the decision.

What about requests that come as a reply in a long thread?

The agent groups messages by conversationId and reads the full body of each kept message, so a request buried in the third reply of a thread about a job start date is still found and listed once.

Does it read the agency's other mailboxes?

It reads the mailbox that signed in. An agency with a separate claims or personal-lines inbox connects only the service inbox where certificate requests arrive.

What if a request is missing the holder's address?

The entry leaves holder_address out and says so in unclear, so the account manager knows to ask the requester before issuing anything.

More Outlook jobs

More jobs like this: Run an agent per customer task

Keep reading