---
title: "POST /v2/{+parent}/tables"
method: POST
path: "/v2/{+parent}/tables"
tags: ["projects"]
---

# POST /v2/{+parent}/tables

`POST /v2/{+parent}/tables`

Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.

## Path parameters

- `parent` string, required

## Request body

- CreateTableRequest — Request message for google.bigtable.admin.v2.BigtableTableAdmin.CreateTable
  - `table` Table — A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster.
    - `name` string — The unique name of the table. Values are of the form `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`. Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `STATS_VIEW`, `FULL`
    - `automatedBackupPolicy` AutomatedBackupPolicy — Defines an automated backup policy for a table
      - `locations` string[] — Optional. A list of Cloud Bigtable zones where automated backups are allowed to be created. If empty, automated backups will be created in all zones of the instance. Locations are in the format `projects/{project}/locations/{zone}`. You can set this field only for tables in Enterprise Plus instances.
      - `frequency` string, google-duration — How frequently automated backups should occur. The only supported value at this time is 24 hours. An undefined frequency is treated as 24 hours.
      - `retentionPeriod` string, google-duration — Required. How long the automated backups should be retained. Values must be at least 3 days and at most 90 days.
    - `changeStreamConfig` ChangeStreamConfig — Change stream configuration.
      - `retentionPeriod` string, google-duration — How long the change stream should be retained. Change stream data older than the retention period will not be returned when reading the change stream from the table. Values must be at least 1 day and at most 7 days, and will be truncated to microsecond granularity.
    - `tieredStorageConfig` TieredStorageConfig — Config for tiered storage. A valid config must have a valid TieredStorageRule. Otherwise the whole TieredStorageConfig must be unset. By default all data is stored in the SSD tier (only SSD instances can configure tiered storage).
      - `infrequentAccess` TieredStorageRule — Rule to specify what data is stored in a storage tier.
        - `includeIfOlderThan` string, google-duration — Include cells older than the given age. For the infrequent access tier, this value must be at least 30 days.
    - `stats` TableStats — Approximate statistics related to a table. These statistics are calculated infrequently, while simultaneously, data in the table can change rapidly. Thus the values reported here (e.g. row count) are very likely out-of date, even the instant they are received in this API. Thus, only treat these values as approximate. IMPORTANT: Everything below is approximate, unless otherwise specified.
      - `rowCount` string, int64 — How many rows are in the table.
      - `averageColumnsPerRow` number, double — How many (column family, column qualifier) combinations are present per row in the table, averaged over all rows in the table. e.g. A table with 2 rows: * A row with cells in "family:col" and "other:col" (2 distinct columns) * A row with cells in "family:col", "family:other_col", and "other:data" (3 distinct columns) would report (2 + 3)/2 = 2.5 in this field.
      - `logicalDataBytes` string, int64 — This is roughly how many bytes would be needed to read the entire table (e.g. by streaming all contents out).
      - `averageCellsPerColumn` number, double — How many cells are present per column (column family, column qualifier) combinations, averaged over all columns in all rows in the table. e.g. A table with 2 rows: * A row with 3 cells in "family:col" and 1 cell in "other:col" (4 cells / 2 columns) * A row with 1 cell in "family:col", 7 cells in "family:other_col", and 7 cells in "other:data" (15 cells / 3 columns) would report (4 + 15)/(2 + 3) = 3.8 in this field.
    - `rowKeySchema` GoogleBigtableAdminV2TypeStruct — A structured data value, consisting of fields which map to dynamically typed values. Values of type `Struct` are stored in `Value.array_value` where entries are in the same order and number as `field_types`.
      - `fields` GoogleBigtableAdminV2TypeStructField[] — The names and types of the fields in this struct.
        - `fieldName` string — The field name (optional). Fields without a `field_name` are considered anonymous and cannot be referenced by name.
        - `type` Type — `Type` represents the type of data that is written to, read from, or stored in Bigtable. It is heavily based on the GoogleSQL standard to help maintain familiarity and consistency across products and features. For compatibility with Bigtable's existing untyped APIs, each `Type` includes an `Encoding` which describes how to convert to or from the underlying data. Each encoding can operate in one of two modes: - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)` if and only if `X <= Y`. This is useful anywhere sort order is important, for example when encoding keys. - Distinct: In this mode, Bigtable guarantees that if `X != Y` then `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For example, both `{'foo': '1', 'bar': '2'}` and `{'bar': '2', 'foo': '1'}` are valid encodings of the same JSON value. The API clearly documents which mode is used wherever an encoding can be configured. Each encoding also documents which values are supported in which modes. For example, when encoding INT64 as a numeric STRING, negative numbers cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001")`.
          - `float64Type` GoogleBigtableAdminV2TypeFloat64 — Float64 Values of type `Float64` are stored in `Value.float_value`.
          - `dateType` GoogleBigtableAdminV2TypeDate — Date Values of type `Date` are stored in `Value.date_value`.
          - `structType` GoogleBigtableAdminV2TypeStruct — recursive
          - `protoType` GoogleBigtableAdminV2TypeProto — A protobuf message type. Values of type `Proto` are stored in `Value.bytes_value`.
            - `schemaBundleId` string — The ID of the schema bundle that this proto is defined in.
            - `messageName` string — The fully qualified name of the protobuf message, including package. In the format of "foo.bar.Message".
          - `bytesType` GoogleBigtableAdminV2TypeBytes — Bytes Values of type `Bytes` are stored in `Value.bytes_value`.
            - `encoding` GoogleBigtableAdminV2TypeBytesEncoding — Rules used to convert to or from lower level types.
              - …
          - `int64Type` GoogleBigtableAdminV2TypeInt64 — Int64 Values of type `Int64` are stored in `Value.int_value`.
            - `encoding` GoogleBigtableAdminV2TypeInt64Encoding — Rules used to convert to or from lower level types.
              - …
          - `arrayType` GoogleBigtableAdminV2TypeArray — An ordered list of elements of a given type. Values of type `Array` are stored in `Value.array_value`.
            - `elementType` Type — recursive
          - `int32Type` GoogleBigtableAdminV2TypeInt32 — Int32 Values of type `Int32` are stored in `Value.int_value`.
            - `encoding` GoogleBigtableAdminV2TypeInt32Encoding — Rules used to convert to or from lower level types.
              - …
          - `mapType` GoogleBigtableAdminV2TypeMap — A mapping of keys to values of a given type. Values of type `Map` are stored in a `Value.array_value` where each entry is another `Value.array_value` with two elements (the key and the value, in that order). Normally encoded Map values won't have repeated keys, however, clients are expected to handle the case in which they do. If the same key appears multiple times, the _last_ value takes precedence.
            - `valueType` Type — recursive
            - `keyType` Type — recursive
          - `aggregateType` GoogleBigtableAdminV2TypeAggregate — A value that combines incremental updates into a summarized value. Data is never directly written or read using type `Aggregate`. Writes provide either the `input_type` or `state_type`, and reads always return the `state_type` .
            - `inputType` Type — recursive
            - `hllppUniqueCount` GoogleBigtableAdminV2TypeAggregateHyperLogLogPlusPlusUniqueCount — Computes an approximate unique count over the input values. When using raw data as input, be careful to use a consistent encoding. Otherwise the same value encoded differently could count more than once, or two distinct values could count as identical. Input: Any, or omit for Raw State: TBD Special state conversions: `Int64` (the unique count estimate)
            - `sum` GoogleBigtableAdminV2TypeAggregateSum — Computes the sum of the input values. Allowed input: `Int64` State: same as input
            - `stateType` Type — recursive
            - `max` GoogleBigtableAdminV2TypeAggregateMax — Computes the max of the input values. Allowed input: `Int64` State: same as input
            - `min` GoogleBigtableAdminV2TypeAggregateMin — Computes the min of the input values. Allowed input: `Int64` State: same as input
          - `stringType` GoogleBigtableAdminV2TypeString — String Values of type `String` are stored in `Value.string_value`.
            - `encoding` GoogleBigtableAdminV2TypeStringEncoding — Rules used to convert to or from lower level types.
              - …
          - `enumType` GoogleBigtableAdminV2TypeEnum — A protobuf enum type. Values of type `Enum` are stored in `Value.int_value`.
            - `schemaBundleId` string — The ID of the schema bundle that this enum is defined in.
            - `enumName` string — The fully qualified name of the protobuf enum message, including package. In the format of "foo.bar.EnumMessage".
          - `boolType` GoogleBigtableAdminV2TypeBool — bool Values of type `Bool` are stored in `Value.bool_value`.
            - `encoding` GoogleBigtableAdminV2TypeBoolEncoding — Defines rules used to convert to or from lower level types.
          - `timestampType` GoogleBigtableAdminV2TypeTimestamp — Timestamp Values of type `Timestamp` are stored in `Value.timestamp_value`.
            - `encoding` GoogleBigtableAdminV2TypeTimestampEncoding — Rules used to convert to or from lower level types.
              - …
          - `geographyType` GoogleBigtableAdminV2TypeGeography — A geography type, representing a point or region on Earth. The value is stored in `Value.bytes_value` as Well-Known Binary (WKB) bytes.
          - `float32Type` GoogleBigtableAdminV2TypeFloat32 — Float32 Values of type `Float32` are stored in `Value.float_value`.
      - `encoding` GoogleBigtableAdminV2TypeStructEncoding — Rules used to convert to or from lower level types.
        - `delimitedBytes` GoogleBigtableAdminV2TypeStructEncodingDelimitedBytes — Fields are encoded independently and concatenated with a configurable `delimiter` in between. A struct with no fields defined is encoded as a single `delimiter`. Sorted mode: - Fields are encoded in sorted mode. - Encoded field values must not contain any bytes <= `delimiter[0]` - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. - This encoding does not support `DESC` field ordering. Distinct mode: - Fields are encoded in distinct mode. - Encoded field values must not contain `delimiter[0]`.
          - `delimiter` string, byte — Byte sequence used to delimit concatenated fields. The delimiter must contain at least 1 character and at most 50 characters.
        - `singleton` GoogleBigtableAdminV2TypeStructEncodingSingleton — Uses the encoding of `fields[0].type` as-is. Only valid if `fields.size == 1`. This encoding does not support `DESC` field ordering.
        - `orderedCodeBytes` GoogleBigtableAdminV2TypeStructEncodingOrderedCodeBytes — Fields are encoded independently, then escaped and delimited by appling the following rules in order: - While the last remaining field is `ASC` or `UNSPECIFIED`, and encodes to the empty string "", remove it. - In each remaining field, replace all null bytes `0x00` with the fixed byte pair `{0x00, 0xFF}`. - If any remaining field encodes to the empty string "", replace it with the fixed byte pair `{0x00, 0x00}`. - Append the fixed byte pair `{0x00, 0x01}` to each remaining field, except for the last remaining field if it is `ASC`. - Bitwise negate all `DESC` fields. - Concatenate the results, or emit the fixed byte pair `{0x00, 0x00}` if there are no remaining fields to concatenate. Examples: ``` - STRUCT() -> "\00\00" - STRUCT("") -> "\00\00" - STRUCT("", "") -> "\00\00" - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" - STRUCT("A", "") -> "A" - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C" ``` Examples for struct with `DESC` fields: ``` - STRUCT("" DESC) -> "\xFF\xFF" + "\xFF\xFE" - STRUCT("" DESC, "") -> "\xFF\xFF" + "\xFF\xFE" - STRUCT("" DESC, "", "") -> "\xFF\xFF" + "\xFF\xFE" - STRUCT("" DESC, "A") -> "\xFF\xFF" + "\xFF\xFE" + "A" - STRUCT("A", "" DESC, "") -> "A" + "\00\01" + "\xFF\xFF" + "\xFF\xFE" - STRUCT("", "A" DESC) -> "\x00\x00" + "\x00\x01" + "\xBE" + "\xFF\xFE" ``` Since null bytes are always escaped, this encoding can cause size blowup for encodings like `Int64.BigEndianBytes` that are likely to produce many such bytes. Sorted mode: - Fields are encoded in sorted mode. - All values supported by the field encodings are allowed. - Fields with unset or `UNSPECIFIED` order are treated as `ASC`. - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. Distinct mode: - Fields are encoded in distinct mode. - All values supported by the field encodings are allowed.
    - `restoreInfo` RestoreInfo — Information about a table restore.
      - `sourceType` 'RESTORE_SOURCE_TYPE_UNSPECIFIED' | 'BACKUP' — The type of the restore source.
      - `backupInfo` BackupInfo — Information about a backup.
        - `endTime` string, google-datetime — Output only. This time that the backup was finished. Row data in the backup will be no newer than this timestamp.
        - `sourceBackup` string — Output only. Name of the backup from which this backup was copied. If a backup is not created by copying a backup, this field will be empty. Values are of the form: projects//instances//clusters//backups/
        - `startTime` string, google-datetime — Output only. The time that the backup was started. Row data in the backup will be no older than this timestamp.
        - `sourceTable` string — Output only. Name of the table the backup was created from.
        - `backup` string — Output only. Name of the backup.
    - `granularity` 'TIMESTAMP_GRANULARITY_UNSPECIFIED' | 'MILLIS' — Immutable. The granularity at which timestamps are stored in this table. Timestamps not matching the granularity will be rejected. If unspecified at creation time, the value will be set to `MILLIS`. Views: `SCHEMA_VIEW`, `FULL`.
    - `clusterStates` object — Output only. Map from cluster ID to per-cluster table state. If it could not be determined whether or not the table has data in a particular cluster (for example, if its zone is unavailable), then there will be an entry for the cluster with UNKNOWN `replication_status`. Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    - `columnFamilies` object — The column families configured for this table, mapped by column family ID. Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    - `deletionProtection` boolean — Set to true to make the table protected against data loss. i.e. deleting the following resources through Admin APIs are prohibited: * The table. * The column families in the table. * The instance containing the table. Note one can still delete the data stored in the table through Data APIs.
  - `tableId` string — Required. The name by which the new table should be referred to within the parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. Maximum 50 characters.
  - `initialSplits` Split[] — The optional list of row keys that will be used to initially split the table into several tablets (tablets are similar to HBase regions). Given two split keys, `s1` and `s2`, three tablets will be created, spanning the key ranges: `[, s1), [s1, s2), [s2, )`. Example: * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` `"other", "zz"]` * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` * Key assignment: - Tablet 1 `[, apple) => {"a"}.` - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - Tablet 4 `[customer_2, other) => {"customer_2"}.` - Tablet 5 `[other, ) => {"other", "zz"}.`
    - `key` string, byte — Row key to use as an initial tablet boundary.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/bigtableadmin.md) · [All operations](https://skmtc.net/google/apis/bigtableadmin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/bigtableadmin/versions/d59c83bbbf1e/schema)
