Outlook

Learn how to use Outlook with Composio

Overview

SLUG: OUTLOOK

Description

Outlook is Microsoft’s email and calendaring platform integrating contacts, tasks, and scheduling, enabling users to manage communications and events in a unified workspace

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to Calendars.Read,Calendars.ReadWrite,Calendars.ReadWrite.Shared,Contacts.ReadWrite,Mail.Read,Mail.ReadWrite,Mail.Send,offline_access,User.Read
bearer_token
string

Connecting to Outlook

Create an auth config

Use the dashboard to create an auth config for the Outlook toolkit. This allows you to connect multiple Outlook accounts to Composio for agents to use.

1

Select App

Navigate to Outlook.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Outlook Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4outlook_auth_config_id = "ac_YOUR_OUTLOOK_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Outlook: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, outlook_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Outlook toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["OUTLOOK"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Add mail attachment

Description

Tool to add an attachment to an email message. use when you have a message id and need to attach a small (<3 mb) file or reference.

Action Parameters

contentBytes
Required
contentId
string
contentLocation
string
contentType
string
isInline
boolean
item
object
message_id
stringRequired
name
stringRequired
odata_type
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Email Rule

Description

Create email rule filter with conditions and actions

Action Parameters

actions
objectRequired
conditions
objectRequired
displayName
stringRequired
isEnabled
booleanDefaults to True
sequence
integerDefaults to 1

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete mail folder

Description

Delete a mail folder from the user's mailbox. use when you need to remove an existing mail folder.

Action Parameters

folder_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Download Outlook attachment

Description

Downloads a specific file attachment from an email message in a microsoft outlook mailbox; the attachment must contain 'contentbytes' (binary data) and not be a link or embedded item.

Action Parameters

attachment_id
stringRequired
file_name
stringRequired
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get mail delta

Description

Tool to retrieve incremental changes (delta) of messages in a mailbox. use when syncing mailbox updates since last checkpoint.

Action Parameters

count
boolean
delta_token
string
expand
array
filter
string
folder_id
string
orderby
array
search
string
select
array
skip
integer
skip_token
string
top
integer
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get mail tips

Description

Tool to retrieve mail tips such as automatic replies and mailbox full status. use when you need to check recipient status before sending mail.

Action Parameters

EmailAddresses
arrayRequired
MailTipsOptions
arrayRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Outlook calendars

Description

Tool to list calendars in the signed-in user's mailbox. use when you need to retrieve calendars with optional odata queries.

Action Parameters

filter
string
orderby
array
select
array
skip
integer
top
integer
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Calendar Event

Description

Creates a new outlook calendar event, ensuring `start datetime` is chronologically before `end datetime`.

Action Parameters

attendees_info
array
body
stringRequired
categories
array
end_datetime
stringRequired
is_html
boolean
is_online_meeting
boolean
location
string
online_meeting_provider
string
show_as
stringDefaults to busy
start_datetime
stringRequired
subject
stringRequired
time_zone
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create contact

Description

Creates a new contact in a microsoft outlook user's contacts folder.

Action Parameters

birthday
string
businessPhones
array
categories
array
companyName
string
department
string
displayName
string
emailAddresses
array
givenName
string
homePhone
string
jobTitle
string
mobilePhone
string
notes
string
officeLocation
string
surname
string
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create email draft

Description

Creates an outlook email draft with subject, body, recipients, and an optional attachment. supports creating drafts as part of existing conversation threads by specifying a conversationid; attachments require a name, mimetype, and content.

Action Parameters

attachment
object
bcc_recipients
array
body
stringRequired
cc_recipients
array
conversation_id
string
is_html
boolean
subject
stringRequired
to_recipients
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get contact

Description

Retrieves a specific outlook contact by its `contact id` from the contacts of a specified `user id` (defaults to 'me' for the authenticated user).

Action Parameters

contact_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get calendar event

Description

Retrieves the full details of a specific calendar event by its id from a user's outlook calendar, provided the event exists.

Action Parameters

event_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Outlook profile

Description

Retrieves the microsoft outlook profile for a specified user.

Action Parameters

user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List events

Description

Retrieves events from a user's outlook calendar via microsoft graph api, supporting pagination, filtering, property selection, sorting, and timezone specification.

Action Parameters

expand_recurring_events
boolean
filter
string
orderby
array
select
array
skip
integer
timezone
stringDefaults to UTC
top
integerDefaults to 10
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List mail folders

Description

Tool to list a user's top-level mail folders. use when you need folders like inbox, drafts, sent items; set include hidden folders=true to include hidden folders.

Action Parameters

include_hidden_folders
boolean
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Messages

Description

Retrieves a list of email messages from a specified mail folder in an outlook mailbox, with options for filtering, pagination, and sorting; ensure 'user id' and 'folder' are valid, and all date/time strings are in iso 8601 format.

Action Parameters

categories
array
folder
stringDefaults to inbox
from_address
string
has_attachments
boolean
importance
string
is_read
boolean
orderby
arrayDefaults to ['receivedDateTime desc']
received_date_time_ge
string
received_date_time_gt
string
received_date_time_le
string
received_date_time_lt
string
select
array
sent_date_time_gt
string
sent_date_time_lt
string
skip
integer
subject
string
subject_contains
string
subject_endswith
string
subject_startswith
string
top
integerDefaults to 10
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Move message to folder

Description

Move a message to another folder within the specified user's mailbox. this creates a new copy of the message in the destination folder and removes the original message.

Action Parameters

destination_id
stringRequired
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Reply to Email

Description

Sends a plain text reply to an outlook email message, identified by `message id`, allowing optional cc and bcc recipients.

Action Parameters

bcc_emails
array
cc_emails
array
comment
stringRequired
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Send email

Description

Sends an email with subject, body, recipients, and an optional attachment via microsoft graph api; attachments require a non-empty file with valid name and mimetype.

Action Parameters

attachment
object
bcc_emails
array
body
stringRequired
cc_emails
array
is_html
boolean
save_to_sent_items
booleanDefaults to True
subject
stringRequired
to_email
stringRequired
to_name
string
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update email message

Description

Updates specified properties of an existing email message; `message id` must identify a valid message within the specified `user id`'s mailbox.

Action Parameters

bcc_recipients
array
body
object
cc_recipients
array
importance
stringDefaults to normal
message_id
stringRequired
subject
string
to_recipients
array
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update mailbox settings

Description

Tool to update mailbox settings for the signed-in user. use when you need to configure automatic replies, default time zone, language, or working hours. example: schedule automatic replies for vacation.

Action Parameters

automaticRepliesSetting
object
language
object
timeZone
string
workingHours
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create calendar

Description

Tool to create a new calendar in the signed-in user's mailbox. use when organizing events into a separate calendar.

Action Parameters

color
string
hexColor
string
name
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create contact folder

Description

Tool to create a new contact folder in the user's mailbox. use when needing to organize contacts into custom folders.

Action Parameters

displayName
stringRequired
parentFolderId
string
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create mail folder

Description

Tool to create a new mail folder. use when you need to organize email into a new folder.

Action Parameters

displayName
stringRequired
isHidden
boolean
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create master category

Description

Tool to create a new category in the user's master category list. use after selecting a unique display name.

Action Parameters

color
string
displayName
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get mailbox settings

Description

Tool to retrieve mailbox settings. use when you need to view settings such as automatic replies, time zone, and working hours for the signed-in or specified user.

Action Parameters

expand
array
select
array
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get master categories

Description

Tool to retrieve the user's master category list. use when you need to get all categories defined for the user.

Action Parameters

filter
string
orderby
array
select
array
skip
integer
top
integer
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get supported languages

Description

Tool to retrieve supported languages in the user's mailbox. use when you need to display or select from available mailbox languages.

Action Parameters

user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get supported time zones

Description

Tool to retrieve supported time zones in the user's mailbox. use when you need a list of time zones to display or choose from for event scheduling.

Action Parameters

timeZoneStandard
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List event attachments

Description

Tool to list attachments for a specific outlook calendar event. use when you have an event id and need to view its attachments.

Action Parameters

event_id
stringRequired
filter
string
orderby
array
select
array
skip
integer
top
integer
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Outlook attachments

Description

Lists metadata (like name, size, and type, but not `contentbytes`) for all attachments of a specified outlook email message.

Action Parameters

message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List event reminders

Description

Tool to retrieve reminders for events occurring within a specified time range. use when you need to see upcoming reminders between two datetimes.

Action Parameters

endDateTime
stringRequired
startDateTime
stringRequired
userId
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Add event attachment

Description

Adds an attachment to a specific outlook calendar event. use when you need to attach a file or nested item to an existing event.

Action Parameters

contentBytes
string
event_id
stringRequired
item
object
name
stringRequired
odata_type
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create a draft reply

Description

Creates a draft reply in the specified user's outlook mailbox to an existing message (identified by a valid `message id`), optionally including a `comment` and cc/bcc recipients.

Action Parameters

bcc_emails
array
cc_emails
array
comment
string
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Contact

Description

Permanently deletes an existing contact, using its `contact id` (obtainable via 'list user contacts' or 'get contact'), from the outlook contacts of the user specified by `user id`.

Action Parameters

contact_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Calendar Event

Description

Deletes an existing calendar event, identified by its unique `event id`, from a specified user's microsoft outlook calendar, with an option to send cancellation notifications to attendees.

Action Parameters

event_id
stringRequired
send_notifications
booleanDefaults to True
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get contact folders

Description

Tool to retrieve a list of contact folders in the signed-in user's mailbox. use after authentication when you need to browse or select among contact folders.

Action Parameters

expand
array
filter
string
orderby
array
select
array
skip
integer
top
integer
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get email message

Description

Retrieves a specific email message by its id from the specified user's outlook mailbox, provided the message id exists for that user.

Action Parameters

message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get schedule

Description

Retrieves free/busy schedule information for specified email addresses within a defined time window.

Action Parameters

EndTime
objectRequired
Schedules
arrayRequired
StartTime
objectRequired
availabilityViewInterval
stringDefaults to 30

Action Response

data
object
error
string
successful
booleanRequired

Tool Name: List Outlook contacts

Description

Retrieves a user's microsoft outlook contacts, from the default or a specified contact folder.

Action Parameters

contact_folder_id
string
filter
string
orderby
array
select
array
top
integerDefaults to 10
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Search Outlook messages

Description

Searches messages in a microsoft 365 or enterprise outlook account mailbox, supporting filters for sender, subject, attachments, pagination, and sorting by relevance or date.

Action Parameters

enable_top_results
boolean
fromEmail
string
from_index
integer
hasAttachments
boolean
query
stringRequired
size
integerDefaults to 25
subject
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update calendar event

Description

Updates specified fields of an existing outlook calendar event.

Action Parameters

attendees
array
body
object
categories
array
end_datetime
string
event_id
stringRequired
location
object
show_as
stringDefaults to busy
start_datetime
string
subject
string
time_zone
stringDefaults to UTC
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Contact

Description

Updates an existing outlook contact, identified by `contact id` for the specified `user id`, requiring at least one other field to be modified.

Action Parameters

birthday
string
businessPhones
array
categories
array
companyName
string
contact_id
stringRequired
department
string
displayName
string
emailAddresses
array
givenName
string
homePhones
array
jobTitle
string
mobilePhone
string
notes
string
officeLocation
string
surname
string
user_id
stringDefaults to me

Action Response

data
objectRequired
error
string
successful
booleanRequired