feat(coderd): add format option to inbox notifications watch endpoint (#17034)

This PR aims to allow clients to use different format for the title and
content of inbox notifications - on the watch endpoint.

This solution will help to have it working and formatted differently on
VSCode, WebUI ...
[Related to this issue](https://github.com/coder/internal/issues/523)
This commit is contained in:
Vincent Vielle
2025-03-21 16:41:13 +01:00
committed by GitHub
parent 0474888eb4
commit 82e37732ea
6 changed files with 128 additions and 17 deletions

View File

@ -61,11 +61,12 @@ curl -X GET http://coder-server:8080/api/v2/notifications/inbox \
### Parameters
| Name | In | Type | Required | Description |
|---------------|-------|--------|----------|-------------------------------------------------------------------------|
| `targets` | query | string | false | Comma-separated list of target IDs to filter notifications |
| `templates` | query | string | false | Comma-separated list of template IDs to filter notifications |
| `read_status` | query | string | false | Filter notifications by read status. Possible values: read, unread, all |
| Name | In | Type | Required | Description |
|-------------------|-------|--------------|----------|-----------------------------------------------------------------------------------------------------------------|
| `targets` | query | string | false | Comma-separated list of target IDs to filter notifications |
| `templates` | query | string | false | Comma-separated list of template IDs to filter notifications |
| `read_status` | query | string | false | Filter notifications by read status. Possible values: read, unread, all |
| `starting_before` | query | string(uuid) | false | ID of the last notification from the current page. Notifications returned will be older than the associated one |
### Example responses
@ -146,6 +147,14 @@ curl -X GET http://coder-server:8080/api/v2/notifications/inbox/watch \
| `targets` | query | string | false | Comma-separated list of target IDs to filter notifications |
| `templates` | query | string | false | Comma-separated list of template IDs to filter notifications |
| `read_status` | query | string | false | Filter notifications by read status. Possible values: read, unread, all |
| `format` | query | string | false | Define the output format for notifications title and body. |
#### Enumerated Values
| Parameter | Value |
|-----------|-------------|
| `format` | `plaintext` |
| `format` | `markdown` |
### Example responses