From 8a12611337f4ea0e844ea6dcc3ed62521f28229b Mon Sep 17 00:00:00 2001 From: Simon Hammes Date: Thu, 27 Aug 2026 13:36:29 +0200 Subject: [PATCH 1/3] Document getBaseAssetSize --- user_account_operations.yaml | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/user_account_operations.yaml b/user_account_operations.yaml index 0cbce0f..ee4e22f 100644 --- a/user_account_operations.yaml +++ b/user_account_operations.yaml @@ -4142,6 +4142,50 @@ paths: type: object example: success: true + /api/v2.1/dtable-asset/{base_uuid}/asset-size/: + get: + tags: + - Attachment + summary: Get Base Asset Size + operationId: getBaseAssetSize + description: >- + Get the total size of all assets (attachments, images and files) stored + in a base and check whether the base can be exported together with its + assets. + + All sizes are given in megabytes, rounded down. `max_size_of_export` is + the server-wide limit configured by the system administrator (default: + 100). If `can_export_asset` is `false`, the assets of this base exceed + that limit and the base can only be exported without its assets. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/base_uuid" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + asset_size: + type: integer + description: Total size of all assets of the base. + max_size_of_export: + type: integer + description: Maximum asset size that can be included in an export. + unit: + type: string + description: Unit of the returned sizes. + can_export_asset: + type: boolean + description: Whether the assets of this base can be included in an export. + example: + asset_size: 0 + max_size_of_export: 100 + unit: mb + can_export_asset: true /api/v2.1/dtable-recent-asset/{base_uuid}/: get: tags: From b48cd2bc8ce9e0b76bb17ec73d696322b5c6e290 Mon Sep 17 00:00:00 2001 From: Simon Hammes Date: Mon, 31 Aug 2026 14:09:24 +0200 Subject: [PATCH 2/3] Add test --- tests/test_assets.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_assets.py diff --git a/tests/test_assets.py b/tests/test_assets.py new file mode 100644 index 0000000..0612ef3 --- /dev/null +++ b/tests/test_assets.py @@ -0,0 +1,19 @@ +"""Tests for the base asset endpoints.""" + +from conftest import Base, Secret, user_account_operations +from schemathesis import Case + + +def test_getBaseAssetSize(base: Base, account_token: Secret): + """A base without attachments reports a size of 0 and can be exported with its assets.""" + case: Case = user_account_operations.find_operation_by_id('getBaseAssetSize') \ + .Case(path_parameters={'base_uuid': base.uuid}) + response = case.call(headers={'Authorization': f'Bearer {account_token.value}'}) + + assert response.status_code == 200 + assert response.json() == { + 'asset_size': 0, + 'max_size_of_export': 100, + 'unit': 'mb', + 'can_export_asset': True, + } From ef790fee1fe128186c66b602214254546a3a5223 Mon Sep 17 00:00:00 2001 From: Simon Hammes Date: Mon, 31 Aug 2026 14:11:01 +0200 Subject: [PATCH 3/3] Add changelog entry --- intro/changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intro/changelog.md b/intro/changelog.md index 6f52a7f..a4a0a63 100644 --- a/intro/changelog.md +++ b/intro/changelog.md @@ -25,6 +25,10 @@ Listed below are all the changes to the SeaTable API. Each date corresponds to a > **Base Operations** > > - [Create Row Comment](/reference/createrowcomment) post +> +> **Account Operations - User** +> +> - [Get Base Asset Size](/reference/getbaseassetsize) get > 👍 Other changes >