Files
lincodex/api/core/routes/candidate_notification_read.yml
T

44 lines
2.1 KiB
YAML

post:
operationId: MarkMyNotificationRead
summary: Mark an item of the inbox of the current candidate as read.
description: |-
Requires the session cookie of a candidate account with a confirmed email, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The recipient comes from the session. The request has no body.
The command is idempotent by its effect: the first mark stores the read time and every repeat returns that first time, so it needs no Idempotency-Key. It never reads the source and returns no content, so marking an item whose content is no longer available still works. It changes no other item.
The general rate limit can answer 429 with Retry-After before any check.
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a missing or wrong CSRF token or a disallowed Origin answers 403 csrf_check_failed; an employer account answers 403 forbidden; an item of another account and an unknown identifier both answer 404 not_found, so identifiers cannot be enumerated. A `notification_id` that is not a UUID answers 400 validation_failed with the path pointer.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- notification
parameters:
- $ref: ../components/parameters.yml#/NotificationId
responses:
"200":
description: The read state of the item, newly set or repeated.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/NotificationReadReceipt
examples:
read:
$ref: ../components/examples.yml#/NotificationReadReceipt
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"404":
$ref: ../components/responses.yml#/NotFound
"429":
$ref: ../components/responses.yml#/TooManyRequests
default:
$ref: ../components/responses.yml#/Problem