What the agent does
This is for a company that sells software to property managers and landlords. Tenants rarely use the portal: they email their manager about a dripping tap, a broken intercom or a heater that clicks and does nothing, and those emails sit in the manager's Outlook until someone retypes them as work orders. The company saves one agent as a template that names Outlook at the read level, "connections": [{"name": "outlook", "access": "read"}], which covers Microsoft Graph's Mail.Read and Contacts.Read. For each manager who turns the feature on, the backend makes an agent from the template and stores its id against that manager.
The manager connects their own mailbox once. The backend calls POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "outlook"} and opens the returned authorize_url in a popup; the manager signs in on Microsoft's page, which names Rush as the app asking. The software company registers no Microsoft app and never stores a token. Rush asks Microsoft for the read level's permissions, and the token Rush holds is used only from outside the agent's computer.
Each run reads one window of mail. The agent calls Microsoft Graph's GET /me/messages with a $filter on receivedDateTime from the time in its input and $select for the sender, subject, received time, body and whether the message has attachments, following @odata.nextLink until the window is read. It asks for bodies as text with the Prefer: outlook.body-content-type="text" header. It reads the manager's contacts with GET /me/contacts so it can match a sender's address to the tenant and unit the manager saved there, and it falls back to the address and unit the tenant wrote in the email.
For each email that reports a problem in a unit, it drafts a work order: the property and unit, the tenant, what is wrong in one sentence, where in the unit, since when, any access notes the tenant gave ("I work from home, come any time"), whether photos are attached, and the words in the email that suggest it is urgent, such as water coming through a ceiling. It does not diagnose the fault, price the repair or pick a contractor. Rent questions, notices and anything that is not a repair are left out and counted.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "<agent id>",
"input": "Read mail received since 2026-11-12 07:00 UTC. Use the manager's Outlook contacts to match each sender to a tenant and unit; if there is no match, use the address and unit the email gives, and mark unit_source as email. For each email reporting a repair problem in a unit, return a draft work order: property, unit, unit_source, tenant name and email, problem (one sentence in your words), location in the unit, since when, access notes, has_attachments, urgent_words (the exact words that suggest urgency, if any), and the message's received time. Do not diagnose, estimate cost or suggest contractors. Return only JSON: work_orders, plus a count of emails that were not repair requests. Send no email."
}- 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.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- 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 with a work_orders list and a count of the emails it skipped, in the session's result and in the run.completed webhook. The software shows each draft in the manager's queue beside a link to the original email. The manager approves it, edits it or throws it away, and only an approved draft becomes a work order a contractor sees.
What the manager checks: the unit, when the match came from the email and not from their contacts; anything listed in urgent_words, which they should act on themselves rather than leave in a queue; and duplicates, since a tenant who emails twice about the same leak produces two drafts. The session records the mailbox it read in accounts, and its transcript shows every Graph call, so a draft that names the wrong unit can be traced to the line that caused it.
Run it on every hour, per manager
The software's scheduler sends one POST /o/{org}/sessions per connected manager each hour during the working day, with the window start in input, and a request_id that is a UUID v5 of the manager's id and that window so a retried job never doubles the drafts. Runs past the key's concurrent limit are created queued and start as slots free.
The webhook handler verifies the signature, matches the execution_id to the manager it saved at start, and adds the drafts to that manager's queue. Mail that arrives over a weekend is simply in the next window.
The use case this job follows, with its automation and trigger: Run an agent per customer task.
Why run it on Rush?
Each manager's mailbox holds tenants' names, addresses and complaints, so the hard part is keeping one manager's mail away from everything else. On Rush a manager's Outlook belongs to their own agent: its runs see that mailbox and nothing of the company's or another manager's, and a session that used it is readable only by whoever started it and the org's owners and admins.
The work itself is reading, which needs judgement about what counts as a repair and what is urgent, and every run keeps a record of what it read and decided. When a manager leaves, DELETE /o/{org}/agents/{agent} disconnects their Outlook; a Microsoft app is removed on its own, without touching the manager's other connected apps.
Frequently asked questions
Can the agent reply to the tenant?
Not with this prompt, and the template asks for the read level. Microsoft can still issue a token with every Outlook permission the manager granted Rush earlier, which is why the prompt also says to send no email and the transcript records every call.
What if the tenant writes from an address the manager has not saved?
The agent uses the unit and address written in the email and marks unit_source as email, so the manager knows the match is not from their contacts. An email with no unit at all is still drafted, with the unit left empty for the manager to fill.
Does it read the whole mailbox?
It reads messages received in the window it is given, through Graph's $filter on receivedDateTime. The grant covers the mailbox, as any mail-reading permission does, so the window and the prompt are what keep each run small.
Can it tell how urgent a repair is?
It quotes the words that suggest urgency and leaves the judgement to the manager. It does not give safety advice; a tenant describing a gas smell or flooding needs a person, not a queue.