> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/api-references/object-storage-api.md).

# Object Storage API

## GET /kos/v1/buckets

> Get all buckets

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketsResponse":{"properties":{"totalItems":{"description":"Total number of items","type":"integer"},"totalPages":{"description":"Total number of pages","type":"integer"},"currentPage":{"description":"Current page number","type":"integer"},"nextPage":{"description":"Next page number, if available","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/BucketResponse"},"type":"array"}},"type":"object"},"BucketResponse":{"properties":{"name":{"nullable":true,"type":"string"},"krnid":{"nullable":true,"type":"string"},"owner":{"type":"string"},"account_id":{"type":"string"},"createdAt":{"format":"date-time","nullable":true,"type":"string"},"usedCapacity":{"format":"double","nullable":true,"type":"number"},"allocatedCapacity":{"format":"int64","nullable":true,"type":"integer"},"region":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"},"status":{"nullable":true,"type":"string"},"path":{"nullable":true,"type":"string"},"protocol":{"nullable":true,"type":"string"},"tags":{"additionalProperties":true,"nullable":true,"type":"object"},"versioning":{"nullable":true,"type":"boolean"},"anonymous_access":{"nullable":true,"type":"boolean"},"tier":{"nullable":true,"type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets":{"get":{"parameters":[{"description":"Page number of the results to fetch","explode":true,"in":"query","name":"page","required":false,"schema":{"type":"integer"},"style":"form"},{"description":"Number of results per page","explode":true,"in":"query","name":"page_size","required":false,"schema":{"type":"integer"},"style":"form"},{"description":"search query","explode":true,"in":"query","name":"name_filter","required":false,"schema":{"type":"string"},"style":"form"},{"description":"refresh","explode":true,"in":"query","name":"refresh","required":false,"schema":{"default":false,"type":"boolean"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketsResponse"}}},"description":"Bucket successfully retrieved"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Get all buckets","tags":["Buckets"]}}}}
```

## POST /kos/v1/buckets

> Creates a new bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketCreationPayload":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"tags":{"additionalProperties":true,"type":"object"},"versioning":{"type":"boolean"},"anonymous_access":{"type":"boolean"}},"type":"object"},"BucketCreationResponse":{"properties":{"krn":{"type":"string"},"bucketName":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorConflict":{"description":"Conflict with existing resource","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnprocessableEntity":{"description":"Unprocessable entity","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets":{"post":{"operationId":"createBucket","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketCreationPayload"}}},"description":"Bucket creation payload","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketCreationResponse"}}},"description":"Bucket successfully created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorConflict"}}},"description":"Conflict, bucket already exists"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnprocessableEntity"}}},"description":"Unprocessable entity, validation error"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Creates a new bucket","tags":["Buckets"]}}}}
```

## GET /kos/v1/buckets/{bucketId}

> Retrieves bucket information

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketResponse":{"properties":{"name":{"nullable":true,"type":"string"},"krnid":{"nullable":true,"type":"string"},"owner":{"type":"string"},"account_id":{"type":"string"},"createdAt":{"format":"date-time","nullable":true,"type":"string"},"usedCapacity":{"format":"double","nullable":true,"type":"number"},"allocatedCapacity":{"format":"int64","nullable":true,"type":"integer"},"region":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"},"status":{"nullable":true,"type":"string"},"path":{"nullable":true,"type":"string"},"protocol":{"nullable":true,"type":"string"},"tags":{"additionalProperties":true,"nullable":true,"type":"object"},"versioning":{"nullable":true,"type":"boolean"},"anonymous_access":{"nullable":true,"type":"boolean"},"tier":{"nullable":true,"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}":{"get":{"operationId":"getBucket","parameters":[{"description":"ID of the bucket to retrieve","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketResponse"}}},"description":"Bucket information retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Retrieves bucket information","tags":["Buckets"]}}}}
```

## PUT /kos/v1/buckets/{bucketId}

> Updates bucket tags

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketUpdatePayload":{"properties":{"tags":{"additionalProperties":true,"type":"object"},"versioning":{"type":"boolean"},"anonymous_access":{"type":"boolean"}},"type":"object"},"BucketResponse":{"properties":{"name":{"nullable":true,"type":"string"},"krnid":{"nullable":true,"type":"string"},"owner":{"type":"string"},"account_id":{"type":"string"},"createdAt":{"format":"date-time","nullable":true,"type":"string"},"usedCapacity":{"format":"double","nullable":true,"type":"number"},"allocatedCapacity":{"format":"int64","nullable":true,"type":"integer"},"region":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"},"status":{"nullable":true,"type":"string"},"path":{"nullable":true,"type":"string"},"protocol":{"nullable":true,"type":"string"},"tags":{"additionalProperties":true,"nullable":true,"type":"object"},"versioning":{"nullable":true,"type":"boolean"},"anonymous_access":{"nullable":true,"type":"boolean"},"tier":{"nullable":true,"type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}":{"put":{"operationId":"updateBucket","parameters":[{"description":"ID of the bucket to update","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketUpdatePayload"}}},"description":"Bucket update payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketResponse"}}},"description":"Bucket tags successfully updated"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Updates bucket tags","tags":["Buckets"]}}}}
```

## DELETE /kos/v1/buckets/{bucketId}

> Deletes a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketDeletionPayload":{"properties":{"otp":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}":{"delete":{"operationId":"deleteBucket","parameters":[{"description":"ID of the bucket to delete","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketDeletionPayload"}}}},"responses":{"204":{"description":"Bucket successfully deleted, no content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Deletes a bucket","tags":["Buckets"]}}}}
```

## DELETE /internal/kos/v1/access\_keys\_all

> Deletes all access keys

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"Error":{"properties":{"message":{"description":"The failure message for the error.","type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/access_keys_all":{"delete":{"operationId":"deleteAllAccessKeys","responses":{"204":{"description":"Access keys successfully deleted, no content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access keys not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Deletes all access keys","tags":["Buckets"]}}}}
```

## GET /kos/v1/access\_keys

> Retrieves a list of access keys

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"getAccessKeys_200_response_inner":{"properties":{"access_key":{"type":"string"},"created_date":{"format":"date-time","type":"string"},"region":{"type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/access_keys":{"get":{"operationId":"getAccessKeys","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/getAccessKeys_200_response_inner"},"type":"array"}}},"description":"Access keys successfully retrieved"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access key not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Retrieves a list of access keys","tags":["Buckets"]}}}}
```

## POST /kos/v1/access\_keys

> Creates access keys

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"AccessKeysResponse":{"properties":{"access_key":{"type":"string"},"secret_key":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/access_keys":{"post":{"operationId":"createAccessKeys","responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessKeysResponse"}}},"description":"Access keys successfully created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Creates access keys","tags":["Buckets"]}}}}
```

## DELETE /kos/v1/access\_keys/{accessKey}

> Deletes an access key

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[{"description":"Operations related to buckets","name":"Buckets"}],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"DeleteAccessKeyPayload":{"properties":{"otp":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/access_keys/{accessKey}":{"delete":{"operationId":"deleteAccessKey","parameters":[{"description":"ID of the access key to delete","explode":false,"in":"path","name":"accessKey","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccessKeyPayload"}}},"required":true},"responses":{"204":{"description":"Access key successfully deleted, no content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access key not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Deletes an access key","tags":["Buckets"]}}}}
```

## GET /kos/v1/buckets/{bucketId}/lifecycle-rules

> Get all lifecycle rules for a specific bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"LifecycleRulesResponse":{"items":{"$ref":"#/components/schemas/LifecycleRuleResponse"},"type":"array"},"LifecycleRuleResponse":{"allOf":[{"$ref":"#/components/schemas/LifecycleRulePayload"},{"properties":{"id":{"description":"Unique ID of the lifecycle rule","type":"string"},"status":{"description":"Status of the lifecycle rule","type":"string"}},"type":"object"}]},"LifecycleRulePayload":{"properties":{"name":{"description":"Name of the lifecycle rule","type":"string"},"enabled":{"nullable":true,"type":"boolean"},"expiration_days":{"nullable":true,"type":"integer"},"expired_obj_delete_marker":{"nullable":true,"type":"boolean"},"noncurrent_days":{"nullable":true,"type":"integer"},"newer_noncurrent_versions":{"nullable":true,"type":"integer"},"delete_incomplete_mpu":{"nullable":true,"type":"integer"},"attribute":{"description":"Attribute used to calculate object age","nullable":true,"type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/lifecycle-rules":{"get":{"operationId":"getAllLifecycleRules","parameters":[{"description":"ID of the bucket to retrieve lifecycle rules for","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRulesResponse"}}},"description":"Lifecycle rules successfully retrieved"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service unavailable"}},"summary":"Get all lifecycle rules for a specific bucket","tags":["LifecycleRules"]}}}}
```

## POST /kos/v1/buckets/{bucketId}/lifecycle-rules

> Create a new lifecycle rule for a specific bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"LifecycleRulePayload":{"properties":{"name":{"description":"Name of the lifecycle rule","type":"string"},"enabled":{"nullable":true,"type":"boolean"},"expiration_days":{"nullable":true,"type":"integer"},"expired_obj_delete_marker":{"nullable":true,"type":"boolean"},"noncurrent_days":{"nullable":true,"type":"integer"},"newer_noncurrent_versions":{"nullable":true,"type":"integer"},"delete_incomplete_mpu":{"nullable":true,"type":"integer"},"attribute":{"description":"Attribute used to calculate object age","nullable":true,"type":"string"}},"type":"object"},"LifecycleRuleResponse":{"allOf":[{"$ref":"#/components/schemas/LifecycleRulePayload"},{"properties":{"id":{"description":"Unique ID of the lifecycle rule","type":"string"},"status":{"description":"Status of the lifecycle rule","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/lifecycle-rules":{"post":{"operationId":"createLifecycleRule","parameters":[{"description":"ID of the bucket to which the lifecycle rule will be added","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRulePayload"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRuleResponse"}}},"description":"Lifecycle rule successfully created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict with existing resource"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service unavailable"}},"summary":"Create a new lifecycle rule for a specific bucket","tags":["LifecycleRules"]}}}}
```

## GET /kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}

> Get a specific lifecycle rule for a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"LifecycleRuleResponse":{"allOf":[{"$ref":"#/components/schemas/LifecycleRulePayload"},{"properties":{"id":{"description":"Unique ID of the lifecycle rule","type":"string"},"status":{"description":"Status of the lifecycle rule","type":"string"}},"type":"object"}]},"LifecycleRulePayload":{"properties":{"name":{"description":"Name of the lifecycle rule","type":"string"},"enabled":{"nullable":true,"type":"boolean"},"expiration_days":{"nullable":true,"type":"integer"},"expired_obj_delete_marker":{"nullable":true,"type":"boolean"},"noncurrent_days":{"nullable":true,"type":"integer"},"newer_noncurrent_versions":{"nullable":true,"type":"integer"},"delete_incomplete_mpu":{"nullable":true,"type":"integer"},"attribute":{"description":"Attribute used to calculate object age","nullable":true,"type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}":{"get":{"operationId":"getLifecycleRule","parameters":[{"description":"ID of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"ID of the lifecycle rule to retrieve","explode":false,"in":"path","name":"ruleId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRuleResponse"}}},"description":"Lifecycle rule retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service unavailable"}},"summary":"Get a specific lifecycle rule for a bucket","tags":["LifecycleRules"]}}}}
```

## PUT /kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}

> Update a lifecycle rule for a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"LifecycleRulePayload":{"properties":{"name":{"description":"Name of the lifecycle rule","type":"string"},"enabled":{"nullable":true,"type":"boolean"},"expiration_days":{"nullable":true,"type":"integer"},"expired_obj_delete_marker":{"nullable":true,"type":"boolean"},"noncurrent_days":{"nullable":true,"type":"integer"},"newer_noncurrent_versions":{"nullable":true,"type":"integer"},"delete_incomplete_mpu":{"nullable":true,"type":"integer"},"attribute":{"description":"Attribute used to calculate object age","nullable":true,"type":"string"}},"type":"object"},"LifecycleRuleResponse":{"allOf":[{"$ref":"#/components/schemas/LifecycleRulePayload"},{"properties":{"id":{"description":"Unique ID of the lifecycle rule","type":"string"},"status":{"description":"Status of the lifecycle rule","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}":{"put":{"operationId":"updateLifecycleRule","parameters":[{"description":"ID of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"ID of the lifecycle rule to update","explode":false,"in":"path","name":"ruleId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRulePayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRuleResponse"}}},"description":"Lifecycle rule successfully updated"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service unavailable"}},"summary":"Update a lifecycle rule for a bucket","tags":["LifecycleRules"]}}}}
```

## DELETE /kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}

> Delete a lifecycle rule for a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/lifecycle-rules/{ruleId}":{"delete":{"operationId":"deleteLifecycleRule","parameters":[{"description":"ID of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"ID of the lifecycle rule to delete","explode":false,"in":"path","name":"ruleId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"204":{"description":"Lifecycle rule successfully deleted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service unavailable"}},"summary":"Delete a lifecycle rule for a bucket","tags":["LifecycleRules"]}}}}
```

## GET /internal/kos/v1/policy

> Retrieves a policy

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy":{"get":{"operationId":"getPolicy","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully retrieved"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Retrieves a policy","tags":["Policies"]}}}}
```

## POST /internal/kos/v1/policy

> Creates a policy

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyPayload":{"properties":{"_id":{"description":"Unique ID of the policy","type":"string"},"name":{"description":"Name of the policy","type":"string"},"statements":{"description":"Statements of the policy","items":{"type":"object"},"type":"array"},"conditions":{"description":"Conditions of the policy","items":{"type":"object"},"type":"array"},"accountId":{"description":"Account ID of the policy","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"}},"type":"object"},"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy":{"post":{"operationId":"createPolicy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPayload"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy already exists"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable entity, validation error"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Creates a policy","tags":["Policies"]}}}}
```

## POST /internal/kos/v1/policy/attach

> Attaches a policy to a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyAttachPayload":{"properties":{"policyKRNs":{"description":"Unique IDs of the policies","items":{"type":"string"},"type":"array"},"users":{"description":"KCIDs of the users","items":{"$ref":"#/components/schemas/UserDetails"},"type":"array"}},"type":"object"},"UserDetails":{"properties":{"kcid":{"description":"KCID of the user","type":"string"},"krn":{"description":"KRN of the user","type":"string"},"accountId":{"description":"Account ID of the user","type":"string"}},"type":"object"},"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy/attach":{"post":{"operationId":"attachPolicy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyAttachPayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully attached"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Attaches a policy to a bucket","tags":["Policies"]}}}}
```

## POST /internal/kos/v1/policy/detach

> Detaches a policy from a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyDetachPayload":{"properties":{"users":{"description":"KCIDs of the users","items":{"$ref":"#/components/schemas/UserDetails"},"type":"array"},"policyKRNs":{"description":"Unique IDs of the policies","items":{"type":"string"},"type":"array"}},"type":"object"},"UserDetails":{"properties":{"kcid":{"description":"KCID of the user","type":"string"},"krn":{"description":"KRN of the user","type":"string"},"accountId":{"description":"Account ID of the user","type":"string"}},"type":"object"},"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy/detach":{"post":{"operationId":"detachPolicy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyDetachPayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully detached"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Detaches a policy from a bucket","tags":["Policies"]}}}}
```

## GET /internal/kos/v1/policy/{policykrn}

> Retrieves a policy

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy/{policykrn}":{"get":{"operationId":"getPolicybyId","parameters":[{"description":"ID of the policy","explode":false,"in":"path","name":"policykrn","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully retrieved"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Retrieves a policy","tags":["Policies"]}}}}
```

## PUT /internal/kos/v1/policy/{policykrn}

> Updates a policy

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"PolicyPayload":{"properties":{"_id":{"description":"Unique ID of the policy","type":"string"},"name":{"description":"Name of the policy","type":"string"},"statements":{"description":"Statements of the policy","items":{"type":"object"},"type":"array"},"conditions":{"description":"Conditions of the policy","items":{"type":"object"},"type":"array"},"accountId":{"description":"Account ID of the policy","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"}},"type":"object"},"PolicyResponse":{"allOf":[{"properties":{"name":{"description":"policy Name","type":"string"},"policyKRN":{"description":"Unique ID of the policy","type":"string"},"CreationDate":{"description":"Creation date of the policy","type":"string"}},"type":"object"}]},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy/{policykrn}":{"put":{"operationId":"updatePolicy","parameters":[{"description":"ID of the policy","explode":false,"in":"path","name":"policykrn","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}},"description":"Policy successfully updated"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Updates a policy","tags":["Policies"]}}}}
```

## DELETE /internal/kos/v1/policy/{policykrn}

> Deletes a policy

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/internal/kos/v1/policy/{policykrn}":{"delete":{"operationId":"deletePolicy","parameters":[{"description":"ID of the policy","explode":false,"in":"path","name":"policykrn","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"204":{"description":"Policy successfully deleted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Deletes a policy","tags":["Policies"]}}}}
```

## Activate a new session for API access

> Creates a new session for accessing protected APIs. \
> \- If a previous session exists and is still active, it will be invalidated\
> \- Sessions automatically expire after the configured timeout\
> \- Only one active session is allowed per set of credentials<br>

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"activateSession_request":{"properties":{"accessKey":{"description":"Access key for authentication","type":"string"},"secretKey":{"description":"Secret key for authentication","type":"string"}},"required":["accessKey","secretKey"],"type":"object"},"activateSession_200_response":{"properties":{"sessionToken":{"description":"Session token to be used for protected APIs","type":"string"},"expiresAt":{"description":"Session expiration timestamp","format":"date-time","type":"string"},"refreshToken":{"description":"Token used to refresh the session before expiration","type":"string"},"lastActiveAt":{"description":"Timestamp of last activity","format":"date-time","type":"string"}},"type":"object"},"activateSession_400_response":{"properties":{"error":{"description":"Error message","type":"string"},"code":{"enum":["INVALID_CREDENTIALS","MALFORMED_REQUEST"],"type":"string"}},"type":"object"},"activateSession_429_response":{"properties":{"error":{"type":"string"},"retryAfter":{"description":"Seconds to wait before retrying","type":"integer"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/sessions/activate":{"post":{"description":"Creates a new session for accessing protected APIs. \n- If a previous session exists and is still active, it will be invalidated\n- Sessions automatically expire after the configured timeout\n- Only one active session is allowed per set of credentials\n","operationId":"activateSession","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/activateSession_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/activateSession_200_response"}}},"description":"Session activated successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/activateSession_400_response"}}},"description":"Invalid credentials or request format"},"401":{"description":"Unauthorized - Invalid credentials"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/activateSession_429_response"}}},"description":"Too many session activation attempts"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Activate a new session for API access","tags":["Session Management"]}}}}
```

## Deactivate current session

> Explicitly deactivates the current session.\
> \- Invalidates the session token\
> \- Blocks access to protected APIs\
> \- Cleans up session resources<br>

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{"SessionToken":[]}],"components":{"securitySchemes":{},"schemas":{"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/sessions/deactivate/{sessionToken}":{"delete":{"description":"Explicitly deactivates the current session.\n- Invalidates the session token\n- Blocks access to protected APIs\n- Cleans up session resources\n","operationId":"deactivateSession","parameters":[{"explode":false,"in":"path","name":"sessionToken","required":true,"schema":{"description":"Session token","type":"string"},"style":"simple"}],"responses":{"204":{"description":"Session deactivated successfully"},"401":{"description":"Invalid session token"},"404":{"description":"Session not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Deactivate current session","tags":["Session Management"]}}}}
```

## Refresh current session

> Extends the current session lifetime before it expires

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{"SessionToken":[]}],"components":{"securitySchemes":{},"schemas":{"refreshSession_request":{"properties":{"refreshToken":{"type":"string"}},"required":["refreshToken"],"type":"object"},"refreshSession_200_response":{"properties":{"sessionToken":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"refreshToken":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/sessions/refresh/{sessionToken}":{"post":{"description":"Extends the current session lifetime before it expires","operationId":"refreshSession","parameters":[{"explode":false,"in":"path","name":"sessionToken","required":true,"schema":{"description":"Session token","type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/refreshSession_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/refreshSession_200_response"}}},"description":"Session refreshed successfully"},"401":{"description":"Invalid refresh token or session"},"404":{"description":"Session not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Refresh current session","tags":["Session Management"]}}}}
```

## Get current session status

> Returns the status and details of the current session

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{"SessionToken":[]}],"components":{"securitySchemes":{},"schemas":{"getSessionStatus_200_response":{"properties":{"isActive":{"type":"boolean"},"expiresAt":{"format":"date-time","type":"string"},"lastActiveAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/sessions/status/{sessionToken}":{"get":{"description":"Returns the status and details of the current session","operationId":"getSessionStatus","parameters":[{"explode":false,"in":"path","name":"sessionToken","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getSessionStatus_200_response"}}},"description":"Session status retrieved successfully"},"401":{"description":"Invalid or expired session token"},"404":{"description":"Session not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Get current session status","tags":["Session Management"]}}}}
```

## POST /kos/v1/buckets/{bucketId}/objects/delete

> Delete an object

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"deleteObject_request":{"properties":{"objectkey":{"description":"The key of the object to delete","type":"string"}},"type":"object"},"deleteObject_200_response":{"properties":{"message":{"type":"string"},"objectKey":{"description":"The key of the deleted file","type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects/delete":{"post":{"operationId":"deleteObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/deleteObject_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/deleteObject_200_response"}}},"description":"File deleted successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized, invalid credentials"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Object not found or bucket does not exist"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Delete an object","tags":["ObjectsOperations"]}}}}
```

## GET /kos/v1/buckets/{bucketId}/objects

> List objects in a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"listObjects_200_response":{"properties":{"prefix":{"description":"The folder path prefix for objects","type":"string"},"objects":{"items":{"$ref":"#/components/schemas/listObjects_200_response_objects_inner"},"type":"array"}},"type":"object"},"listObjects_200_response_objects_inner":{"properties":{"key":{"description":"The object's key (path within bucket)","type":"string"},"size":{"description":"Object size in bytes","type":"integer"},"lastModified":{"description":"Last modified date","format":"date-time","type":"string"},"isFolder":{"description":"True if the object is a folder (common prefix)","type":"boolean"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects":{"get":{"operationId":"listObjects","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"Filter objects by prefix (like a folder path)","explode":true,"in":"query","name":"prefix","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/listObjects_200_response"}}},"description":"List of objects in the bucket"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized, invalid credentials"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"List objects in a bucket","tags":["ObjectsOperations"]}}}}
```

## PUT /kos/v1/buckets/{bucketId}/objects

> Upload a new object

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"uploadObject_request":{"properties":{"prefix":{"description":"The folder path prefix for objects","type":"string"}},"type":"object"},"uploadObject_201_response":{"properties":{"message":{"type":"string"},"objectKey":{"description":"The key of the uploaded file","type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects":{"put":{"operationId":"uploadObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/uploadObject_request"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/uploadObject_201_response"}}},"description":"File uploaded successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized, invalid credentials"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Upload a new object","tags":["ObjectsOperations"]}}}}
```

## POST /kos/v1/buckets/{bucketId}/objects/download

> Download an object

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"downloadObject_request":{"properties":{"objectkey":{"description":"The key of the object to download","type":"string"}},"type":"object"},"downloadObject_200_response":{"properties":{"message":{"type":"string"},"objectKey":{"description":"The key and preSignedUrl of the download file","type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects/download":{"post":{"operationId":"downloadObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/downloadObject_request"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/downloadObject_200_response"}}},"description":"The file content as binary"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized, invalid credentials"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Object not found or bucket does not exist"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Download an object","tags":["ObjectsOperations"]}}}}
```

## POST /kos/v1/buckets/{bucketId}/objects/metadata

> Get object metadata

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"getObject_request":{"properties":{"objectkey":{"description":"The key of the object to download","type":"string"}},"type":"object"},"getObject_200_response":{"properties":{"key":{"description":"Object key (path within bucket)","type":"string"},"size_bytes":{"description":"Object size in bytes","format":"int64","type":"integer"},"storage_class":{"description":"Storage class of the object","type":"string"},"lastModified":{"description":"Last modified date","type":"string"},"contentType":{"description":"MIME type of the object","type":"string"},"etag":{"description":"ETag of the object","type":"string"}},"required":["key","lastModified","size_bytes"],"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects/metadata":{"post":{"operationId":"getObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getObject_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getObject_200_response"}}},"description":"Metadata of the object"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized, invalid credentials"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Object not found or bucket does not exist"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"}},"summary":"Get object metadata","tags":["ObjectsOperations"]}}}}
```

## POST /kos/v1/buckets/{bucketId}/objects/move

> Move or copy an object within a bucket

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"moveObject_request":{"properties":{"sourceKey":{"description":"Source object key","type":"string"},"destinationKey":{"description":"Destination object key","type":"string"},"action":{"description":"Action to perform (move or copy)","enum":["move","copy"],"type":"string"}},"type":"object"},"moveObject_200_response":{"properties":{"message":{"type":"string"},"sourceKey":{"description":"Source key","type":"string"},"destinationKey":{"description":"Destination key","type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects/move":{"post":{"operationId":"moveObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/moveObject_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/moveObject_200_response"}}},"description":"File moved or copied successfully"}},"summary":"Move or copy an object within a bucket","tags":["ObjectsOperations"]}}}}
```

## Rename an object within the bucket

> Rename an object by copying it to a new key and deleting the original.

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"renameObject_request":{"properties":{"oldKey":{"description":"The old key for the object (the old name/path for the file)","type":"string"},"newKey":{"description":"The new key for the object (the new name/path for the file)","type":"string"}},"type":"object"},"renameObject_200_response":{"properties":{"message":{"type":"string"},"oldKey":{"description":"Original key of the object","type":"string"},"newKey":{"description":"New key of the object","type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/{bucketId}/objects/rename":{"post":{"description":"Rename an object by copying it to a new key and deleting the original.","operationId":"renameObject","parameters":[{"description":"Krn identifier of the bucket","explode":false,"in":"path","name":"bucketId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/renameObject_request"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/renameObject_200_response"}}},"description":"Object renamed successfully"},"400":{"description":"Invalid request parameters"},"404":{"description":"Object not found"}},"summary":"Rename an object within the bucket","tags":["ObjectsOperations"]}}}}
```

## Get Bucket Policy Details

> Returns details of a specified bucket policy.

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketPolicy":{"properties":{"bucketPolicyKrn":{"description":"Unique Key Resource Name (KRN) of the bucket policy.","type":"string"},"bucketKrn":{"description":"Unique Key Resource Name (KRN) of the bucket policy.","type":"string"},"s3_read_write_ips":{"description":"S3 hosts with read/write permissions.","items":{"type":"string"},"type":"array"},"s3_read_only_ips":{"description":"S3 hosts with read-only permissions.","items":{"type":"string"},"type":"array"},"created_at":{"description":"Creation timestamp of the policy.","format":"date-time","type":"string"},"updated_at":{"description":"Last updated timestamp of the policy.","format":"date-time","type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/policy/{bucketKrn}":{"get":{"description":"Returns details of a specified bucket policy.","parameters":[{"description":"The unique bucketKrn (Key Resource Name) of the bucket policy.","explode":false,"in":"path","name":"bucketKrn","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketPolicy"}}},"description":"Details of the bucket policy."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Get Bucket Policy Details","tags":["BucketPolicies"]}}}}
```

## Create a Bucket Policy

> Creates a new bucket policy.

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketPolicyCreate":{"properties":{"s3_read_write_ips":{"description":"S3 hosts with read/write permissions.","items":{"type":"string"},"type":"array"},"s3_read_only_ips":{"description":"S3 hosts with read-only permissions.","items":{"type":"string"},"type":"array"}},"required":["name"],"type":"object"},"BucketPolicy":{"properties":{"bucketPolicyKrn":{"description":"Unique Key Resource Name (KRN) of the bucket policy.","type":"string"},"bucketKrn":{"description":"Unique Key Resource Name (KRN) of the bucket policy.","type":"string"},"s3_read_write_ips":{"description":"S3 hosts with read/write permissions.","items":{"type":"string"},"type":"array"},"s3_read_only_ips":{"description":"S3 hosts with read-only permissions.","items":{"type":"string"},"type":"array"},"created_at":{"description":"Creation timestamp of the policy.","format":"date-time","type":"string"},"updated_at":{"description":"Last updated timestamp of the policy.","format":"date-time","type":"string"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/policy/{bucketKrn}":{"post":{"description":"Creates a new bucket policy.","parameters":[{"description":"The unique bucketKrn of the bucket policy to create.","explode":false,"in":"path","name":"bucketKrn","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketPolicyCreate"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketPolicy"}}},"description":"Bucket policy created."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Create a Bucket Policy","tags":["BucketPolicies"]}}}}
```

## Modify a Bucket Policy

> Modifies an existing bucket policy.

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"BucketPolicyUpdate":{"properties":{"s3_read_write_ips":{"description":"S3 hosts with read/write permissions.","items":{"type":"string"},"type":"array"},"s3_read_only_ips":{"description":"S3 hosts with read-only permissions.","items":{"type":"string"},"type":"array"}},"type":"object"},"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/policy/{bucketKrn}":{"put":{"description":"Modifies an existing bucket policy.","parameters":[{"description":"The unique bucketKrn of the bucket policy.","explode":false,"in":"path","name":"bucketKrn","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BucketPolicyUpdate"}}},"required":true},"responses":{"200":{"description":"Bucket policy modified."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Modify a Bucket Policy","tags":["BucketPolicies"]}}}}
```

## Delete a Bucket Policy

> Deletes a specified bucket policy.

```json
{"openapi":"3.0.0","info":{"title":"Object Storage Bucket API","version":"1.0.0"},"tags":[],"servers":[{"url":"/"}],"security":[{},{"K-Customer-ID":[]},{},{},{},{"Authorization":[]},{},{}],"components":{"securitySchemes":{"K-Customer-ID":{"description":"Krutrim customer user id","in":"header","name":"K-Customer-ID","type":"apiKey"},"Authorization":{"bearerFormat":"JWT","description":"Authorization","scheme":"bearer","type":"http"}},"schemas":{"ErrorBadRequest":{"description":"Bad request or invalid input","properties":{"message":{"type":"string"}},"type":"object"},"ErrorUnauthorized":{"description":"Unauthorized access","properties":{"message":{"type":"string"}},"type":"object"},"ErrorNotFound":{"description":"Resource not found","properties":{"message":{"type":"string"}},"type":"object"},"ErrorInternalServerError":{"description":"Internal server error","properties":{"message":{"type":"string"}},"type":"object"},"ErrorServiceUnavailable":{"description":"Service is currently unavailable","properties":{"message":{"type":"string"}},"type":"object"}}},"paths":{"/kos/v1/buckets/policy/{bucketKrn}":{"delete":{"description":"Deletes a specified bucket policy.","parameters":[{"description":"The unique bucketKrn of the bucket policy to delete.","explode":false,"in":"path","name":"bucketKrn","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"204":{"description":"Bucket policy deleted."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBadRequest"}}},"description":"Bad request, invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnauthorized"}}},"description":"Unauthorized access"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}},"description":"Bucket policy not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInternalServerError"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorServiceUnavailable"}}},"description":"Service unavailable"}},"summary":"Delete a Bucket Policy","tags":["BucketPolicies"]}}}}
```
