> ## Documentation Index > Fetch the complete documentation index at: https://docs.supermetrics.com/llms.txt > Use this file to discover all available pages before exploring further. # Edit table group > Update an existing table group's definition (full replace). The request body uses the same `{version, group, tables, fields}` structure that Import accepts and Export returns, so the natural workflow is export → edit → PUT. This is a full replace — all tables and fields must be provided. Omitting `fields` clears all field mappings. Tables and fields are matched to existing records by name. Renaming a table or field is equivalent to removing the old one and adding a new one — the old table's settings and query filter linkage are lost. The `ignore_errors` and `ds_settings` properties are not yet supported on this endpoint and will be rejected with 422 if present. ## OpenAPI ````json PUT /table/group/{group_id} { "openapi": "3.0.3", "info": { "title": "Management API Reference", "version": "2.0.0", "description": "API Documentation for the Supermetrics Management API. For more information, visit https://supermetrics.com.", "termsOfService": "https://supermetrics.com/terms-of-service", "contact": { "name": "Supermetrics Suppot", "email": "support@supermetrics.com", "url": "https://supermetrics.com/support" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, "x-api-id": "sm-management-api", "x-audience": "public" }, "servers": [ { "url": "https://api.supermetrics.com/v2", "description": "Global production public Supermetrics Management API base path.", "x-internal": false }, { "url": "https://api.supermetrics.com", "description": "Global production public Supermetrics API base path (for Connector Builder and Team endpoints).", "x-internal": false } ], "tags": [ { "name": "API Keys", "description": "Manage API keys to access Supermetrics API" }, { "name": "Saved Queries", "description": "Manage queries saved in Query Manager" }, { "name": "Datasources", "description": "Retrieve datasource configuration details" }, { "name": "Data Source Logins", "description": "Access your data source authentications and login links" }, { "name": "Custom Fields", "description": "Create and manage Custom Fields" }, { "name": "Account Tags", "description": "Group data source accounts into reusable tags" }, { "name": "Data Blending", "description": "Create and manage Data Blending" }, { "name": "Connector Builder", "description": "Create and manage custom connectors, including their secrets, logos, logs, and schemas" }, { "name": "Teams", "description": "View and update team details" }, { "name": "Team Users", "description": "Manage members and invitations for your team" }, { "name": "Team Licenses", "description": "Assign and manage your team's licenses" }, { "name": "Team Settings", "description": "Configure general settings for your team" }, { "name": "Workspaces", "description": "Create and manage workspaces, their members, and license pools" }, { "name": "Data Transfers", "description": "Create, configure, and manage Data Warehouse transfers, their runs, backfills, and data source connections" }, { "name": "Data Destinations", "description": "Create, configure, and manage Data Warehouse destinations" }, { "name": "Table Groups", "description": "Manage your team's table groups" } ], "externalDocs": { "description": "Find out more about Supermetrics Management API", "url": "https://docs.supermetrics.com/apidocs/management-api" }, "paths": { "/table/group/{group_id}": { "servers": [ { "url": "https://api.supermetrics.com/enterprise/v2", "description": "Global production public Supermetrics Data Warehouse Table Groups API base path.", "x-internal": false } ], "parameters": [ { "name": "group_id", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 50, "pattern": "^[A-Za-z0-9_-]+$" }, "description": "Supermetrics table group ID (prefixed, e.g. tg_123)" } ], "put": { "summary": "Edit table group", "description": "Update an existing table group's definition (full replace).\nThe request body uses the same `{version, group, tables, fields}` structure that Import accepts and Export returns, so the natural workflow is export → edit → PUT.\n\nThis is a full replace — all tables and fields must be provided. Omitting `fields` clears all field mappings. Tables and fields are matched to existing records by name. Renaming a table or field is equivalent to removing the old one and adding a new one — the old table's settings and query filter linkage are lost.\n\nThe `ignore_errors` and `ds_settings` properties are not yet supported on this endpoint and will be rejected with 422 if present.\n", "operationId": "editTableGroup", "tags": [ "Table Groups" ], "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "description": "Full table group definition to replace the existing one", "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "version", "group", "tables" ], "properties": { "version": { "type": "integer", "format": "int32", "minimum": 1, "maximum": 100, "description": "Data model version for the received data" }, "group": { "$ref": "#/components/schemas/TableGroupImport" }, "tables": { "type": "array", "maxItems": 1000, "description": "List of table objects", "items": { "$ref": "#/components/schemas/TableDefinition" } }, "fields": { "type": "array", "maxItems": 10000, "description": "List of field objects. Omitting this property clears all field mappings (full replace).", "items": { "$ref": "#/components/schemas/FieldDefinition" } } } }, "example": { "version": 1, "group": { "group_name": "Marketing Analytics Updated", "ds_id": "GAWA", "table_prefix": "MKT" }, "tables": [ { "table_name": "SESSIONS", "table_partition": "date", "fields": [ "session_id", "date", "users" ] }, { "table_name": "PAGEVIEWS", "table_partition": "date", "fields": [ "date", "page_path", "pageviews" ] } ], "fields": [ { "field_id": "session_id", "target_name": "session_id" }, { "field_id": "date", "target_name": "session_date" }, { "field_id": "users", "target_name": "user_count" }, { "field_id": "page_path", "target_name": "page_path" }, { "field_id": "pageviews", "target_name": "page_views" } ] } } } }, "responses": { "200": { "description": "Table group updated successfully", "headers": { "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableGroupWriteResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/TableGroupNotFound" }, "422": { "$ref": "#/components/responses/UnprocessableEntity" }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "components": { "schemas": { "TableGroupImport": { "type": "object", "required": [ "group_name", "ds_id" ], "properties": { "group_name": { "type": "string", "maxLength": 255, "description": "Table group name" }, "ds_id": { "type": "string", "maxLength": 50, "description": "Data source ID" }, "table_prefix": { "type": "string", "maxLength": 15, "description": "Prefix to table names. Enforced into upper snake case. Maximum length is 15 characters. Appended with an underscore." } } }, "TableDefinition": { "type": "object", "required": [ "table_name", "fields" ], "properties": { "table_name": { "type": "string", "maxLength": 255, "description": "Table name. Enforced into upper snake case." }, "table_partition": { "type": "string", "maxLength": 50, "description": "Table partition. Either date or none.", "enum": [ "date", "none" ], "default": "date" }, "report_type": { "type": "string", "nullable": true, "maxLength": 255, "description": "Data source report type. Required for some data sources." }, "fields": { "type": "array", "maxItems": 1000, "description": "List of field IDs for the table", "items": { "type": "string", "maxLength": 100 } } } }, "FieldDefinition": { "type": "object", "required": [ "field_id" ], "properties": { "field_id": { "type": "string", "maxLength": 100, "description": "Field ID that appears in one of the table objects" }, "field_name": { "type": "string", "maxLength": 255, "description": "Data source field name", "readOnly": true }, "display_name": { "type": "string", "maxLength": 255, "description": "Field display name", "readOnly": true }, "target_name": { "type": "string", "maxLength": 255, "description": "Field name in target table. Defaults to field ID in lower snake case." }, "data_type": { "type": "string", "maxLength": 100, "description": "Field data type", "readOnly": true } } }, "TableGroupWriteResponse": { "type": "object", "description": "Flat response returned by import and edit endpoints.", "properties": { "@type": { "type": "string", "enum": [ "table_group" ] }, "group_id": { "type": "string", "maxLength": 50, "description": "Supermetrics table group ID (prefixed, e.g. tg_123)" }, "group_name": { "type": "string", "maxLength": 255, "description": "Table group name" }, "links": { "type": "object", "properties": { "enclosure": { "$ref": "#/components/schemas/ResourceURL" } } } } }, "ResourceURL": { "type": "object", "properties": { "href": { "type": "string", "maxLength": 500, "description": "Full URL to the resource" } } }, "ErrorResponse": { "type": "object", "description": "Standard envelope returned by all error (4xx/5xx) responses.", "properties": { "meta": { "$ref": "#/components/schemas/Meta" }, "error": { "$ref": "#/components/schemas/Error" } }, "required": [ "meta", "error" ], "additionalProperties": false }, "Meta": { "type": "object", "description": "Metadata included in every API response.", "properties": { "request_id": { "$ref": "#/components/schemas/RequestId" } }, "required": [ "request_id" ], "additionalProperties": false }, "Error": { "type": "object", "description": "Machine- and human-readable detail for a failed request.", "properties": { "code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$", "maxLength": 100, "description": "Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on `message`. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.", "example": "BAD_REQUEST" }, "message": { "type": "string", "maxLength": 255, "pattern": "^.+$", "description": "Short, human-readable summary of the error.", "example": "The request was invalid." }, "description": { "type": "string", "maxLength": 2048, "description": "Optional longer explanation specific to this occurrence.", "example": "The field 'display_name' must not be empty." } }, "required": [ "code", "message" ], "additionalProperties": false }, "RequestId": { "type": "string", "description": "Unique identifier for the request, for tracking and debugging.", "pattern": "^[A-Za-z0-9_-]+$", "minLength": 8, "maxLength": 64, "example": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN", "x-faker": { "random.alphaNumeric": 30 } } }, "headers": { "Access-Control-Allow-Origin": { "description": "CORS header", "schema": { "type": "string", "maxLength": 255, "enum": [ "*" ], "example": "*" } }, "X-RateLimit-Limit": { "description": "Request limit per hour", "schema": { "type": "integer", "format": "int32", "minimum": 1, "maximum": 10000, "example": 5000 } }, "X-RateLimit-Remaining": { "description": "Remaining requests in current window", "schema": { "type": "integer", "format": "int32", "minimum": 0, "maximum": 10000, "example": 4999 } }, "WWW-Authenticate": { "description": "Bearer token required", "schema": { "type": "string", "maxLength": 255, "pattern": "^Bearer.*" } }, "Retry-After": { "description": "Seconds until rate limit resets", "schema": { "type": "integer", "format": "int32", "minimum": 1, "maximum": 86400, "example": 3600 } } }, "responses": { "BadRequest": { "description": "Bad request - invalid parameters", "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "BAD_REQUEST", "message": "The request was invalid." } } } } }, "Unauthorized": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "$ref": "#/components/headers/WWW-Authenticate" }, "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "UNAUTHORIZED", "message": "Authentication is required." } } } } }, "Forbidden": { "description": "Access forbidden", "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "FORBIDDEN", "message": "You do not have access to this resource." } } } } }, "TableGroupNotFound": { "description": "Table Group Not Found", "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "maxLength": 100, "enum": [ "TABLE_GROUP_NOT_FOUND" ] }, "message": { "type": "string", "maxLength": 255 } } } } } }, "UnprocessableEntity": { "description": "Unprocessable Entity - validation failed for the request parameters", "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "UNPROCESSABLE_ENTITY", "message": "Validation failed for the request parameters." } } } } }, "TooManyRequests": { "description": "Too Many Requests", "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "Retry-After": { "$ref": "#/components/headers/Retry-After" }, "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "TOO_MANY_REQUESTS", "message": "Rate limit exceeded. Retry later." } } } } }, "InternalServerError": { "description": "Internal server error", "headers": { "Access-Control-Allow-Origin": { "$ref": "#/components/headers/Access-Control-Allow-Origin" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "meta": { "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN" }, "error": { "code": "INTERNAL_SERVER_ERROR", "message": "An unexpected error occurred." } } } } } }, "securitySchemes": { "ApiKeyAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API_KEY", "description": "API key authentication. Create API keys in the Supermetrics Hub and send\nthem in the Authorization header:\n`Authorization: Bearer `\n" } } } } ````