Skip to main content

unsubscribe

Creates, updates, deletes, gets or lists an unsubscribe resource.

Overview

Nameunsubscribe
TypeResource
Idcloudflare.alerting.unsubscribe

Fields

The following fields are returned by SELECT queries:

Show email unsubscribe details response

NameDatatypeDescription
idstringThe unique identifier of a notification policy (example: 0da2b59ef118439d8097bdfb215203c9)
namestringName of the policy. (example: SSL Notification Event Policy)
account_idstringThe account id (example: 023e105f4ecef8ad9ca31a8372d0c353)
emailstring (email)
tokenstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, policy_idemail, tokenShows details for unsubscribing an email address from a notification policy.
notification_policies_unsubscribe_email_from_notification_policyinsertaccount_id, policy_idemail, tokenUnsubscribes an email address from a notification policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
policy_idstringThe Access policy ID.
emailstring (email)
tokenstring

SELECT examples

Shows details for unsubscribing an email address from a notification policy.

SELECT
id,
name,
account_id,
email,
token
FROM cloudflare.alerting.unsubscribe
WHERE account_id = '{{ account_id }}' -- required
AND policy_id = '{{ policy_id }}' -- required
AND email = '{{ email }}'
AND token = '{{ token }}'
;

INSERT examples

Unsubscribes an email address from a notification policy.

INSERT INTO cloudflare.alerting.unsubscribe (
account_id,
policy_id,
email,
token
)
SELECT
'{{ account_id }}',
'{{ policy_id }}',
'{{ email }}',
'{{ token }}'
RETURNING
errors,
messages,
result,
success
;