---
title: "Create skip list"
method: POST
path: "/_fabric/{fabric}/_api/index/skiplist"
tags: ["Indexes"]
---

# Create skip list

`POST /_fabric/{fabric}/_api/index/skiplist`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/index/skiplist/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a hash index.

**Note**:
- In a sparse index all documents are excluded from the index that do not contain at least one of the specified index attributes (i.e. *fields*) or that have a value of *null* in any of the specified index attributes. Such documents are not indexed and are not taken into account for uniqueness checks if the *unique* flag is set.
- In a non-sparse index, these documents are indexed (for non-present indexed attributes, a value of *null* is used) and are taken into account for uniqueness checks if the *unique* flag is set.
- Unique indexes on non-shard keys are not supported in a cluster.

## Path parameters

- `fabric` string, string, required

## Query parameters

- `collection` string, required

## Request body

- ApiIndexSkiplist
  - `deduplicate` boolean: If *false*, the deduplication of array values is turned off.
  - `fields` string[]: An array of attribute paths.
  - `sparse` boolean: *True* to create a sparse index.
  - `type` string, required: Must be equal to *"skiplist"*.
  - `unique` boolean: *True* to create a unique index.

## Response `200`

Successfully fetched existing skiplist index.

- ApiIndexPostSkiplistHttpExamplesRc200
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `fields` string[]: HTTP response code.
  - `id` string: Index identifier.
  - `name` string: Name of the index.
  - `selectivityEstimate` number: The selectivity estimate of index.
  - `sparse` boolean: *True* if index is sparse type.
  - `type` string: Index type.
  - `unique` boolean: *True* if index is unique.

## Other responses

- `201`: Successfully created skiplist index.
- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `403`: Failed because you do not have access to the server.
- `404`: Failed to find specified collection.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
