diff --git a/system_admin_account_operations.yaml b/system_admin_account_operations.yaml index 99adad6..725b12c 100644 --- a/system_admin_account_operations.yaml +++ b/system_admin_account_operations.yaml @@ -236,6 +236,23 @@ components: type: boolean example: "false" description: Set this to `true` to export the base without assets. Default is `false`. + group_by: + name: group_by + in: query + schema: + type: string + enum: [owner, org_id] + required: true + description: Query by owner or organization + example: "owner" + date_YYYY_MM_DD: + name: date + in: query + schema: + type: string + required: true + description: A date string in YYYY-MM-DD format + example: "2025-01-01" #=======================Path parameters=======================# base_uuid: @@ -468,6 +485,9 @@ components: asset_quota_mb: type: string description: The asset quota in MB. + automation_limit_per_month: + type: integer + description: Monthly limit on the number of automated rules file: type: string format: binary @@ -808,6 +828,8 @@ paths: $ref: "#/components/schemas/quota_total" asset_quota_mb: $ref: "#/components/schemas/asset_quota_mb" + automation_limit_per_month: + $ref: "#/components/schemas/automation_limit_per_month" security: - AccountTokenAuth: [] parameters: @@ -834,6 +856,7 @@ paths: create_time: "2020-11-18T12:30:31+00:00" role: default update_status_tip: "" + automation_limit_per_month: 1000 delete: tags: - Users @@ -1969,6 +1992,8 @@ paths: $ref: "#/components/schemas/max_user_number" asset_quota_mb: $ref: "#/components/schemas/asset_quota_mb" + automation_limit_per_month: + $ref: "#/components/schemas/automation_limit_per_month" security: - AccountTokenAuth: [] parameters: @@ -1995,6 +2020,7 @@ paths: max_user_number: 3 rows_count: 7185 row_limit: -1 + automation_limit_per_month: 1000 get: tags: - Teams @@ -4096,6 +4122,51 @@ paths: latest_visit_at: "2022-07-02T14:09:37+00:00" org_name: SeaTable GmbH count: 1 + /api/v2.1/admin/statistics/ai/: + get: + tags: + - Statistics + summary: Get AI statistics by owner/team + operationId: getOwnerOrTeamAIStatistics + description: Get AI usage statistics monthly by owner/team. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/group_by" + - $ref: "#/components/parameters/date_YYYY_MM_DD" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + examples: + group_by_owner: + summary: Query group by owner + value: + results: + - org_id: 176 + org_name: SeaTable + owner: 1@seafile_group + group_name: group-11 + total_cost: 0.25 + is_department_v2_group: false + - org_id: 176 + org_name: SeaTable + owner: d15ebe61bd684b868344498c73bdeac4@auth.local + nickname: test + count: 2 + group_by_team: + summary: Query group by organization + value: + results: + - org_id: 176 + org_name: SeaTable + total_cost: 0.25 + count: 1 # Maintenance /api/v2.1/admin/dtable/{base_uuid}/repair/: diff --git a/team_admin_account_operations.yaml b/team_admin_account_operations.yaml index a1e234b..2e3afca 100644 --- a/team_admin_account_operations.yaml +++ b/team_admin_account_operations.yaml @@ -30,6 +30,8 @@ tags: description: Retrieve team info and update team settings - name: Activities & Logs description: Retrieve team activities and logs + - name: Statistics + description: Retrieve statistics about system activities - name: Customizing description: Customize team appearance - name: SAML @@ -69,6 +71,14 @@ components: type: string description: Exact name or a part of the name of the base, case insensitive. example: "Example" + dtable_uuid: + name: dtable_uuid + in: query + schema: + type: string + pattern: '^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$' + description: The unique identifier of a base. + example: 5c264e76-0e5a-448a-9f34-580b551364ca ignore_asset: name: ignore_asset in: query @@ -76,6 +86,58 @@ components: type: boolean example: "false" description: Set this to `true` to export the base without assets. Default is `false`. + login_status: + name: login_status + in: query + schema: + type: string + enum: [success, failure] + example: success + description: Set this to `success` to only return successful logins. By default, all logins are returned. + start: + name: start + in: query + schema: + type: string + format: date-time + description: Start date in ISO format. + example: "2025-11-01T06:00:00+01:00" + required: false + end: + name: end + in: query + schema: + type: string + format: date-time + description: End date in ISO format. + example: "2025-11-30T18:00:00+01:00" + required: false + operation_group: + name: operation_group + in: query + schema: + type: string + enum: [user, group, base] + example: user + description: Filter by a specific operation group. By default, all operations are returned. + required: false + group_by: + name: group_by + in: query + schema: + type: string + enum: [owner, dtable_uuid] + required: true + description: Query by owner or Base + example: "owner" + date: + name: date + in: query + schema: + type: string + required: true + description: A date string in YYYY-MM-DD format + example: "2025-01-01" #=======================Path parameters=======================# org_id: @@ -149,6 +211,14 @@ components: pattern: "^[a-f0-9]{32}(@auth.local)$" required: true example: 123456789f1e4c8d8e1c31415867317c@auth.local + app_name: + name: app_name + description: The name of your app. Every API-Token has a name to identify the purpose. The name of the app must be unique for every base. + in: path + schema: + type: string + required: true + example: "My App" schemas: team_admin_permission: @@ -406,6 +476,8 @@ paths: id_in_org: "" has_default_device: false is_force_2fa: true + is_active: true + is_org_admin: false put: tags: - Users @@ -637,6 +709,64 @@ paths: owner_deleted: false, rows_count: 20 count: 16 + /api/v2.1/org/{org_id}/admin/users/{user_id}/dtables/: + get: + tags: + - Bases + summary: List User's Bases + operationId: listUsersBases + description: List all the bases of a certain user by the user's ID. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/user_id" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + dtable_list: + - id: 6 + workspace_id: 2 + uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + name: CRM + created_at: '2025-11-28T14:16:30+01:00' + updated_at: '2025-11-28T14:17:04+01:00' + color: "#E91E63" + text_color: null + icon: icon-user-interview + is_encrypted: false + in_storage: true + org_id: 2 + email: e38487b4357e40c8b1359223ba87a1af@auth.local + group_id: -1 + owner: org-1-admin + owner_deleted: false + rows_count: 7 + - id: 7 + workspace_id: 2 + uuid: e97bb668-da36-484c-8ac9-8aa9e0564f4c + name: Finances + created_at: '2025-11-28T14:18:31+01:00' + updated_at: '2025-11-28T14:18:31+01:00' + color: "#00C9C7" + text_color: null + icon: icon-dollar + is_encrypted: false + in_storage: true + org_id: 2 + email: e38487b4357e40c8b1359223ba87a1af@auth.local + group_id: -1 + owner: org-1-admin + owner_deleted: false + rows_count: 0 + count: 2 /api/v2.1/org/{org_id}/admin/dtables/{base_uuid}/: get: tags: @@ -1221,8 +1351,170 @@ paths: application/json: schema: type: object + /api/v2.1/org/{org_id}/admin/dtables/{base_uuid}/api-tokens/: + get: + tags: + - Bases + summary: List API-Tokens + operationId: listApiTokens + description: List API tokens of a single base. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/base_uuid" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + api_tokens: + - app_name: n8n + api_token: c1a7a416280ab3f9b0b632edbb58a69a771783f0 + generated_by: e38487b4357e40c8b1359223ba87a1af@auth.local + creator: user1 + avatar_url: https://cloud.seatable.io/media/avatars/default.png + generated_at: '2025-11-28T14:18:39+01:00' + last_access: '2025-11-28T14:18:39+01:00' + permission: rw + /api/v2.1/org/{org_id}/admin/dtables/{base_uuid}/api-tokens/{app_name}/: + delete: + tags: + - Bases + summary: Delete API-Token + operationId: deleteApiToken + description: Delete a specific API token from a base. The token is identified by its *app_name*. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/base_uuid" + - $ref: "#/components/parameters/app_name" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + success: true + /api/v2.1/org/{org_id}/admin/api-tokens/: + get: + tags: + - Bases + summary: List API-Tokens of All Bases + operationId: listApiTokensOfAllBases + description: List API tokens of all bases inside the team/organization. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + api_tokens: + - app_name: n8n + api_token: c1a7a416280ab3f9b0b632edbb58a69a771783f0 + generated_by: e38487b4357e40c8b1359223ba87a1af@auth.local + creator: user1 + avatar_url: https://cloud.seatable.io/media/avatars/default.png + generated_at: '2025-11-28T14:18:39+01:00' + last_access: '2025-11-28T14:18:39+01:00' + permission: rw + dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + dtable_name: CRM + dtable_icon: icon-user-interview + dtable_color: "#E91E63" + - app_name: API + api_token: 89913c6509062bbd24efe42a509cf9c5bb843018 + generated_by: e38487b4357e40c8b1359223ba87a1af@auth.local + creator: user1 + avatar_url: https://cloud.seatable.io/media/avatars/default.png + generated_at: '2025-11-28T14:18:54+01:00' + last_access: '2025-11-28T14:18:54+01:00' + permission: rw + dtable_uuid: e97bb668-da36-484c-8ac9-8aa9e0564f4c + dtable_name: Finances + dtable_icon: icon-dollar + dtable_color: "#00C9C7" + total_count: 2 # Sharing Links + /api/v2.1/org/{org_id}/admin/shares/: + get: + tags: + - Sharing Links + summary: List Shares + operationId: listShares + description: | + List all shares inside the given team/organization. + + This includes the following: + - Bases shared to individual users + - Bases shared to groups + - Views shared to individual users + - Views shared to groups + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + dtable_user_shares: + - dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + email: 97f45993fc174280b939976c9b9256eb@auth.local + name: org-1-user-1 + avatar_url: https://cloud.seatable.io/media/avatars/default.png + contact_email: org-1-user-1@seatable.io + permission: rw + share_id: 1 + dtable_group_shares: + - dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + group_id: 1 + group_name: Marketing + permission: rw + share_id: 1 + view_user_shares: + - dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + id: 1 + dtable_name: CRM + from_user: e38487b4357e40c8b1359223ba87a1af@auth.local + to_user: 97f45993fc174280b939976c9b9256eb@auth.local + permission: r + table_id: '0000' + view_id: '0000' + shared_name: User share + from_user_name: org-1-admin + to_user_name: org-1-user-1 + view_group_shares: + - dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + id: 1 + dtable_name: CRM + from_user: e38487b4357e40c8b1359223ba87a1af@auth.local + to_group_id: 1 + permission: r + table_id: '0000' + view_id: '0000' + shared_name: Group share + from_user_name: org-1-admin + to_group_name: Marketing /api/v2.1/org/{org_id}/admin/external-links/: get: tags: @@ -1621,6 +1913,28 @@ paths: enable_force_2fa: true enable_new_user_email: true enable_external_user_access_invite_link: false + /api/v2.1/org/admin/: + delete: + tags: + - Info & Settings + summary: Delete Team + operationId: deleteTeam + description: >- + Delete a team (organization) with its ID. This will eliminate the team! + + However, this won't delete the team users - but all its members will + become team-less users in the system. + security: + - AccountTokenAuth: [] + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + success: true /api/v2.1/org/{org_id}/admin/admin-logs/: get: @@ -1635,6 +1949,9 @@ paths: - $ref: "#/components/parameters/page" - $ref: "#/components/parameters/per_page" - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/operation_group" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" responses: "200": description: OK @@ -1731,6 +2048,9 @@ paths: - $ref: "#/components/parameters/page" - $ref: "#/components/parameters/per_page" - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/login_status" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" responses: "200": description: OK @@ -1867,6 +2187,314 @@ paths: ], "count": 2 } + /api/v2.1/org/{org_id}/admin/automation-logs/: + get: + tags: + - Activities & Logs + summary: List Automation Logs + operationId: listAutomationLogs + description: Returns a list of automation logs inside a specific team. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + logs: + - id: 43543 + rule_id: 454 + trigger_time: "2025-11-28T14:05:52+01:00" + run_condition: per_update + success: true + org_id: -1 + dtable_uuid: 8fc3fbc2-d8d2-4a23-965d-33cbf511d780 + owner: 314bd2ed8d9741b08852916907dc7dd5@auth.local + warnings: null + - id: 43544 + rule_id: 454 + trigger_time: "2025-11-28T14:05:55+01:00" + run_condition: per_update + success: true + org_id: -1 + dtable_uuid: 8fc3fbc2-d8d2-4a23-965d-33cbf511d780 + owner: 314bd2ed8d9741b08852916907dc7dd5@auth.local + warnings: null + total_count: 2 + + # Statistics + /api/v2.1/org/{org_id}/admin/statistics/admin-logs/by-day/: + get: + tags: + - Statistics + summary: Admin Logs (by Day) + operationId: getAdminLogStatisticsByDay + description: Returns statistics about admin logs grouped by day. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - date: '2025-10-29' + number_of_operations: 2 + base_operations: 1 + group_operations: 0 + user_operations: 1 + - date: '2025-10-30' + number_of_operations: 5 + base_operations: 3 + group_operations: 1 + user_operations: 1 + - date: '2025-10-31' + number_of_operations: 2 + base_operations: 0 + group_operations: 1 + user_operations: 1 + total_count: 3 + /api/v2.1/org/{org_id}/admin/statistics/automation-logs/by-day/: + get: + tags: + - Statistics + summary: Automation Logs (by Day) + operationId: getAutomationLogStatisticsByDay + description: Returns statistics about automation logs grouped by day. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/dtable_uuid" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - trigger_date: '2025-11-27' + number_of_executions: 10 + successful_executions: 9 + unsuccessful_executions: 1 + - trigger_date: '2025-11-28' + number_of_executions: 2 + successful_executions: 2 + unsuccessful_executions: 0 + total_count: 2 + /api/v2.1/org/{org_id}/admin/statistics/automation-logs/by-base/: + get: + tags: + - Statistics + summary: Automation Logs (by Base) + operationId: getAutomationLogStatisticsByBase + description: Returns statistics about automation logs grouped by base. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - dtable_uuid: 3c899a81-6a0c-4111-bb19-288ebf8442fd + number_of_executions: 2 + successful_executions: 2 + unsuccessful_executions: 0 + - dtable_uuid: e97bb668-da36-484c-8ac9-8aa9e0564f4c + number_of_executions: 5 + successful_executions: 4 + unsuccessful_executions: 1 + total_count: 2 + /api/v2.1/org/{org_id}/admin/statistics/login-logs/by-day/: + get: + tags: + - Statistics + summary: Login Logs (by Day) + operationId: getLoginLogStatisticsByDay + description: Returns statistics about login logs grouped by day. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - date: '2025-11-27' + number_of_attempts: 15 + successful_attempts: 14 + unsuccessful_attempts: 1 + - date: '2025-11-28' + number_of_attempts: 2 + successful_attempts: 1 + unsuccessful_attempts: 1 + total_count: 2 + /api/v2.1/org/{org_id}/admin/statistics/python-runs/by-day/: + get: + tags: + - Statistics + summary: Python Runs (by Day) + operationId: getPythonRunStatisticsByDay + description: Returns statistics about python runs grouped by day. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/dtable_uuid" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - date: '2025-11-27' + number_of_runs: 8 + total_run_time: 5 + triggered_by_automation_rule: 0 + triggered_manually: 8 + successful_runs: 3 + unsuccessful_runs: 5 + - date: '2025-11-28' + number_of_runs: 4 + total_run_time: 22 + triggered_by_automation_rule: 0 + triggered_manually: 4 + successful_runs: 4 + unsuccessful_runs: 0 + total_count: 2 + /api/v2.1/org/{org_id}/admin/statistics/python-runs/by-base/: + get: + tags: + - Statistics + summary: Python Runs (by Base) + operationId: getPythonRunStatisticsByBase + description: Returns statistics about python runs grouped by base. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/org_id" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + example: + results: + - base_uuid: 4202f7ad-3168-4bf4-b1e4-01aee6782f94 + number_of_runs: 8 + total_run_time: 5 + triggered_by_automation_rule: 0 + triggered_manually: 8 + successful_runs: 3 + unsuccessful_runs: 5 + - base_uuid: ca490121-cea3-4a04-8e25-ac72b03a61e0 + number_of_runs: 4 + total_run_time: 22 + triggered_by_automation_rule: 0 + triggered_manually: 4 + successful_runs: 4 + unsuccessful_runs: 0 + total_count: 2 + /api/v2.1/org/{org_id}/admin/statistics/ai/: + get: + tags: + - Statistics + summary: Get AI statistics by user/base + operationId: getUserOrBaseAIStatistics + description: Get AI usage statistics monthly by user/base. + security: + - AccountTokenAuth: [] + parameters: + - $ref: "#/components/parameters/group_by" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/per_page" + - $ref: "#/components/parameters/org_id" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + examples: + group_by_owner: + summary: Query group by owner + value: + results: + - owner: 1@seafile_group + total_cost: 0.15 + group_name: group-11 + - owner: d15ebe61bd684b868344498c73bdeac4@auth.local + total_cost: 0.2 + nickname: test + count: 2 + group_by_base: + summary: Query group by base + value: + results: + - dtable_uuid: f0e6f53caee749b1a5eb65cb2991d6bb + owner: 1@seafile_group + total_cost: 0.04 + group_name: group-11 + count: 1 + /api/v2.1/org/{org_id}/admin/org-logo/: post: tags: