# Storage objects

## Lists all objects (files) in a bucket

> \
> \
> \*\*Required Permission:\*\* \`buckets.objects.list\`\
> \
> \*\*Resource:\*\* \`buckets/:bucketId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Storage objects","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/buckets/{bucketId}/objects":{"get":{"operationId":"StorageObjectController_listObjects[1]_v1","parameters":[{"name":"bucketId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"List of all objects.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListObjectsResponseDto"}}}},"403":{"description":"No authorization."}},"summary":"Lists all objects (files) in a bucket","tags":["Storage objects"],"description":"\n\n**Required Permission:** `buckets.objects.list`\n\n**Resource:** `buckets/:bucketId`"}}},"components":{"schemas":{"ListObjectsResponseDto":{"type":"object","properties":{"objects":{"description":"The list of objects.","type":"array","items":{"$ref":"#/components/schemas/StorageObjectDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["objects"]},"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## Uploads a new object (file) to a bucket

> \
> \
> \*\*Required Permission:\*\* \`buckets.objects.create\`\
> \
> \*\*Resource:\*\* \`buckets/:bucketId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Storage objects","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/buckets/{bucketId}/objects":{"post":{"operationId":"StorageObjectController_createObject[1]_v1","parameters":[{"name":"bucketId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"File upload with optional metadata.","content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateObjectDto"}}}},"responses":{"201":{"description":"Object successfully uploaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Uploads a new object (file) to a bucket","tags":["Storage objects"],"description":"\n\n**Required Permission:** `buckets.objects.create`\n\n**Resource:** `buckets/:bucketId`"}}},"components":{"schemas":{"CreateObjectDto":{"type":"object","properties":{"data":{"type":"string","format":"binary","description":"The file to be uploaded."},"filename":{"type":"string","description":"An optional filename. If not specified, the original name of the file will be used."},"metadata":{"type":"object","description":"Optional metadata as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["data","metadata"]},"StorageObjectResponseDto":{"type":"object","properties":{"object":{"description":"The object.","nullable":true,"allOf":[{"$ref":"#/components/schemas/StorageObjectDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["object"]},"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## Retrieves a specific object

> \
> \
> \*\*Required Permission:\*\* \`buckets.objects.get\`\
> \
> \*\*Resource:\*\* \`buckets/:bucketId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Storage objects","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/buckets/{bucketId}/objects/{objectId}":{"get":{"operationId":"StorageObjectController_getObject[1]_v1","parameters":[{"name":"bucketId","required":true,"in":"path","schema":{"type":"string"}},{"name":"objectId","required":true,"in":"path","description":"The ID (name/path) of the object to retrieve","schema":{"type":"string"}}],"responses":{"200":{"description":"Object details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageObjectResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Retrieves a specific object","tags":["Storage objects"],"description":"\n\n**Required Permission:** `buckets.objects.get`\n\n**Resource:** `buckets/:bucketId`"}}},"components":{"schemas":{"StorageObjectResponseDto":{"type":"object","properties":{"object":{"description":"The object.","nullable":true,"allOf":[{"$ref":"#/components/schemas/StorageObjectDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["object"]},"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## Deletes an object from a bucket

> \
> \
> \*\*Required Permission:\*\* \`buckets.objects.delete\`\
> \
> \*\*Resource:\*\* \`buckets/:bucketId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Storage objects","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/buckets/{bucketId}/objects/{objectId}":{"delete":{"operationId":"StorageObjectController_deleteObject[1]_v1","parameters":[{"name":"bucketId","required":true,"in":"path","schema":{"type":"string"}},{"name":"objectId","required":true,"in":"path","description":"The ID (name/path) of the object to delete","schema":{"type":"string"}}],"responses":{"200":{"description":"Result of the deletion operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteObjectResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Deletes an object from a bucket","tags":["Storage objects"],"description":"\n\n**Required Permission:** `buckets.objects.delete`\n\n**Resource:** `buckets/:bucketId`"}}},"components":{"schemas":{"DeleteObjectResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatcaptain.com/api/api-dokumentation/storage-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
