Skip to content

Latest commit

 

History

History
238 lines (115 loc) · 25.8 KB

File metadata and controls

238 lines (115 loc) · 25.8 KB

Microsoft Graph subscriptions

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.

For additional information, see Microsoft's documentation on graph API subscriptions.

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:

NameData TypeDefault ValueDescription
resourceimmutable strchats/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe 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:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
resourceDataobjectThe 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:

NameData TypeDefault ValueDescription
resourceimmutable strchats/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe 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:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
resourceDataobjectThe 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​
NameData TypeDefault ValueDescription
resourceimmutable strchats/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messagesbooltrueWhether 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:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
decryptedContentobjectThe resource data object describing the change notification.
encryptedContentobjectThe resource data object describing the change notification.
resourceDataobjectThe resource data object describing the change notification.
Output schema

The output schema for the Chat trigger decryptedContent property is object with the following properties:

FieldTypeDescription
idstringThe ID of the chat message.
replyToIdstringThe ID of the message that this message is a reply to.
fromobjectThe sender of the chat message.
etagstringAn opaque string value that changes whenever the message is changed or deleted.
messageTypestringThe type of the chat message.
createdDateTimedatetimeThe timestamp of when the chat message was created.
lastModifiedDateTimedatetimeThe timestamp of when the chat message was last modified.
lastEditedDateTimedatetimeThe timestamp of when the chat message was last edited.
deletedDateTimedatetimeThe timestamp of when the chat message was deleted.
subjectstringThe subject of the chat message.
bodyobjectThe content of the chat message.
summarystringA short summary of the chat message.
attachmentsarrayThe attachments (if any) associated with the chat message.
mentionsarrayThe mentions (if any) in the chat message.
importancestringThe importance of the chat message.
reactionsarrayThe reactions (if any) to the chat message.
localestringThe locale of the chat message.
policyViolationobjectIf the chat message violates a policy, this property provides details.
chatIdstringThe ID of the chat thread.
channelIdentityobjectThe identity of the channel where the chat message was posted.
webUrlstringThe URL of the chat message in the Teams UI.
eventDetailobjectAdditional details about the chat message event.

New chat message subscription by chat ID

Purpose: 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​
NameData TypeDefault ValueDescription
resourceimmutable strchats/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messagesbooltrueWhether or not to decrypt the message payloads in incoming webhooks from this subscription.
chat_idstringundefinedThe 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:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
decryptedContentobjectThe resource data object describing the change notification.
encryptedContentobjectThe resource data object describing the change notification.
resourceDataobjectThe resource data object describing the change notification.
Output schema

The output schema for the Chat trigger decryptedContent property is object with the following properties:

FieldTypeDescription
idstringThe ID of the chat message.
replyToIdstringThe ID of the message that this message is a reply to.
fromobjectThe sender of the chat message.
etagstringAn opaque string value that changes whenever the message is changed or deleted.
messageTypestringThe type of the chat message.
createdDateTimedatetimeThe timestamp of when the chat message was created.
lastModifiedDateTimedatetimeThe timestamp of when the chat message was last modified.
lastEditedDateTimedatetimeThe timestamp of when the chat message was last edited.
deletedDateTimedatetimeThe timestamp of when the chat message was deleted.
subjectstringThe subject of the chat message.
bodyobjectThe content of the chat message.
summarystringA short summary of the chat message.
attachmentsarrayThe attachments (if any) associated with the chat message.
mentionsarrayThe mentions (if any) in the chat message.
importancestringThe importance of the chat message.
reactionsarrayThe reactions (if any) to the chat message.
localestringThe locale of the chat message.
policyViolationobjectIf the chat message violates a policy, this property provides details.
chatIdstringThe ID of the chat thread.
channelIdentityobjectThe identity of the channel where the chat message was posted.
webUrlstringThe URL of the chat message in the Teams UI.
eventDetailobjectAdditional details about the chat message event.

New teams message

Purpose: Changes to chat messages in all channels in all teams.

All channels chat messages parameters​
NameData TypeDefault ValueDescription
resourceimmutable strteams/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messagesbooltrueWhether or not to decrypt the message payloads in incoming webhooks from this subscription.
All channels chat messages output​

The output schema for the Teams trigger is an object with the following properties:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
decryptedContentobjectThe resource data object describing the change notification.
encryptedContentobjectThe resource data object describing the change notification.
resourceDataobjectThe resource data object describing the change notification.
Output schema

The output schema for the Chat trigger decryptedContent property is object with the following properties:

FieldTypeDescription
idstringThe ID of the chat message.
replyToIdstringThe ID of the message that this message is a reply to.
fromobjectThe sender of the chat message.
etagstringAn opaque string value that changes whenever the message is changed or deleted.
messageTypestringThe type of the chat message.
createdDateTimedatetimeThe timestamp of when the chat message was created.
lastModifiedDateTimedatetimeThe timestamp of when the chat message was last modified.
lastEditedDateTimedatetimeThe timestamp of when the chat message was last edited.
deletedDateTimedatetimeThe timestamp of when the chat message was deleted.
subjectstringThe subject of the chat message.
bodyobjectThe content of the chat message.
summarystringA short summary of the chat message.
attachmentsarrayThe attachments (if any) associated with the chat message.
mentionsarrayThe mentions (if any) in the chat message.
importancestringThe importance of the chat message.
reactionsarrayThe reactions (if any) to the chat message.
localestringThe locale of the chat message.
policyViolationobjectIf the chat message violates a policy, this property provides details.
chatIdstringThe ID of the chat thread.
channelIdentityobjectThe identity of the channel where the chat message was posted.
webUrlstringThe URL of the chat message in the Teams UI.
eventDetailobjectAdditional details about the chat message event.

New teams message subscription by team and channel ID

Purpose: Changes to chat messages in a specific channel. See these instructions to get the team ID and channel ID from Microsoft Teams.

Teams message parameters​
NameData TypeDefault ValueDescription
resourceimmutable strteams/getAllMessagesThe resource to subscribe to.
max_expiration_time_minutesimmutable int60The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strcreated,updatedThe type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
decrypt_messagesbooltrueWhether or not to decrypt the message payloads in incoming webhooks from this subscription.
team_idstringundefinedThe channel ID to subscribe to
channel_idstringundefinedThe team ID of the channel to subscribe to
Teams message output​

The output schema for the Teams trigger is an object with the following properties:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
decryptedContentobjectThe resource data object describing the change notification.
encryptedContentobjectThe resource data object describing the change notification.
resourceDataobjectThe resource data object describing the change notification.
Output schema

The output schema for the Chat trigger decryptedContent property is object with the following properties:

FieldTypeDescription
idstringThe ID of the chat message.
replyToIdstringThe ID of the message that this message is a reply to.
fromobjectThe sender of the chat message.
etagstringAn opaque string value that changes whenever the message is changed or deleted.
messageTypestringThe type of the chat message.
createdDateTimedatetimeThe timestamp of when the chat message was created.
lastModifiedDateTimedatetimeThe timestamp of when the chat message was last modified.
lastEditedDateTimedatetimeThe timestamp of when the chat message was last edited.
deletedDateTimedatetimeThe timestamp of when the chat message was deleted.
subjectstringThe subject of the chat message.
bodyobjectThe content of the chat message.
summarystringA short summary of the chat message.
attachmentsarrayThe attachments (if any) associated with the chat message.
mentionsarrayThe mentions (if any) in the chat message.
importancestringThe importance of the chat message.
reactionsarrayThe reactions (if any) to the chat message.
localestringThe locale of the chat message.
policyViolationobjectIf the chat message violates a policy, this property provides details.
chatIdstringThe ID of the chat thread.
channelIdentityobjectThe identity of the channel where the chat message was posted.
webUrlstringThe URL of the chat message in the Teams UI.
eventDetailobjectAdditional details about the chat message event.

New security alert

Purpose: This trigger receives webhook notifications from Microsoft Graph for new Security Alerts.

Security alert parameters
NameData TypeDefault ValueDescription
resourceimmutable strsecurity/alerts?$filter=Status eq 'NewAlert'The resource to subscribe to.
max_expiration_time_minutesimmutable int43100The maximum amount of time (in minutes) before the subscription expires.
change_typeimmutable strupdatedThe type of change to listen for. Possible values are "created", "updated", "deleted", and "deleted,updated".
Security alert output​

The output schema for the Security Alerts trigger is an object with the following properties:

ParameterTypeDescription
idstringThe ID of the change notification.
subscriptionIdstringThe ID of the subscription.
subscriptionExpirationDateTimedatetimeThe expiration datetime for this subscription.
changeTypestringThe type of changes being subscribed to.
clientStatestringAn ID used internally to validate the subscription payloads.
tenantIdstringThe Microsoft tenant ID tied to this subscription.
resourceDataobjectThe resource data object describing the change notification.