You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+28-7
Original file line number
Diff line number
Diff line change
@@ -275,11 +275,32 @@ Takes a list of notifications and marks them as unseen for the user who submitte
275
275
276
276
### Expire a notification right away
277
277
This effectively deletes notifications by pushing their expiration time up to the time this request is made.
278
-
* Path: `/api/V1/notification/expire`
278
+
* Path: `/api/V1/notifications/expire`
279
279
* Method: `POST`
280
-
* Required header: `Authorization` - requires a service token.
281
-
* URL Parameters: one of the following:
282
-
*`id` = the notification id
283
-
*`external_key` = the external key
284
-
If both parameters are present, a 400 Bad Request error will be returned.
285
-
Also note that services can only expire their own notifications.
280
+
* Required header: `Authorization` - requires a service token or admin token.
281
+
* Expected body:
282
+
```
283
+
{
284
+
"note_ids": [ list of notification ids ],
285
+
"external_keys": [ list of external keys ]
286
+
}
287
+
```
288
+
At least one of the above keys must be present. If external keys are used, this must be called by a service
289
+
with a valid service token that maps to the source key in the notification. That is, only services can expire
290
+
their own notifications.
291
+
292
+
(For now, admins can only expire global notifications)
293
+
* Returns:
294
+
```
295
+
{
296
+
"expired": {
297
+
"note_ids": [ list of expired notification ids ],
298
+
"external_keys": [ list of expired notifications by external key ]
299
+
},
300
+
"unauthorized": {
301
+
"note_ids": [ list of not-expired note ids ],
302
+
"external_keys": [ list of not-expired external keys ]
303
+
}
304
+
}
305
+
```
306
+
This will include all of the ids passed to the endpoint, put into one category or the other. Any that were "unauthorized" either don't exist, or came from a different service than the given auth token.
0 commit comments