An Outlook API mock for renewal conversations.
Your agent reads Acme’s Kestrel renewal conversation and its schedule PDF, then sends a reply through Microsoft Graph. A state check finds the sent reply by recipient, subject, text and attachment.
renewal_sentmessage mailbox ancha@acme.example; folder sentitems; to laura@kestrel.example; subject contains renewal; text contains coverage; attachment name contains .pdf; exists true
Starting records
users
ancha@acme.example- displayName
Ancha Assistant
messages
- ref
renewal-request- subject
Kestrel renewal documents
folders
- ref
renewals- displayName
Renewals
messages / renewal-request / attachments
- name
renewal-schedule.pdf
Connect your agent to the Outlook mock
When ancha runs your agent, it sets:
MICROSOFT_GRAPH_API_URLMICROSOFT_GRAPH_ACCESS_TOKENMICROSOFT_GRAPH_TOKEN_URLMICROSOFT_GRAPH_CLIENT_IDMICROSOFT_GRAPH_CLIENT_SECRET
Point the client you already use at them.
import { Client } from '@microsoft/microsoft-graph-client';
const token = process.env.MICROSOFT_GRAPH_ACCESS_TOKEN!;
const graph = Client.init({ baseUrl: process.env.MICROSOFT_GRAPH_API_URL + '/', defaultVersion: 'v1.0', authProvider: (done) => done(null, token), fetchOptions: { headers: { authorization: 'Bearer ' + token } } });
const files = await graph.api('/me/mailFolders/inbox/messages').select('id,subject,from,bodyPreview').top(10).get();
// Next page: graph.api(files['@odata.nextLink'].slice(files['@odata.nextLink'].indexOf('/v1.0') + 5)).get()Locally, ancha runs your agent as an ordinary process, so keep real Outlook credentials out of its environment.
See all 28 endpoints
{tenant}
/{tenant}/oauth2/v2.0/tokenupload
/upload/{id}v1
/v1.0/me/v1.0/me/mailFolders/{id}/v1.0/me/mailFolders/{id}/v1.0/me/mailFolders/{id}/v1.0/me/mailFolders/{id}/v1.0/me/mailFolders/{id}/messages/v1.0/me/mailFolders/{id}/messages/delta/v1.0/me/messages/v1.0/me/messages/v1.0/me/messages/{id}/v1.0/me/messages/{id}/v1.0/me/messages/{id}/v1.0/me/messages/{id}/attachments/v1.0/me/messages/{id}/attachments/v1.0/me/messages/{id}/attachments/v1.0/me/messages/{id}/attachments/createUploadSession/v1.0/me/messages/{id}/copy/v1.0/me/messages/{id}/createForward/v1.0/me/messages/{id}/createReply/v1.0/me/messages/{id}/createReplyAll/v1.0/me/messages/{id}/forward/v1.0/me/messages/{id}/move/v1.0/me/messages/{id}/reply/v1.0/me/messages/{id}/replyAll/v1.0/me/messages/{id}/send/v1.0/me/sendMailSeed your own data
The data the Outlook mock starts with on every run, cut to a few records. ancha twins seed outlook prints every field.
Full seed YAML
twins:
- outlook
seed:
outlook:
me: ancha@acme.example
users:
- email: ancha@acme.example
displayName: Ancha Assistant
folders:
- ref: renewals
mailbox: ancha@acme.example
displayName: Renewals
parent: inbox
messages:
- ref: renewal-request
mailbox: ancha@acme.example
received: -4h
conversation: kestrel-renewal
subject: Kestrel renewal documents
body:
contentType: html
content: <p>Please review the attached renewal schedule before Friday.</p>
from:
emailAddress:
address: laura@kestrel.example
name: Laura
toRecipients:
- emailAddress:
address: ancha@acme.example
attachments:
- "@odata.type": "#microsoft.graph.fileAttachment"
name: renewal-schedule.pdf
contentType: application/pdf
contentBytes: JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFs0IDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1R5cGUxIC9CYXNlRm9udCAvSGVsdmV0aWNhID4+CmVuZG9iago0IDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQgMiAwIFIgL01lZGlhQm94IFswIDAgNjEyIDc5Ml0gL1Jlc291cmNlcyA8PCAvRm9udCA8PCAvRjEgMyAwIFIgPj4gPj4gL0NvbnRlbnRzIDUgMCBSID4+CmVuZG9iago1IDAgb2JqCjw8IC9MZW5ndGggMjE0ID4+CnN0cmVhbQpCVCAvRjEgMTEgVGYgNzIgNzUwIFRkIDE0IFRMIChLZXN0cmVsIENyZWRpdCBVbmlvbikgJyAoUmVuZXdhbCBzY2hlZHVsZSAyMDI3KSAnIChQcm9wZXJ0eSBjb3ZlcmFnZTogVVNEIDIsMDAwLDAwMC4pICcgKExpYWJpbGl0eSBjb3ZlcmFnZTogVVNEIDUsMDAwLDAwMC4pICcgKFBsZWFzZSBjb25maXJtIHRoZSBjb3ZlcmFnZSBhbW91bnRzIGJlZm9yZSBGcmlkYXkuKSAnIEVUCmVuZHN0cmVhbQplbmRvYmoKNiAwIG9iago8PCAvVGl0bGUgKEtlc3RyZWwgcmVuZXdhbCBzY2hlZHVsZSkgL1Byb2R1Y2VyIChBbmNoYSkgPj4KZW5kb2JqCnhyZWYKMCA3CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDU4IDAwMDAwIG4gCjAwMDAwMDAxMTUgMDAwMDAgbiAKMDAwMDAwMDE4NSAwMDAwMCBuIAowMDAwMDAwMzExIDAwMDAwIG4gCjAwMDAwMDA1NzYgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA3IC9Sb290IDEgMCBSIC9JbmZvIDYgMCBSID4+CnN0YXJ0eHJlZgo2NDkKJSVFT0YK
isInline: false
Check what your agent did
Checks YAML
checks:
- id: renewal_sent
state:
outlook.message:
mailbox: ancha@acme.example
folder: sentitems
to: laura@kestrel.example
subject_contains: renewal
text_contains: coverage
attachment_name_contains: .pdf
exists: trueMore chat and email tools
All 43 toolsOutlook API mock FAQ
How does an Outlook agent connect through Microsoft Graph?
Set the Graph client’s base URL to MICROSOFT_GRAPH_API_URL and use MICROSOFT_GRAPH_ACCESS_TOKEN as its delegated bearer token. In a world with Outlook and Microsoft Word, both tools share the same Graph base URL and token.
Can my agent use application authentication for Outlook mail?
Exchange MICROSOFT_GRAPH_CLIENT_ID and MICROSOFT_GRAPH_CLIENT_SECRET at MICROSOFT_GRAPH_TOKEN_URL with grant_type=client_credentials and scope=https:/. Use the returned token on /. Microsoft Graph requires delegated authentication for /.
How can I check that the renewal message has its PDF attachment?
Use an outlook.message state check with mailbox, folder, subject_contains and attachment_name_contains: .pdf. Add text_contains to check the message body. Text and attachment names compare without regard to case.
Install the CLI and run your agent against the Outlook mock.
Ancha is not affiliated with Outlook.