Skip to content
Start here

Event Notifications

List Event Notification Rules
client.r2.buckets.eventNotifications.list(stringbucketName, EventNotificationListParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationListResponse { bucketName, queues }
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration
Get Event Notification Rule
client.r2.buckets.eventNotifications.get(stringbucketName, stringqueueId, EventNotificationGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationGetResponse { queueId, queueName, rules }
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Create Event Notification Rule
client.r2.buckets.eventNotifications.update(stringbucketName, stringqueueId, EventNotificationUpdateParams { account_id, rules, jurisdiction } params, RequestOptionsoptions?): EventNotificationUpdateResponse
PUT/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Delete Event Notification Rules
client.r2.buckets.eventNotifications.delete(stringbucketName, stringqueueId, EventNotificationDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationDeleteResponse
DELETE/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
ModelsExpand Collapse
EventNotificationListResponse { bucketName, queues }
bucketName?: string

Name of the bucket.

queues?: Array<Queue>

List of queues associated with the bucket.

queueId?: string

Queue ID.

queueName?: string

Name of the queue.

rules?: Array<Rule>
actions: Array<"PutObject" | "CopyObject" | "DeleteObject" | 2 more>

Array of R2 object actions that will trigger notifications.

One of the following:
"PutObject"
"CopyObject"
"DeleteObject"
"CompleteMultipartUpload"
"LifecycleDeletion"
createdAt?: string

Timestamp when the rule was created.

description?: string

A description that can be used to identify the event notification rule after creation.

prefix?: string

Notifications will be sent only for objects with this prefix.

ruleId?: string

Rule ID.

suffix?: string

Notifications will be sent only for objects with this suffix.

EventNotificationGetResponse { queueId, queueName, rules }
queueId?: string

Queue ID.

queueName?: string

Name of the queue.

rules?: Array<Rule>
actions: Array<"PutObject" | "CopyObject" | "DeleteObject" | 2 more>

Array of R2 object actions that will trigger notifications.

One of the following:
"PutObject"
"CopyObject"
"DeleteObject"
"CompleteMultipartUpload"
"LifecycleDeletion"
createdAt?: string

Timestamp when the rule was created.

description?: string

A description that can be used to identify the event notification rule after creation.

prefix?: string

Notifications will be sent only for objects with this prefix.

ruleId?: string

Rule ID.

suffix?: string

Notifications will be sent only for objects with this suffix.

EventNotificationUpdateResponse = unknown
EventNotificationDeleteResponse = unknown