List Event Notification Rules
client.r2.buckets.eventNotifications.list(stringbucketName, EventNotificationListParams { account_id, cfR2Jurisdiction } params, RequestOptionsoptions?): EventNotificationListResponse { bucketName, queues }
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration
Lists event notification rules for an R2 bucket, grouped by the Cloudflare Queue that receives matching object events.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
List Event Notification Rules
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const eventNotifications = await client.r2.buckets.eventNotifications.list('example-bucket', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
console.log(eventNotifications.bucketName);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"bucketName": "bucketName",
"queues": [
{
"queueId": "11111aa1-11aa-111a-a1a1-a1a111a11a11",
"queueName": "first-queue",
"rules": [
{
"actions": [
"PutObject",
"CopyObject"
],
"createdAt": "2024-09-19T21:54:48.405Z",
"description": "Notifications from source bucket to queue",
"prefix": "img/",
"ruleId": "11111aa1-11aa-111a-a1a1-a1a111a11a11",
"suffix": ".jpeg"
}
]
}
]
},
"success": true
}{
"errors": [
{
"code": 11015,
"message": "workers.api.error.no_configs_found_for_bucket"
}
],
"messages": [
"Request failed."
],
"result": null,
"success": false
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"bucketName": "bucketName",
"queues": [
{
"queueId": "11111aa1-11aa-111a-a1a1-a1a111a11a11",
"queueName": "first-queue",
"rules": [
{
"actions": [
"PutObject",
"CopyObject"
],
"createdAt": "2024-09-19T21:54:48.405Z",
"description": "Notifications from source bucket to queue",
"prefix": "img/",
"ruleId": "11111aa1-11aa-111a-a1a1-a1a111a11a11",
"suffix": ".jpeg"
}
]
}
]
},
"success": true
}{
"errors": [
{
"code": 11015,
"message": "workers.api.error.no_configs_found_for_bucket"
}
],
"messages": [
"Request failed."
],
"result": null,
"success": false
}