Graph subscriptions
Overview
Microsoft Graph subscriptions enable applications to receive real-time notifications when changes occur in user or organizational resources. Through Rewst, you can utilize subscriptions as workflow triggers, automating processes such as ticket creation in your PSA when a new user is added to Microsoft 365.
Supported Subscriptions
Rewst currently supports various subscriptions, each tailored to specific organizational needs:
User Changes
The Users trigger is a webhook trigger that receives webhooks whenever a change occurs to any user in a Microsoft Graph API organization.
Purpose: To monitor and respond to changes in users within a Microsoft Graph API organization.
Trigger Details:
Name: Users
Description: Changes to all users
Type: Webhook trigger
Webhook URL template:
/webhooks/microsoft_graph/{trigger_id}/{org_id}
User Trigger Parametersโ
The following are the parameters that can be passed to the Users trigger:
resource
immutable str
chats/getAllMessages
The resource to subscribe to.
max_expiration_time_minutes
immutable int
60
The maximum amount of time (in minutes) before the subscription expires.
change_type
immutable str
created,updated
The type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
User Outputโ
The Users trigger has a default output schema that includes the following fields:
id
string
The ID of the change notification.
subscriptionId
string
The ID of the subscription.
subscriptionExpirationDateTime
datetime
The expiration datetime for this subscription.
changeType
string
The type of changes being subscribed to.
clientState
string
An ID used internally to validate the subscription payloads.
tenantId
string
The Microsoft tenant ID tied to this subscription.
resourceData
object
The resource data object describing the change notification.
Group Changes
Purpose: To subscribe to changes in all groups within Microsoft Graph, receiving notifications when groups are created or updated.
Trigger Details:
Name: Groups
Description: Changes to all groups
Type: Webhook
Webhook URL Template:
/webhooks/microsoft_graph/{trigger_id}/{org_id}
Group Trigger Parametersโ
The following parameters are available for the Groups trigger:
resource
immutable str
chats/getAllMessages
The resource to subscribe to.
max_expiration_time_minutes
immutable int
60
The maximum amount of time (in minutes) before the subscription expires.
change_type
immutable str
created,updated
The type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
Group Outputโ
The output schema for the Groups trigger is an object with the following properties:
id
string
The ID of the change notification.
subscriptionId
string
The ID of the subscription.
subscriptionExpirationDateTime
datetime
The expiration datetime for this subscription.
changeType
string
The type of changes being subscribed to.
clientState
string
An ID used internally to validate the subscription payloads.
tenantId
string
The Microsoft tenant ID tied to this subscription.
resourceData
object
The resource data object describing the change notification.
New Chat Message
Purpose: To receive notifications for changes in chat messages across all chats.
Chat Message Parametersโ
resource
immutable str
chats/getAllMessages
The resource to subscribe to.
max_expiration_time_minutes
immutable int
60
The maximum amount of time (in minutes) before the subscription expires.
change_type
immutable str
created,updated
The type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messages
bool
true
Whether or not to decrypt the message payloads in incoming webhooks from this subscription.
Chat Message Outputโ
The output schema for the Chat trigger is an object with the following properties:
id
string
The ID of the change notification.
subscriptionId
string
The ID of the subscription.
subscriptionExpirationDateTime
datetime
The expiration datetime for this subscription.
changeType
string
The type of changes being subscribed to.
clientState
string
An ID used internally to validate the subscription payloads.
tenantId
string
The Microsoft tenant ID tied to this subscription.
decryptedContent
object
The resource data object describing the change notification.
encryptedContent
object
The resource data object describing the change notification.
resourceData
object
The resource data object describing the change notification.
The output schema for the Chat trigger decryptedContent
property is object with the following properties:
id
string
The ID of the chat message.
replyToId
string
The ID of the message that this message is a reply to.
from
object
The sender of the chat message.
etag
string
An opaque string value that changes whenever the message is changed or deleted.
messageType
string
The type of the chat message.
createdDateTime
datetime
The timestamp of when the chat message was created.
lastModifiedDateTime
datetime
The timestamp of when the chat message was last modified.
lastEditedDateTime
datetime
The timestamp of when the chat message was last edited.
deletedDateTime
datetime
The timestamp of when the chat message was deleted.
subject
string
The subject of the chat message.
body
object
The content of the chat message.
summary
string
A short summary of the chat message.
attachments
array
The attachments (if any) associated with the chat message.
mentions
array
The mentions (if any) in the chat message.
importance
string
The importance of the chat message.
reactions
array
The reactions (if any) to the chat message.
locale
string
The locale of the chat message.
policyViolation
object
If the chat message violates a policy, this property provides details.
chatId
string
The ID of the chat thread.
channelIdentity
object
The identity of the channel where the chat message was posted.
webUrl
string
The URL of the chat message in the Teams UI.
eventDetail
object
Additional details about the chat message event.
New Chat Message Subscription by Chat ID
This trigger receives webhook notifications from Microsoft Graph for changes to chat messages in a specific chat. See these instructions to get the chat ID from Microsoft Teams.
Chat message by Chat ID Parametersโ
resource
immutable str
chats/getAllMessages
The resource to subscribe to.
max_expiration_time_minutes
immutable int
60
The maximum amount of time (in minutes) before the subscription expires.
change_type
immutable str
created,updated
The type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messages
bool
true
Whether or not to decrypt the message payloads in incoming webhooks from this subscription.
chat_id
string
undefined
The chat ID to subscribe to
Chat Message by Chat ID Outputโ
The output schema for the Chat trigger is an object with the following properties:
id
string
The ID of the change notification.
subscriptionId
string
The ID of the subscription.