List Buckets

Lists all R2 buckets on your account

/accounts/{account_identifier}/r2/buckets

get

R2 Bucket

r2-list-buckets

Debug "planAvailability"

null

Debug "tokenPermissions"

{
  "enum": [
    "com.cloudflare.edge.r2.bucket.list"
  ]
}

Debug "parameters"

[
  {
    "in": "path",
    "name": "account_identifier",
    "required": true,
    "schema": {
      "description": "Account ID",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "name_contains",
    "schema": {
      "description": "Bucket names to filter by. Only buckets with this phrase in their name will be returned.",
      "example": "my-bucket",
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "start_after",
    "schema": {
      "description": "Bucket name to start searching after. Buckets are ordered lexicographically.",
      "example": "my-bucket",
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "per_page",
    "schema": {
      "default": 20,
      "description": "Maximum number of buckets to return in a single call",
      "maximum": 1000,
      "minimum": 1,
      "type": "number"
    }
  },
  {
    "in": "query",
    "name": "order",
    "schema": {
      "description": "Field to order buckets by",
      "enum": [
        "name"
      ],
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "direction",
    "schema": {
      "description": "Direction to order buckets",
      "enum": [
        "asc",
        "desc"
      ],
      "example": "desc",
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "cursor",
    "schema": {
      "description": "Pagination cursor received during the last List Buckets call. R2 buckets are paginated using cursors instead of page numbers.",
      "type": "string"
    }
  }
]

Debug "requestBody"

null

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "result": {
                      "type": "object"
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result_info": {
                      "properties": {
                        "cursor": {
                          "description": "A continuation token that should be used to fetch the next page of results",
                          "example": "1-JTdCJTIydiUyMiUzQTElMkMlMjJzdGFydEFmdGVyJTIyJTNBJTIyZGF2aWRwdWJsaWMlMjIlN0Q=",
                          "type": "string"
                        },
                        "per_page": {
                          "description": "Maximum number of results on this page",
                          "example": 20,
                          "type": "number"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            {
              "properties": {
                "result": {
                  "items": {
                    "description": "A single R2 bucket",
                    "properties": {
                      "creation_date": {
                        "description": "Creation timestamp",
                        "type": "string"
                      },
                      "location": {
                        "description": "Location of the bucket",
                        "enum": [
                          "apac",
                          "eeur",
                          "enam",
                          "weur",
                          "wnam"
                        ],
                        "type": "string"
                      },
                      "name": {
                        "description": "Name of the bucket",
                        "example": "example-bucket",
                        "maxLength": 64,
                        "minLength": 3,
                        "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "List Buckets response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "errors": {
              "items": {
                "properties": {
                  "code": {
                    "minimum": 1000,
                    "type": "integer"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ],
                "type": "object",
                "uniqueItems": true
              },
              "type": "array"
            },
            "messages": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "result": {
              "enum": [
                null
              ],
              "nullable": true,
              "type": "object"
            },
            "success": {
              "description": "Whether the API call was successful",
              "enum": [
                false
              ],
              "example": false,
              "type": "boolean"
            }
          },
          "required": [
            "success",
            "errors",
            "messages",
            "result"
          ],
          "type": "object"
        }
      }
    },
    "description": "List Buckets response failure"
  }
}

Debug "security"

[
  {
    "api_token": []
  }
]