Skip to main content
POST
https://sandbox.getcollate.io/api
/
v1
/
searchIndexes
POST /v1/searchIndexes
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
from metadata.generated.schema.api.data.createSearchIndex import CreateSearchIndexRequest

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

request = CreateSearchIndexRequest(
    name="table_search_index",
    displayName="TableSearchIndex",
    service="elasticsearch_sample",
    description="Search index for table entities",
    fields=[
        {"name": "name", "dataType": "TEXT"},
        {"name": "description", "dataType": "TEXT"}
    ]
)

search_index = SearchIndexes.create(request)
print(f"Created: {search_index.fullyQualifiedName}")
{
  "id": "f5b0fa81-f241-4508-9219-dae31dcced18",
  "name": "table_search_index",
  "fullyQualifiedName": "elasticsearch_sample.table_search_index",
  "displayName": "TableSearchIndex",
  "version": 0.1,
  "updatedAt": 1769982670810,
  "updatedBy": "admin",
  "service": {
    "id": "search-service-id",
    "type": "searchService",
    "name": "elasticsearch_sample",
    "fullyQualifiedName": "elasticsearch_sample",
    "deleted": false
  },
  "serviceType": "ElasticSearch",
  "fields": [
    {"name": "name", "dataType": "TEXT"},
    {"name": "description", "dataType": "TEXT"}
  ],
  "deleted": false,
  "owners": [],
  "tags": [],
  "followers": [],
  "votes": {
    "upVotes": 0,
    "downVotes": 0
  },
  "domains": []
}

Create a Search Index

Create a new search index within a search service.

Body Parameters

name
string
required
Name of the search index. Must be unique within the parent search service.
service
string
required
Fully qualified name of the parent SearchService (e.g., elasticsearch_sample).
fields
array
Array of field objects defining the index schema.
displayName
string
Human-readable display name for the search index.
description
string
Description of the search index in Markdown format.
owners
array
Array of owner references (users or teams) to assign to the search index.
domain
string
Fully qualified name of the domain to assign for governance purposes.
tags
array
Array of classification tags to apply to the search index.
extension
object
Custom property values defined by your organization’s metadata schema.
POST /v1/searchIndexes
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
from metadata.generated.schema.api.data.createSearchIndex import CreateSearchIndexRequest

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

request = CreateSearchIndexRequest(
    name="table_search_index",
    displayName="TableSearchIndex",
    service="elasticsearch_sample",
    description="Search index for table entities",
    fields=[
        {"name": "name", "dataType": "TEXT"},
        {"name": "description", "dataType": "TEXT"}
    ]
)

search_index = SearchIndexes.create(request)
print(f"Created: {search_index.fullyQualifiedName}")
{
  "id": "f5b0fa81-f241-4508-9219-dae31dcced18",
  "name": "table_search_index",
  "fullyQualifiedName": "elasticsearch_sample.table_search_index",
  "displayName": "TableSearchIndex",
  "version": 0.1,
  "updatedAt": 1769982670810,
  "updatedBy": "admin",
  "service": {
    "id": "search-service-id",
    "type": "searchService",
    "name": "elasticsearch_sample",
    "fullyQualifiedName": "elasticsearch_sample",
    "deleted": false
  },
  "serviceType": "ElasticSearch",
  "fields": [
    {"name": "name", "dataType": "TEXT"},
    {"name": "description", "dataType": "TEXT"}
  ],
  "deleted": false,
  "owners": [],
  "tags": [],
  "followers": [],
  "votes": {
    "upVotes": 0,
    "downVotes": 0
  },
  "domains": []
}

Returns

Returns the created search index object with all specified properties and system-generated fields.

Response

id
string
Unique identifier for the search index (UUID format).
name
string
Search index name.
fullyQualifiedName
string
Fully qualified name in format service.indexName.
displayName
string
Human-readable display name.
description
string
Description of the search index in Markdown format.
service
object
Reference to the parent search service.
fields
array
Array of field definitions for the index schema.
serviceType
string
Type of search service (e.g., ElasticSearch, OpenSearch).
owners
array
List of owners assigned to the search index.
domains
array
Domain assignments for governance.
tags
array
Classification tags applied to the search index.
extension
object
Custom property values defined by your organization’s metadata schema.
version
number
Version number for the entity (starts at 0.1).

Create or Update (PUT)

Use PUT /v1/searchIndexes instead of POST to perform an upsert. If a search index with the same fullyQualifiedName already exists, it will be updated; otherwise, a new search index is created. The request body is the same as POST.
curl -X PUT "{base_url}/api/v1/searchIndexes" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
PUT will not return a 409 conflict error if the entity already exists — it will update the existing entity instead.

Bulk Create or Update (PUT)

Use PUT /v1/searchIndexes/bulk to create or update multiple search indexes in a single request. The request body is an array of create request objects.
curl -X PUT "{base_url}/api/v1/searchIndexes/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "index_one", "service": "elasticsearch_sample" },
    { "name": "index_two", "service": "elasticsearch_sample" }
  ]'

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid request body or missing required fields
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to create search indexes
409ENTITY_ALREADY_EXISTSSearch index with same name already exists in service (POST only)