Change the caller's own email notification preferences in the organization
const url = 'https://example.com/v1/orgs/example/me/notifications';const options = { method: 'PUT', headers: { cookie: 'affectra_session=<affectra_session>', 'Content-Type': 'application/json' }, body: '{"findings":"none","proposals_digest":true,"hint_dismissed":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/orgs/example/me/notifications \ --header 'Content-Type: application/json' \ --cookie affectra_session=<affectra_session> \ --data '{ "findings": "none", "proposals_digest": true, "hint_dismissed": true }'Any member, for themselves only: the request names no user. A new findings value or proposals digest choice makes the unsubscribe links of earlier mails stop working. Turning the proposals digest on needs the member role or above.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization (tenant) slug, e.g. alpenrobotik
Request Bodyrequired
Section titled “Request Bodyrequired”object
Members and above may turn it on (a viewer gets 403 auth.roleTooLow); anyone may turn it off
Hides the hint for good; changes no preference
Responses
Section titled “Responses”The preferences now
object
Finding emails for this organization: none (the default for every role: email is opt-in), known_exploited (a finding is known exploited: in CISA KEV or on ENISA’s list), or all (also new and resolved findings and a release’s first check).
A daily mail of the pending agent proposals this person may decide, at the organization’s send time (proposals_digest_hour and proposals_digest_time_zone in its settings), sent only when one was filed since the last. Off by default.
Show the hint that known-exploited email exists: true for owners and admins who haven’t turned it on and haven’t dismissed the hint. It turns nothing on.
Where the mails go (the account’s address)
Present when Amazon SES won’t deliver to this address (it bounced, or the person marked a mail as spam); no mail goes there, in any organization.
object
Example
{ "findings": "none", "suppressed": { "reason": "bounce" }}Notifications.findingsInvalid, request.invalid, or request.invalidJson
Auth.sessionRequired, auth.roleTooLow (a viewer turning the proposals digest on), or auth.csrfMissing (no X-Affectra-CSRF header)
Over the operation’s rate-limit budget (x-affectra-budget): code request.rateLimited with params.budget. Wait Retry-After seconds before trying again.
Every error answer, Content-Type
application/problem+json. The web app and integrations translate code; detail is English,
for people reading curl output or CI logs, and may change wording at
any time. Match on code, never on detail.
object
The HTTP status
Stable error codes. A code is never renamed; new ones may be added, so
a client falls back to detail for a code it doesn’t know. Another
organization’s object answers notFound, the same as a missing one.
What went wrong
Values the code’s message needs, e.g. {“field”: “version”}. Only values the caller sent or may see. Empty when the message needs none.
object
Example
{ "code": "notFound"}Headers
Section titled “Headers”Seconds until a request would be allowed again, at least 1
Notifications.unavailable (no database)