Skip to content

Commit 0d97b51

Browse files
committed
feat: expose outlookSubscription in account info API
Add outlookSubscription field to GET /v1/account/{account} response to allow users to retrieve Microsoft Graph subscription details, including clientState for webhook validation at proxy level.
1 parent 56f421b commit 0d97b51

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/api-routes/account-routes.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,8 @@ async function init(args) {
817817
'connections',
818818
'webhooksCustomHeaders',
819819
'locale',
820-
'tz'
820+
'tz',
821+
'outlookSubscription'
821822
]) {
822823
if (key in accountData) {
823824
result[key] = accountData[key];
@@ -1014,6 +1015,17 @@ async function init(args) {
10141015

10151016
syncTime: Joi.date().iso().example('2021-02-17T13:43:18.860Z').description('Last sync time'),
10161017

1018+
outlookSubscription: Joi.object({
1019+
id: Joi.string().description('Microsoft Graph subscription ID'),
1020+
expirationDateTime: Joi.date().iso().description('When the subscription expires'),
1021+
clientState: Joi.string().description('Shared secret for validating webhook notifications'),
1022+
state: Joi.object({
1023+
state: Joi.string().valid('creating', 'created', 'error').description('Subscription state'),
1024+
time: Joi.number().description('Timestamp of last state change'),
1025+
error: Joi.string().description('Error message if state is error')
1026+
}).description('Current subscription state')
1027+
}).description('Microsoft Graph subscription details (Outlook accounts only)'),
1028+
10171029
lastError: lastErrorSchema.allow(null)
10181030
}).label('AccountResponse'),
10191031
failAction: 'log'

0 commit comments

Comments
 (0)