Esc
ZeroIndex
GuidesAPI referenceSDKsChangelogOverviewBuy ZeroIndex

Create a key

View as MarkdownThe page as plain text

Create an admin or search key, limited to some indexes if you like. The full key is only shown once.

POST/v1/keys

Requires an admin key.

Body

namestringrequired

A label to recognise the key in the dashboard, like the app that uses it.

kindadmin | searchrequired

Admin keys can call every endpoint. Search keys can only search.

indexesstring[]default ["*"]

The indexes the key can reach.

Request

curl https://api.zeroindex.test/v1/keys \
  -H "Authorization: Bearer $ZEROINDEX_KEY" \
  -d '{ "name": "Storefront search", "kind": "search", "indexes": ["products"] }'
const key = await client.keys.create({
  name: "Storefront search",
  kind: "search",
  indexes: ["products"],
});
key = client.keys.create(name="Storefront search", kind="search", indexes=["products"])

Response

201
{
  "uid": "b3f1c9a2",
  "name": "Storefront search",
  "kind": "search",
  "key": "zi_search_7b1e04d6a3",
  "indexes": ["products"],
  "createdAt": "2026-10-08T09:30:11Z"
}