---
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

## Response `200`

Index description

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

## Other responses

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

## Changes

- **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`
- **2025-06-02** `60812f5416c5` — 2 info
  - api operation id `new_index` removed and replaced with `index_create`
  - removed the non-success response with the status `409`

[Change 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.dev/sourcenetwork/apis/defradb-api/revisions/225e710a6ad0?raw)
