Alerts

Send an alert to the specified user

Changed on

Send an alert to the specified user. Only available to super user keys.

post/alerts/

Request

  • Base URL
    https://example.com/api
  • Auth
    • OAuth 2
      Authorization codehttps://example.com/oauth2/authorize
      Token URLhttps://example.com/api/oauth2/token
      Scopesalert:write
    • or API key in header XF-Api-Key
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Request body application/x-www-form-urlencoded

to_user_idinteger required

ID of the user to receive the alert

alertstring required

Text of the alert. May use the placeholder "{link}" to have the link automatically inserted.

from_user_idinteger

If provided, the user to send the alert from. Otherwise, uses the current API user. May be 0 for an anonymous alert.

link_urlstring

URL user will be taken to when the alert is clicked.

link_titlestring

Text of the link URL that will be displayed. If no placeholder is present in the alert, will be automatically appended.

Response

OK

successboolean

Changes

    • breaking

      request body became required

    • breaking

      removed the media type application/json from the request body

    • breaking

      the response's property type changed from string to boolean for status

    • info

      api operation id post_alerts_ removed and replaced with postAlerts

    • info

      the endpoint scheme security XF-Api-Key was added to the API

    • info

      the endpoint scheme security XF-OAuth2 was added to the API

    • info

      added the new optional header request parameter XF-Api-User to all path's operations

    • info

      added the new optional query request parameter api_bypass_permissions to all path's operations

    • breaking

      the response's property type changed from boolean to string for status

    • warning

      the optional response header XF-Latest-Api-Version removed for the status 200

    • warning

      the optional response header XF-Request-User removed for the status 200

    • warning

      the optional response header XF-Request-User-Extras removed for the status 200

    • warning

      the optional response header XF-Used-Api-Version removed for the status 200

    • info

      api operation id postAlerts removed and replaced with post_alerts_

    • info

      the endpoint scheme security XF-Api-Key was removed from the API

    • info

      the endpoint scheme security XF-OAuth2 was removed from the API

    • info

      request body became optional

    • info

      added the media type application/json to the request body