# Create an AI Search index

Launch stage: Public Preview

`POST /api/2.0/ai-search/{parent=workspaces/*/endpoints/*}/indexes`

Create a new AI Search index.

API scopes: ai-search

## Path parameters

- `parent` (string, required)
  The Endpoint where this Index will be created.
   Format: `workspaces/{workspace_id}/endpoints/{endpoint_id}`

## Query parameters

- `index_id` (string, optional)
  The user-supplied Unity Catalog table name for the Index, per AIP-133. The server
   composes the full `Index.name` as `{parent}/indexes/{index_id}`. AIP-133 does not
   list `index_id` as a fields-may-be-required entry, so we annotate it OPTIONAL on the
   wire; the server still rejects empty values with INVALID_PARAMETER_VALUE.

## Request body

The Index resource to create. Fields other than `index.name` carry the desired
 configuration; `index.name` is server-assigned from `parent` and `index_id`.
- `name` (string, optional)
  Name of the AI Search index. Server-assigned full resource path
   (`workspaces/{workspace}/endpoints/{endpoint}/indexes/{index}`) on output, where
   `{index}` is the index's Unity Catalog table name. On create, the user-supplied UC
   table name is conveyed via `CreateIndexRequest.index_id`; the server composes the
   full `name` and returns it on the response.
  Example: `main.default.docs_index`
- `primary_key` (string, required, Immutable)
  Primary key of the index. Set on create and immutable thereafter.
- `index_type` (string, required, Immutable)
  Type of index. Required on create and immutable thereafter.
  Possible values:
  - `DELTA_SYNC`
  - `DIRECT_ACCESS`
- `direct_access_index_spec` (object, optional, Immutable)
  Specification for a Direct Access index. Set when `index_type` is `DIRECT_ACCESS`.
  - `embedding_vector_columns` (array of object, optional)
    The columns that contain the embedding vectors.
    - `name` (string, optional)
      Name of the column.
    - `embedding_dimension` (int32, optional)
      Dimension of the embedding vector.
  - `schema_json` (string, optional)
    The schema of the index in JSON format. Supported types are `integer`, `long`,
     `float`, `double`, `boolean`, `string`, `date`, `timestamp`. Supported types for
     vector columns: `array<float>`, `array<double>`.
  - `embedding_source_columns` (array of object, optional)
    The columns that contain the embedding source.
    - `name` (string, optional)
      Name of the source column.
    - `embedding_model_endpoint` (string, optional)
      Name of the embedding model endpoint, used by default for both ingestion and querying.
    - `model_endpoint_name_for_query` (string, optional)
      Name of the embedding model endpoint which, if specified, is used for querying (not ingestion).
- `delta_sync_index_spec` (object, optional, Immutable)
  Specification for a Delta Sync index. Set when `index_type` is `DELTA_SYNC`.
  - `source_table` (string, optional)
    The full name of the source Delta table.
  - `embedding_source_columns` (array of object, optional)
    The columns that contain the embedding source.
    - `name` (string, optional)
      Name of the source column.
    - `embedding_model_endpoint` (string, optional)
      Name of the embedding model endpoint, used by default for both ingestion and querying.
    - `model_endpoint_name_for_query` (string, optional)
      Name of the embedding model endpoint which, if specified, is used for querying (not ingestion).
  - `embedding_vector_columns` (array of object, optional)
    The columns that contain the embedding vectors.
    - `name` (string, optional)
      Name of the column.
    - `embedding_dimension` (int32, optional)
      Dimension of the embedding vector.
  - `embedding_writeback_table` (string, optional)
    [Optional] Name of the Delta table to sync the index contents and computed embeddings to.
  - `columns_to_sync` (array of string, optional)
    [Optional] Select the columns to sync with the index. If left blank, all columns
     from the source table are synced. The primary key column and embedding source or
     vector column are always synced.
  - `pipeline_type` (string, required)
    Pipeline execution mode. Required on create — the backend rejects an unset value.
     Storage Optimized endpoints accept only `TRIGGERED`; Standard endpoints accept both.
     No explicit `stage` — a REQUIRED field staged below its service would be dropped from
     combined specs while remaining in `required`, tripping the OpenAPI required-vs-properties
     consistency check. The field inherits the service's launch stage.
    Possible values:
    - `PIPELINE_TYPE_UNSPECIFIED`
    - `TRIGGERED`
    - `CONTINUOUS`
- `index_subtype` (string, optional, Immutable)
  The subtype of the index. Set on create and immutable thereafter.
  Possible values:
  - `VECTOR`
  - `FULL_TEXT`
  - `HYBRID`

## Returns

Returns the Index object.

## Response

```json
{
  "name": "main.default.docs_index",
  "endpoint": "docs-endpoint",
  "primary_key": "string",
  "index_type": "string",
  "direct_access_index_spec": {
    "embedding_vector_columns": [
      {}
    ],
    "schema_json": "string",
    "embedding_source_columns": [
      {}
    ]
  },
  "delta_sync_index_spec": {
    "source_table": "string",
    "embedding_source_columns": [
      {}
    ],
    "embedding_vector_columns": [
      {}
    ],
    "embedding_writeback_table": "string",
    "columns_to_sync": [
      "string"
    ],
    "pipeline_id": "string",
    "pipeline_type": "string"
  },
  "status": {
    "message": "string",
    "indexed_row_count": 0,
    "ready": true,
    "index_url": "string"
  },
  "creator": "john@example.com",
  "index_subtype": "string"
}
```

