prufy
Skip to the page

AlertsSet the alert email

Alerts

Set the alert email

Choose the address alerts go to. We send a confirmation link first.

PUT/api/v1/notifications/email

Nothing is sent to the address until its owner presses the button in the confirmation email. That link works for 24 hours. Until then the response shows the address with verified: false.

Setting a new address replaces the old one.

Authentication

Send the session cookie. Without it the answer is unauthorized. How sessions work.

Body

JSON, with content-type: application/json.

  • emailemailrequired

    The address alerts should go to.

    • At most 254 characters

Response

200 OK, with every field below present. Times are ISO 8601 strings in UTC.

  • emailobject | null

    The alert address. Null when none is set.

    Show the 2 fields insideInside email
    • addressstring

      Where alert emails go.

    • verifiedboolean

      False until the confirmation link has been used.

  • pushDevicesinteger

    How many browsers are subscribed to push.

  • capabilitiesobject

    Which channels this server can use.

    Show the 2 fields insideInside capabilities
    • emailboolean

      Whether this server can send email at all.

    • pushPublicKeystring | null

      The key a browser subscribes with. Null when push is off.

Errors

StatusKindWhen
400bad_requestThe body isn't JSON, or doesn't match the shape below. message names the first field to fix, and fields lists each one with its path.
401unauthorizedThe request has no session cookie, or one we don't recognise.
413payload_too_largeThe body is over 16 KB. No route takes anything near that.
429rate_limitedThe account has changed its address 5 times in the last hour.
503email_unavailableThis server has no email set up, or the confirmation couldn't be sent to that address.

Any route can also answer 500 with internal_error. Every error has the same shape, described in Errors.