---
title: "POST /v2/DenyBucketKey"
method: POST
path: "/v2/DenyBucketKey"
tags: ["Permission"]
---

# POST /v2/DenyBucketKey

`POST /v2/DenyBucketKey`

⚠️ **DISCLAIMER**: Garage's developers are aware that this endpoint has an unconventional semantic. Be extra careful when implementing it, its behavior is not obvious.

Denies a key from doing read/write/owner operations on a bucket.

Flags in permissions which have the value true will be deactivated. Other flags will remain unchanged.

For example, if you set read to true, the key will be denied from reading.
If you set read to false,  the key will keep its previous permissions.
If you want the key to have the reading permission, check the AllowBucketKey operation.

## Request body

- DenyBucketKeyRequest
  - `accessKeyId` string, required
  - `bucketId` string, required
  - `permissions` ApiBucketKeyPerm, required
    - `owner` boolean
    - `read` boolean
    - `write` boolean

## Response `200`

Returns exhaustive information about the bucket

- DenyBucketKeyResponse
  - `bytes` integer, required — Total number of bytes used by objects in this bucket
  - `corsRules` CorsRule[], nullable — CORS rules for this bucket
    - `AllowedHeader` unknown[]
      - unknown
    - `AllowedMethod` unknown[], required
      - unknown
    - `AllowedOrigin` unknown[], required
      - unknown
    - `ExposeHeader` unknown[]
      - unknown
    - `ID` unknown
    - `MaxAgeSeconds` integer
  - `created` string, date-time, required — Bucket creation date
  - `globalAliases` string[], required — List of global aliases for this bucket
  - `id` string, required — Identifier of the bucket
  - `keys` GetBucketInfoKey[], required — List of access keys that have permissions granted on this bucket
    - `accessKeyId` string, required
    - `bucketLocalAliases` string[], required
    - `name` string, required
    - `permissions` ApiBucketKeyPerm, required
      - `owner` boolean
      - `read` boolean
      - `write` boolean
  - `lifecycleRules` LifecycleRule[], nullable — Object lifecycle rules for this bucket
    - `AbortIncompleteMultipartUpload` LifecycleAbortIncompleteMpu
      - `DaysAfterInitiation` integer, required
    - `Expiration` LifecycleExpiration
      - `Date` unknown
      - `Days` integer
    - `Filter` LifecycleFilter
      - `And` LifecycleFilter — recursive
      - `ObjectSizeGreaterThan` integer
      - `ObjectSizeLessThan` integer
      - `Prefix` unknown
    - `ID` unknown
    - `Status` unknown, required
  - `objects` integer, required — Number of objects in this bucket
  - `quotas` ApiBucketQuotas, required
    - `maxObjects` integer, nullable
    - `maxSize` integer, nullable
  - `unfinishedMultipartUploadBytes` integer, required — Total number of bytes used by unfinished multipart uploads in this bucket
  - `unfinishedMultipartUploadParts` integer, required — Number of parts in unfinished multipart uploads in this bucket
  - `unfinishedMultipartUploads` integer, required — Number of unfinished multipart uploads in this bucket
  - `unfinishedUploads` integer, required — Number of unfinished uploads in this bucket
  - `websiteAccess` boolean, required — Whether website access is enabled for this bucket
  - `websiteConfig` GetBucketInfoWebsiteResponse
    - `errorDocument` string, nullable
    - `indexDocument` string, required
    - `routingRules` WebsiteRoutingRule[], nullable
      - `Condition` WebsiteCondition
        - `HttpErrorCodeReturnedEquals` integer
        - `KeyPrefixEquals` unknown
      - `Redirect` WebsiteRedirect, required
        - `HostName` unknown
        - `HttpRedirectCode` integer
        - `Protocol` unknown
        - `ReplaceKeyPrefixWith` unknown
        - `ReplaceKeyWith` unknown

## Other responses

- `500` — Internal server error

---

[API](https://skmtc.dev/deuxfleurs/apis/garage-administration-api.md) · [All operations](https://skmtc.dev/deuxfleurs/apis/garage-administration-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/deuxfleurs/garage-administration-api/revisions/07ffb2d0febb/schema)
