Outlook Mail Real Time Events


🚧

If you are using real-time events for the EMAIL category for the first time, ensure that a webhookUrl is registered. You can do this using the Register Webhook for a Category API.

List of Events Supported by Outlook Mail

Event IDSupportNotes
email_messages_newYes
email_messages_modifiedYes
email_messages_deletedYes

Subscribe to Outlook Mail Real Time Events

To subscribe to Outlook mail real-time events, you can use the Subscribe to Real Time Events API.

Subscribe to All Mail Folders

By default, the subscription applies to all folders in the mailbox (Inbox, Sent Items, Drafts, etc.).

Example request:

curl --location 'https://api.getknit.dev/v1.0/events.subscribe' \
--header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
    "events": [
        "email_messages_new",
        "email_messages_modified",
        "email_messages_deleted"
    ]
}'

Subscribe to Specific Folder(s)

If you want to receive events only for specific mail folders, you can provide a list of folderIds in the metadata object.

You can retrieve folder IDs using the List Folders API.

Example request (subscribing to specific folders):

curl --location 'https://api.getknit.dev/v1.0/events.subscribe' \
--header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
    "events": [
        "email_messages_new",
        "email_messages_modified",
        "email_messages_deleted"
    ],
    "metadata": {
        "folderIds": [
            "folder1_id",
            "folder2_id"
        ]
    }
}'

Important Notes

  1. Calling the Subscribe to Real Time Events API multiple times overwrites the existing subscription.
  2. The latest request fully replaces any previously subscribed events or metadata (including folder filters).