delete_notifications

UsersApi.delete_notifications(delete_notifications_request, role_id=None, resource_type=None, resource_id=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Delete notification preferences

Removes custom-email rows for a resource, or deletes one custom alert email when resource_type is custom-alert-emails (requires system-settings.fullaccess).

Parameters:
  • delete_notifications_request (DeleteNotificationsRequest) – (required)

  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Required for custom-alert-emails. Also recorded in audit logs.

  • resource_type (str) – Resource kind. Defaults to Datasets. Same values as GET, plus custom-alert-emails to delete one SES identity and its notification rows.

  • resource_id (str) – Resource to detach emails from. Ignored for custom-alert-emails.

  • _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:

DeleteNotificationsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: DELETE /notifications

Request

Detach emails from a resource

{
  "EmailAddress": [
    "alerts@example.com"
  ]
}

Delete one custom alert email

{
  "EmailAddress": [
    "alerts@example.com"
  ]
}

Success (HTTP 200)

Rows were deleted. custom-alert-emails also removes the SES identity when it is not a registered user email.

Detached emails from a resource

{
  "Message": "Successfully deleted notification preferences for the provided email addresses"
}

Deleted one custom alert email

{
  "Message": "Successfully deleted provided EmailId."
}

Errors

Documented error codes: GE-1021, IPV-1008, GE-1034, AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002, GE-1008.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1021 (invalid email on the default path), IPV-1008 (custom-alert-emails must send exactly one EmailAddress), GE-1034 (blank, invalid, missing SES, or reserved identity), AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002 (role_id) for custom-alert-emails.

Email is not valid

{
  "Message": "GE-1021 - Unable to delete items in Notifications table, please check for errors"
}

custom-alert-emails needs exactly one address

{
  "Message": "IPV-1008 - Invalid request body, missing key(s) - EmailAddress"
}

Caller lacks system-settings.fullaccess

{
  "Message": "AUTH-1030 - User is not authorized to delete custom emails and remove subscriptions due to the following missing permission(s) - {'System Settings': ['fullaccess']}"
}

HTTP 500

Uncaught errors return {“Message”: “<str(ex)>”} with no GE-1008 wrap.

Uncaught handler failure

{
  "Message": "Expecting value: line 1 column 1 (char 0)"
}