---
title: "POST /collections/{name}/indexes"
method: POST
path: "/collections/{name}/indexes"
tags: ["index"]
---

# POST /collections/{name}/indexes

`POST /collections/{name}/indexes`

Make a new secondary index

## Path parameters

- `name` string, required

## Request body

- NewIndex
  - `Fields` object[]
    - `Descending` boolean
    - `Name` string
  - `Name` string
  - `Unique` boolean
  - `Vector` object, nullable
    - `Algorithm` string
    - `Dimensions` integer
    - `HNSW` object, nullable
      - `EfConstruction` integer
      - `EfSearch` integer
      - `M` integer
    - `Metric` string

## Response `200`

Index description

- Index
  - `Fields` object[]
    - `Descending` boolean
    - `Name` string
  - `ID` integer
  - `Kind` integer
  - `KindDescription` unknown
  - `Name` string
  - `Unique` boolean

## Other responses

- `400` — error
- `409` — error

## Changes

- **2026-08-17** `cfa5d9c60093` — 3 info
  - added the new optional request property `Vector`
  - added the optional property `Kind` to the response with the `200` status
  - added the optional property `KindDescription` to the response with the `200` status
- **2026-03-30** `f46903303e53` — 1 info
  - added the non-success response with the status `409`
- **2026-03-02** `fb9bb5367209` — 1 info
  - api operation id `add_index` removed and replaced with `new_index`
- **2026-03-02** `8c167ee47363` — 1 info
  - api operation id `index_add` removed and replaced with `add_index`
- **2026-02-24** `598f4d25a175` — 1 info
  - api operation id `index_create` removed and replaced with `index_add`

[Full history](https://skmtc.dev/sourcenetwork/apis/defradb-api/changes/collections/:name/indexes/post.md)

---

[API](https://skmtc.dev/sourcenetwork/apis/defradb-api.md) · [All operations](https://skmtc.dev/sourcenetwork/apis/defradb-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sourcenetwork/defradb-api/revisions/872f0b47a5e5/schema)
