---
title: "Stop Bucket Sharing"
method: DELETE
path: "/v2/storage/branch/{branchId}/buckets/{bucketId}/share"
tags: ["Buckets"]
---

# Stop Bucket Sharing

`DELETE /v2/storage/branch/{branchId}/buckets/{bucketId}/share`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/branch/{branchId}/buckets/{bucketId}/share`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/branch/:branchId/buckets/:bucketId/share/delete.ts> (a function with typed inputs; its response is checked against the schema)

Disables sharing of a bucket.

While other projects link the bucket, Storage refuses the request with `409 Conflict` and changes nothing: every link stays and the consumer projects observe no interruption. The refusal lists the blocking projects in its `linkedProjects` param.

Removing those links is a separate act, never a side effect of unsharing - use Drop Bucket in the linking project, or Force Unlink from this one. Reading the bucket stops working in a consumer project the moment its link is gone.

This operation is available only for organization administrators. Sharing is removed in a background job; to see the job detail use the Job Detail endpoint.

## Path parameters

- `bucketId` string, required
- `branchId` string, required

## Response `202`

Share removal job enqueued; returns job details.

- BucketShareDeleteResponse
  - `id` integer, required: Job ID.
  - `status` string, required: Job status.
  - `url` string, required: URL to retrieve job details.
  - `tableId` string, nullable, required: Table identifier if applicable.
  - `operationName` string, required: Name of the operation.
  - `operationParams` object, required: Parameters passed to the operation.
  - `createdTime` string, date-time, required: Job creation timestamp.
  - `startTime` string, date-time, nullable, required: Job start timestamp.
  - `endTime` string, date-time, nullable, required: Job completion timestamp.
  - `runId` string, nullable, required: Unique run identifier.
  - `results` object, nullable, required: Operation results; content varies.
  - `creatorToken` object, required: Creator token information.
    - `id` integer, required: ID of the token that created this job.
    - `description` string, nullable, required: Description of the creator token.
  - `metrics` object, required: Job execution metrics.
  - `error` object: Job error information. Present only when the job failed.
    - `code` string, required: Error code if job failed.
    - `message` string, required: Error message if job failed.
    - `exceptionId` string, required: Exception identifier.

## Other responses

- `400`: The bucket is not shared (`storage.buckets.notShared`).
- `403`: The token cannot manage the bucket or is not an organization administrator (`accessDenied`).
- `404`: The bucket was not found (`storage.buckets.notFound`).
- `409`: Other projects still link the bucket (`storage.buckets.alreadyLinked`). Nothing changed: every link is intact and the consumer projects observe no interruption. `linkedProjects` names the projects that block the request; unlink them first, which stops their reads and cannot be undone from this project.
- `503`: The bucket (`storage.buckets.maintenance`) or its backend (`storage.backend.maintenance`) is under maintenance.

---

[API](https://skmtc.dev/keboola/apis/keboola-storage-api.md) - [All operations](https://skmtc.dev/keboola/apis/keboola-storage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keboola/apis/keboola-storage-api/revisions/34b5ceac0317?raw)
