Google Cloud Storage Folders API

The Folders API from Google Cloud Storage — 4 operation(s) for folders.

GitHub OpenAPI

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

DELETE /storage/v1/b/{bucket}/folders/{folder} Delete a folder · Delete folders #
Ask an LLM
“How do I permanently delete a folder from a hierarchical namespace bucket?”
“Can I delete a folder only if its metageneration matches a value?”
Tell an agent destructive · confirm first
Delete folder {folder} from bucket {bucket}.
Remove folder {folder} in {bucket} if its metageneration is {ifMetagenerationMatch}.
GET /storage/v1/b/{bucket}/folders/{folder} Get a hierarchical folder · Get folders #
Ask an LLM
“How do I read the metadata of a folder in a hierarchical namespace bucket?”
“Can I fetch a folder only if its metageneration matches a value?”
Tell an agent
Get folder {folder} in bucket {bucket}.
Fetch folder {folder} in {bucket} if its metageneration is {ifMetagenerationMatch}.
POST /storage/v1/b/{bucket}/folders/{folder}/deleteRecursive Delete a folder recursively · Delete recursive folders #
Ask an LLM
“How do I delete a folder and all its contents recursively?”
“Does recursive folder deletion work on buckets without hierarchical namespace?”
Tell an agent destructive · confirm first
Delete folder {folder} from bucket {bucket} recursively.
Recursively purge everything in folder {folder} of {bucket}.
POST /storage/v1/b/{bucket}/folders Create a folder · Insert folders #
Ask an LLM
“How do I create a folder in a hierarchical namespace bucket?”
“Can I create a folder recursively so missing parent folders are made too?”
Tell an agent
Create folder {name} in bucket {bucket}.
Create folder {name} in {bucket} recursively: {recursive}.
GET /storage/v1/b/{bucket}/folders List folders in a hierarchical namespace bucket · List folders #
Ask an LLM
“Which folders exist in my hierarchical namespace bucket?”
“Can I list only the folders under a given prefix?”
Tell an agent
List folders in bucket {bucket}.
List folders in {bucket} under prefix {prefix}.
POST /storage/v1/b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder} Rename a folder · Rename folders #
Ask an LLM
“How do I rename a folder in a hierarchical namespace bucket?”
“Can I rename a folder only if its metageneration matches a value?”
Tell an agent
Rename folder {sourceFolder} in bucket {bucket} to {destinationFolder}.
Rename {sourceFolder} to {destinationFolder} in {bucket} if its metageneration is {ifSourceMetagenerationMatch}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gcp-cloud-storage:gcp-cloud-storage-folders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gcp-cloud-storage-folders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloud Storage JSON Folders API
  version: v1
  description: Generated from Google's published Discovery document for Cloud Storage JSON API (storage v1, revision 20261107). 6 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://storage.googleapis.com
tags:
- name: Folders
paths:
  /storage/v1/b/{bucket}/folders/{folder}:
    delete:
      operationId: storage.folders.delete
      summary: Delete folders
      description: Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which the folder resides.
        schema:
          type: string
      - name: folder
        in: path
        required: true
        description: Name of a folder.
        schema:
          type: string
      - name: ifMetagenerationMatch
        in: query
        required: false
        description: If set, only deletes the folder if its metageneration matches this value.
        schema:
          type: string
          format: int64
      - name: ifMetagenerationNotMatch
        in: query
        required: false
        description: If set, only deletes the folder if its metageneration does not match this value.
        schema:
          type: string
          format: int64
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
    get:
      operationId: storage.folders.get
      summary: Get folders
      description: Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which the folder resides.
        schema:
          type: string
      - name: folder
        in: path
        required: true
        description: Name of a folder.
        schema:
          type: string
      - name: ifMetagenerationMatch
        in: query
        required: false
        description: Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value.
        schema:
          type: string
          format: int64
      - name: ifMetagenerationNotMatch
        in: query
        required: false
        description: Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value.
        schema:
          type: string
          format: int64
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/cloud-platform.read-only
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_only
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
  /storage/v1/b/{bucket}/folders/{folder}/deleteRecursive:
    post:
      operationId: storage.folders.deleteRecursive
      summary: Delete recursive folders
      description: Deletes a folder recursively. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which the folder resides.
        schema:
          type: string
      - name: folder
        in: path
        required: true
        description: Name of a folder.
        schema:
          type: string
      - name: ifMetagenerationMatch
        in: query
        required: false
        description: If set, only deletes the folder if its metageneration matches this value.
        schema:
          type: string
          format: int64
      - name: ifMetagenerationNotMatch
        in: query
        required: false
        description: If set, only deletes the folder if its metageneration does not match this value.
        schema:
          type: string
          format: int64
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleLongrunningOperation'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
  /storage/v1/b/{bucket}/folders:
    post:
      operationId: storage.folders.insert
      summary: Insert folders
      description: Creates a new folder. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which the folder resides.
        schema:
          type: string
      - name: recursive
        in: query
        required: false
        description: If true, any parent folder which doesn't exist will be created automatically.
        schema:
          type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Folder'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
    get:
      operationId: storage.folders.list
      summary: List folders
      description: Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which to look for folders.
        schema:
          type: string
      - name: delimiter
        in: query
        required: false
        description: Returns results in a directory-like mode. The only supported value is '/'. If set, items will only contain folders that either exactly match the prefix, or are one level below the prefix.
        schema:
          type: string
      - name: endOffset
        in: query
        required: false
        description: Filter results to folders whose names are lexicographically before endOffset. If startOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).
        schema:
          type: string
      - name: pageSize
        in: query
        required: false
        description: Maximum number of items to return in a single page of responses.
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: pageToken
        in: query
        required: false
        description: A previously-returned page token representing part of the larger set of results to view.
        schema:
          type: string
      - name: prefix
        in: query
        required: false
        description: Filter results to folders whose paths begin with this prefix. If set, the value must either be an empty string or end with a '/'.
        schema:
          type: string
      - name: startOffset
        in: query
        required: false
        description: Filter results to folders whose names are lexicographically equal to or after startOffset. If endOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folders'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/cloud-platform.read-only
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_only
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
  /storage/v1/b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}:
    post:
      operationId: storage.folders.rename
      summary: Rename folders
      description: Renames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled.
      parameters:
      - name: bucket
        in: path
        required: true
        description: Name of the bucket in which the folders are in.
        schema:
          type: string
      - name: sourceFolder
        in: path
        required: true
        description: Name of the source folder.
        schema:
          type: string
      - name: destinationFolder
        in: path
        required: true
        description: Name of the destination folder.
        schema:
          type: string
      - name: ifSourceMetagenerationMatch
        in: query
        required: false
        description: Makes the operation conditional on whether the source object's current metageneration matches the given value.
        schema:
          type: string
          format: int64
      - name: ifSourceMetagenerationNotMatch
        in: query
        required: false
        description: Makes the operation conditional on whether the source object's current metageneration does not match the given value.
        schema:
          type: string
          format: int64
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleLongrunningOperation'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/devstorage.full_control
        - https://www.googleapis.com/auth/devstorage.read_write
      - apiKey: []
      tags:
      - Folders
components:
  schemas:
    Folder:
      type: object
      description: A folder. Only available in buckets with hierarchical namespace enabled.
      properties:
        bucket:
          type: string
          description: The name of the bucket containing this folder.
        id:
          type: string
          description: The ID of the folder, including the bucket name, folder name.
        kind:
          type: string
          description: The kind of item this is. For folders, this is always storage#folder.
          default: storage#folder
        metageneration:
          type: string
          description: The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.
          format: int64
        name:
          type: string
          description: The name of the folder. Required if not specified by URL parameter.
        selfLink:
          type: string
          description: The link to this folder.
        createTime:
          type: string
          description: The creation time of the folder in RFC 3339 format.
          format: date-time
        updateTime:
          type: string
          description: The modification time of the folder metadata in RFC 3339 format.
          format: date-time
        pendingRenameInfo:
          type: object
          description: Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.
          properties:
            operationId:
              type: string
              description: The ID of the rename folder operation.
    GoogleLongrunningOperation:
      description: This resource represents a long-running operation that is the result of a network API call.
      properties:
        done:
          description: If the value is "false", it means the operation is still in progress. If "true", the operation is completed, and either "error" or "response" is available.
          type: boolean
        error:
          $ref: '#/components/schemas/GoogleRpcStatus'
          description: The error result of the operation in case of failure or cancellation.
        metadata:
          additionalProperties:
            description: Properties of the object. Contains field @type with type URL.
          description: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
          type: object
        name:
          description: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the "name" should be a resource name ending with "operations/{operationId}".
          type: string
        response:
          additionalProperties:
            description: Properties of the object. Contains field @type with type URL.
          description: The normal response of the operation in case of success. If the original method returns no data on success, such as "Delete", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type "XxxResponse", where "Xxx" is the original method name. For example, if the original method name is "TakeSnapshot()", the inferred response type is "TakeSnapshotResponse".
          type: object
        selfLink:
          type: string
          description: The link to this long running operation.
        kind:
          type: string
          description: The kind of item this is. For operations, this is always storage#operation.
          default: storage#operation
      type: object
    Folders:
      type: object
      description: A list of folders.
      properties:
        items:
          type: array
          description: The list of items.
          items:
            $ref: '#/components/schemas/Folder'
        kind:
          type: string
          description: The kind of item this is. For lists of folders, this is always storage#folders.
          default: storage#folders
        nextPageToken:
          type: string
          description: The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
    GoogleRpcStatus:
      description: 'The "Status" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each "Status" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
      properties:
        code:
          description: The status code, which should be an enum value of google.rpc.Code.
          format: int32
          type: integer
        details:
          description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
          items:
            additionalProperties:
              description: Properties of the object. Contains field @type with type URL.
            type: object
          type: array
        message:
          description: A developer-facing error message, which should be in English.
          type: string
      type: object
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloud-platform: View and manage your data across Google Cloud Platform services
            https://www.googleapis.com/auth/cloud-platform.read-only: View your data across Google Cloud Platform services
            https://www.googleapis.com/auth/devstorage.full_control: Manage your data and permissions in Google Cloud Storage
            https://www.googleapis.com/auth/devstorage.read_only: View your data in Google Cloud Storage
            https://www.googleapis.com/auth/devstorage.read_write: Manage your data in Google Cloud Storage
externalDocs:
  url: https://developers.google.com/storage/docs/json_api/
x-provenance:
  method: harvested
  publisher: Google
  source: https://storage.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261107)