unsubscribe_alert_preferences

UsersApi.unsubscribe_alert_preferences(role_id=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Unsubscribe from email alerts

Unsubscribes the calling user from email alerts. No request body. Service users return GE-1014. Success Message is “Successfully Unsubscribed from email alerts. You will not receive any system alerts to your email anymore.” Repeat DELETE still succeeds.

Parameters:
  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Also recorded in audit logs.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

UnsubscribeAlertPreferencesResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: DELETE /alertpreferences

Success (HTTP 200)

User unsubscribed (UnsubscribeAlertPreferencesResponse).

Unsubscribed

{
  "Message": "Successfully Unsubscribed from email alerts. You will not receive any system alerts to your email anymore."
}

Errors

Documented error codes: GE-1014, GE-1020, GE-1008, EMF-1001.

HTTP 400

Validation failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: GE-1014 (service user), GE-1020 (USER table update failed).

Service user not supported

{
  "Message": "GE-1014 - Email subscription is not supported for service users"
}

Failed to clear subscription

{
  "Message": "GE-1020 - Unable to update USER table, please retry or contact administrator"
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”} (typically GE-1008 via EMF-1001).

Unexpected failure

{
  "Message": "GE-1008 - Could not complete the request. Please try again"
}