# Documents

## List Files In User Bucket

> List the files in the user bucket.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/documents/{org_id}/{flow_id}/{node_id}/{user_id}":{"get":{"tags":["Documents"],"summary":"List Files In User Bucket","description":"List the files in the user bucket.","operationId":"list_files_in_user_bucket_documents__org_id___flow_id___node_id___user_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","description":"The organization ID","title":"Org Id"},"description":"The organization ID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"The user ID","title":"User Id"},"description":"The user ID"},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID of the document","title":"Flow Id"},"description":"The flow ID of the document"},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","description":"The node ID of the document","title":"Node Id"},"description":"The node ID of the document"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Response List Files In User Bucket Documents  Org Id   Flow Id   Node Id   User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Upload To User Bucket

> Upload the file to the user bucket for a document node.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"Body_upload_to_user_bucket_documents__org_id___flow_id___node_id___user_id__post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","title":"Body_upload_to_user_bucket_documents__org_id___flow_id___node_id___user_id__post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/documents/{org_id}/{flow_id}/{node_id}/{user_id}":{"post":{"tags":["Documents"],"summary":"Upload To User Bucket","description":"Upload the file to the user bucket for a document node.","operationId":"upload_to_user_bucket_documents__org_id___flow_id___node_id___user_id__post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","description":"The organization ID","title":"Org Id"},"description":"The organization ID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"The user ID","title":"User Id"},"description":"The user ID"},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID of the document","title":"Flow Id"},"description":"The flow ID of the document"},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","description":"The node ID of the document","title":"Node Id"},"description":"The node ID of the document"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_to_user_bucket_documents__org_id___flow_id___node_id___user_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upload To User Bucket Documents  Org Id   Flow Id   Node Id   User Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete From User Bucket

> Delete the file from the user bucket.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/documents/{org_id}/{flow_id}/{node_id}/{user_id}":{"delete":{"tags":["Documents"],"summary":"Delete From User Bucket","description":"Delete the file from the user bucket.","operationId":"delete_from_user_bucket_documents__org_id___flow_id___node_id___user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","description":"The organization ID","title":"Org Id"},"description":"The organization ID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"The user ID","title":"User Id"},"description":"The user ID"},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID of the document","title":"Flow Id"},"description":"The flow ID of the document"},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","description":"The node ID of the document","title":"Node Id"},"description":"The node ID of the document"},{"name":"filename","in":"query","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Delete From User Bucket Documents  Org Id   Flow Id   Node Id   User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Download From User Bucket

> Download the file from the user bucket.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/documents/{org_id}/{flow_id}/{node_id}/{user_id}/file":{"get":{"tags":["Documents"],"summary":"Download From User Bucket","description":"Download the file from the user bucket.","operationId":"download_from_user_bucket_documents__org_id___flow_id___node_id___user_id__file_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","description":"The organization ID","title":"Org Id"},"description":"The organization ID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"The user ID","title":"User Id"},"description":"The user ID"},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID of the document","title":"Flow Id"},"description":"The flow ID of the document"},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","description":"The node ID of the document","title":"Node Id"},"description":"The node ID of the document"},{"name":"filename","in":"query","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
