# Create

Launch stage: Public Preview

`POST /api/2.0/online-tables`

Create a new Online Table.

API scopes: unity-catalog

## Request body

- `table` (object, optional)
  Specification of the online table to be created.
  - `name` (string, optional)
    Full three-part (catalog, schema, table) name of the table.
  - `spec` (object, optional)
    Specification of the online table.
    - `run_continuously` (object, required)
      Pipeline runs continuously after generating the initial data.
    - `run_triggered` (object, required)
      Pipeline stops after generating the initial data and can be triggered later (manually, through a cron job or through data triggers)
    - `source_table_full_name` (string, optional)
      Three-part (catalog, schema, table) name of the source Delta table.
    - `primary_key_columns` (array of string, optional)
      Primary Key columns to be used for data insert/update in the destination.
    - `timeseries_key` (string, optional)
      Time series key to deduplicate (tie-break) rows with the same primary key.
    - `perform_full_copy` (boolean, optional)
      Whether to create a full-copy pipeline -- a pipeline that stops after creates a full copy of
       the source table upon initialization and does not process any change data feeds (CDFs)
       afterwards. The pipeline can still be manually triggered afterwards, but it always perform a
       full copy of the source table and there are no incremental updates. This mode is useful for
       syncing views or tables without CDFs to online tables.
       Note that the full-copy pipeline only supports "triggered" scheduling policy.
      Default: `false`
    - `pipeline_id` (string, optional)
      ID of the associated pipeline. Generated by the server - cannot be set by the caller.
  - `status` (object, optional)
    Online Table data synchronization status
    - `detailed_state` (string, optional)
      The state of the online table.
      Possible values: `ONLINE_TABLE_STATE_UNSPECIFIED`, `PROVISIONING`, `PROVISIONING_PIPELINE_RESOURCES`, `PROVISIONING_INITIAL_SNAPSHOT`, `ONLINE`, `ONLINE_CONTINUOUS_UPDATE`, `ONLINE_TRIGGERED_UPDATE`, `ONLINE_NO_PENDING_UPDATE`, `OFFLINE`, `OFFLINE_FAILED`, `ONLINE_PIPELINE_FAILED`, `ONLINE_UPDATING_PIPELINE_RESOURCES`
    - `message` (string, optional)
      A text description of the current state of the online table.
    - `provisioning_status` (object, required)
      - `initial_pipeline_sync_progress` (object, optional)
        Details about initial data synchronization. Only populated when in the
         PROVISIONING_INITIAL_SNAPSHOT state.
    - `continuous_update_status` (object, required)
      - `last_processed_commit_version` (int64, optional)
        The last source table Delta version that was synced to the online table. Note that this Delta
         version may not be completely synced to the online table yet.
      - `timestamp` (string, optional)
        The timestamp of the last time any data was synchronized from the source table to the online
         table.
      - `initial_pipeline_sync_progress` (object, optional)
        Progress of the initial data synchronization.
    - `triggered_update_status` (object, required)
      - `last_processed_commit_version` (int64, optional)
        The last source table Delta version that was synced to the online table. Note that this Delta
         version may not be completely synced to the online table yet.
      - `timestamp` (string, optional)
        The timestamp of the last time any data was synchronized from the source table to the online
         table.
      - `triggered_update_progress` (object, optional)
        Progress of the active data synchronization pipeline.
    - `failed_status` (object, required)
      - `last_processed_commit_version` (int64, optional)
        The last source table Delta version that was synced to the online table. Note that this Delta
         version may only be partially synced to the online table. Only populated if the table is still
         online and available for serving.
      - `timestamp` (string, optional)
        The timestamp of the last time any data was synchronized from the source table to the online
         table. Only populated if the table is still online and available for serving.
  - `table_serving_url` (string, optional)
    Data serving REST API URL for this table
  - `unity_catalog_provisioning_state` (string, optional)
    The provisioning state of the online table entity in Unity Catalog. This is distinct from the
     state of the data synchronization pipeline (i.e. the table may be in "ACTIVE" but the pipeline
     may be in "PROVISIONING" as it runs asynchronously).
    Possible values: `STATE_UNSPECIFIED`, `PROVISIONING`, `ACTIVE`, `FAILED`, `DELETING`, `UPDATING`, `DEGRADED`

## Returns

Returns the OnlineTable object.

## Response

```json
{
  "name": "string",
  "spec": {
    "run_continuously": {},
    "run_triggered": {},
    "source_table_full_name": "string",
    "primary_key_columns": [
      "string"
    ],
    "timeseries_key": "string",
    "perform_full_copy": true,
    "pipeline_id": "string"
  },
  "status": {
    "detailed_state": "string",
    "message": "string",
    "provisioning_status": {},
    "continuous_update_status": {},
    "triggered_update_status": {},
    "failed_status": {}
  },
  "table_serving_url": "string",
  "unity_catalog_provisioning_state": "string"
}
```

