# Files ## List files **get** `/v1/files` List all files uploaded by the current user. ### Query Parameters - `after: optional string` A cursor for pagination. Use the `last_id` from a previous response to fetch the next page. - `limit: optional number` Maximum number of files to return. ### Returns - `data: array of File` List of files. - `id: string` The unique identifier for this file. - `content_type: string` The MIME type of the file. - `created_at: string` The timestamp when the file was uploaded. - `file_name: string` The original filename of the uploaded file. - `object: "file"` The object type, which is always 'file'. - `"file"` - `size: number` The size of the file in bytes. - `has_more: boolean` Whether there are more results available after this page. - `object: "list"` The object type, which is always 'list'. - `"list"` - `first_id: optional string` Unique identifier for a file. - `last_id: optional string` Unique identifier for a file. ### Example ```http curl https://api.deeptable.com/v1/files \ -H "Authorization: Bearer $DEEPTABLE_API_KEY" ``` #### Response ```json { "data": [ { "id": "file_01kfxgjd94fn9stqm414vjb0s8", "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "created_at": "2024-01-15T10:30:00Z", "file_name": "financial_report.xlsx", "object": "file", "size": 1048576 } ], "has_more": false, "object": "list", "first_id": "file_01kfxgjd94fn9stqm414vjb0s8", "last_id": "file_01kfxgjd94fn9stqm414vjb0s8" } ``` ## Upload a file **post** `/v1/files` Upload an Excel spreadsheet file for later processing. Supported formats: - Excel (.xlsx) Maximum file size: 100 MB ### Returns - `File = object { id, content_type, created_at, 3 more }` Response representing an uploaded file. This is returned from POST (upload), GET (retrieve), and list endpoints. - `id: string` The unique identifier for this file. - `content_type: string` The MIME type of the file. - `created_at: string` The timestamp when the file was uploaded. - `file_name: string` The original filename of the uploaded file. - `object: "file"` The object type, which is always 'file'. - `"file"` - `size: number` The size of the file in bytes. ### Example ```http curl https://api.deeptable.com/v1/files \ -H 'Content-Type: multipart/form-data' \ -H "Authorization: Bearer $DEEPTABLE_API_KEY" \ -F 'file=@/path/to/file' ``` #### Response ```json { "id": "file_01kfxgjd94fn9stqm414vjb0s8", "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "created_at": "2024-01-15T10:30:00Z", "file_name": "financial_report.xlsx", "object": "file", "size": 1048576 } ``` ## Delete a file **delete** `/v1/files/{file_id}` Delete a file. This cannot be undone. ### Path Parameters - `file_id: string` The unique identifier of the file. ### Returns - `id: string` The unique identifier of the deleted file. - `deleted: true` Whether the file was successfully deleted. - `true` - `object: "file"` The object type, which is always 'file'. - `"file"` ### Example ```http curl https://api.deeptable.com/v1/files/$FILE_ID \ -X DELETE \ -H "Authorization: Bearer $DEEPTABLE_API_KEY" ``` #### Response ```json { "id": "file_01kfxgjd94fn9stqm414vjb0s8", "deleted": true, "object": "file" } ``` ## Get file metadata **get** `/v1/files/{file_id}` Get metadata for a specific file. ### Path Parameters - `file_id: string` The unique identifier of the file. ### Returns - `File = object { id, content_type, created_at, 3 more }` Response representing an uploaded file. This is returned from POST (upload), GET (retrieve), and list endpoints. - `id: string` The unique identifier for this file. - `content_type: string` The MIME type of the file. - `created_at: string` The timestamp when the file was uploaded. - `file_name: string` The original filename of the uploaded file. - `object: "file"` The object type, which is always 'file'. - `"file"` - `size: number` The size of the file in bytes. ### Example ```http curl https://api.deeptable.com/v1/files/$FILE_ID \ -H "Authorization: Bearer $DEEPTABLE_API_KEY" ``` #### Response ```json { "id": "file_01kfxgjd94fn9stqm414vjb0s8", "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "created_at": "2024-01-15T10:30:00Z", "file_name": "financial_report.xlsx", "object": "file", "size": 1048576 } ``` ## Download file **get** `/v1/files/{file_id}/content` Download the original uploaded file content. ### Path Parameters - `file_id: string` The unique identifier of the file. ### Example ```http curl https://api.deeptable.com/v1/files/$FILE_ID/content \ -H "Authorization: Bearer $DEEPTABLE_API_KEY" ``` ## Domain Types ### File - `File = object { id, content_type, created_at, 3 more }` Response representing an uploaded file. This is returned from POST (upload), GET (retrieve), and list endpoints. - `id: string` The unique identifier for this file. - `content_type: string` The MIME type of the file. - `created_at: string` The timestamp when the file was uploaded. - `file_name: string` The original filename of the uploaded file. - `object: "file"` The object type, which is always 'file'. - `"file"` - `size: number` The size of the file in bytes.