---
updatedAt: 2026-08-26T11:11:10.000Z
agentTools:
  projectIndex: https://docs.cast.ai/llms.txt
---

# Batch create MySQL table metadata from collector

Batch create MySQL table metadata

 Stores MySQL table metadata that is used to identify index optimization opportunities

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://api.cast.ai/",
      "description": "US endpoint"
    },
    {
      "url": "https://api.eu.cast.ai/",
      "description": "EU endpoint"
    }
  ],
  "info": {
    "title": "Database Optimizer",
    "version": "0.0.1"
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/database-optimizer/index-advisor/v1alpha/organizations/{organizationId}/cache-groups/{cacheGroupId}/databases/{databaseName}/mysql-table-metadata:batchCreate": {
      "post": {
        "tags": [
          "TableMetadataAPI"
        ],
        "summary": "Batch create MySQL table metadata from collector",
        "description": "Batch create MySQL table metadata\n\n Stores MySQL table metadata that is used to identify index optimization opportunities",
        "operationId": "TableMetadataAPI_BatchCreateMySQLTablesMetadata",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization identifier",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cacheGroupId",
            "in": "path",
            "description": "Cache group ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "databaseName",
            "in": "path",
            "description": "Database name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateMySQLTablesMetadataRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCreateMySQLTablesMetadataResponse"
                }
              }
            }
          },
          "default": {
            "description": "Default error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "BatchCreateMySQLTablesMetadataRequest": {
        "required": [
          "organizationId",
          "cacheGroupId",
          "databaseName",
          "requests"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "description": "Organization identifier"
          },
          "cacheGroupId": {
            "type": "string",
            "description": "Cache group ID"
          },
          "databaseName": {
            "type": "string",
            "description": "Database name"
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MySQLTableMetadata"
            },
            "description": "The request messages specifying the table metadata to create.\n A maximum of 100 items can be created in a batch."
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RequestMetadata"
              }
            ],
            "description": "Request metadata"
          },
          "databaseVersion": {
            "type": "string",
            "description": "Database server version"
          }
        },
        "description": "Request to batch create MySQL table metadata"
      },
      "BatchCreateMySQLTablesMetadataResponse": {
        "type": "object",
        "properties": {},
        "description": "Response from batch creating MySQL table metadata"
      },
      "GoogleProtobufAny": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string",
            "description": "The type of the serialized message."
          }
        },
        "additionalProperties": true,
        "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message."
      },
      "MySQLTableMetadata": {
        "required": [
          "schemaName",
          "tableName",
          "dataSizeBytes",
          "indexSizeBytes"
        ],
        "type": "object",
        "properties": {
          "schemaName": {
            "type": "string",
            "description": "Name of schema for the table"
          },
          "tableName": {
            "type": "string",
            "description": "Name of the table"
          },
          "dataSizeBytes": {
            "type": "string",
            "description": "Data size in bytes (from DATA_LENGTH)"
          },
          "indexSizeBytes": {
            "type": "string",
            "description": "Index size in bytes (from INDEX_LENGTH)"
          }
        },
        "description": "MySQL table metadata for a table"
      },
      "RequestMetadata": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Request ID for tracing"
          },
          "clientVersion": {
            "type": "string",
            "description": "Client version information"
          },
          "collectorId": {
            "type": "string",
            "description": "Collection source identifier"
          },
          "source": {
            "type": "string",
            "description": "Request source information"
          }
        },
        "description": "Request metadata for tracing"
      },
      "Status": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleProtobufAny"
            },
            "description": "A list of messages that carry the error details.  There is a common set of message types for APIs to use."
          }
        },
        "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)."
      }
    }
  },
  "tags": [
    {
      "name": "TableMetadataAPI",
      "description": "TableMetadataAPI provides operations for managing table metadata"
    }
  ]
}
```