---
title: "Create One Atlas Search Index"
method: POST
path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes"
tags: ["Atlas Search"]
---

# Create One Atlas Search Index

`POST /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes`

## Request

- Base URL: `https://cloud.mongodb.com`
- URL: `https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://cloud.mongodb.com/api/oauth/token`
  - HTTP digest

Creates one Atlas Search index on the specified collection. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. Only clusters running MongoDB v4.2 or later can use Atlas Search.

## Path parameters

- `groupId` string, required
- `clusterName` string, required

## Query parameters

- `envelope` boolean
- `pretty` boolean

## Request body

- SearchIndexCreateRequest
  - `collectionName` string, required: Label that identifies the collection to create an Atlas Search index in.
  - `database` string, required: Label that identifies the database that contains the collection to create an Atlas Search index in.
  - `name` string, required: Label that identifies this index. Within each namespace, names of all indexes in the namespace must be unique.
  - `type` 'search' | 'vectorSearch': Type of the index. The default type is search.

## Response `201`

Created

## Other responses

- `400`: Bad Request.
- `401`: Unauthorized.
- `403`: Forbidden.
- `404`: Not Found.
- `409`: Conflict.
- `429`: Too Many Requests.
- `500`: Internal Server Error.

---

[API](https://skmtc.dev/mongodb/apis/atlas-admin-api.md) - [All operations](https://skmtc.dev/mongodb/apis/atlas-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mongodb/apis/atlas-admin-api/revisions/e37e8ef8429f?raw)
