Skip to content
Start here

List Event Notification Rules

GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration

List all event notification rules for a bucket.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Workers R2 Storage WriteWorkers R2 Storage Read
Path ParametersExpand Collapse
account_id: string

Account ID.

maxLength32
bucket_name: string

Name of the bucket.

maxLength64
minLength3
Header ParametersExpand Collapse
"cf-r2-jurisdiction": optional "default" or "eu" or "fedramp"

Jurisdiction where objects in this bucket are guaranteed to be stored.

One of the following:
"default"
"eu"
"fedramp"
ReturnsExpand Collapse
errors: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: array of string
result: { bucketName, queues }
bucketName: optional string

Name of the bucket.

queues: optional array of { queueId, queueName, rules }

List of queues associated with the bucket.

queueId: optional string

Queue ID.

queueName: optional string

Name of the queue.

rules: optional array of { actions, createdAt, description, 3 more }
actions: array of "PutObject" or "CopyObject" or "DeleteObject" or 2 more

Array of R2 object actions that will trigger notifications.

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

Timestamp when the rule was created.

description: optional string

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

prefix: optional string

Notifications will be sent only for objects with this prefix.

ruleId: optional string

Rule ID.

suffix: optional string

Notifications will be sent only for objects with this suffix.

success: true

Whether the API call was successful.

List Event Notification Rules

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/event_notifications/r2/$BUCKET_NAME/configuration \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "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": [],
  "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": [],
  "result": null,
  "success": false
}