---
title: "Remove all key-value pairs in a collection"
method: PUT
path: "/_fabric/{fabric}/_api/kv/{collection}/truncate"
tags: ["Key Value"]
---

# Remove all key-value pairs in a collection

`PUT /_fabric/{fabric}/_api/kv/{collection}/truncate`

## 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/kv/:collection/truncate/put.ts> (a function with typed inputs; its response is checked against the schema)

Remove all key-value pairs in a collection.

## Path parameters

- `fabric` string, string, required
- `collection` string, string, required

## Query parameters

- `groupID` string, string

## Response `200`

Successfully removed all key-value entries.

- KvCollectionExamplesRc200
  - `code` integer: HTTP response code.
  - `error` boolean, required: Flag if there is an error in response. *False* for this response.
  - `name` string: It shows name of the collection.

## Other responses

- `404`: Failed to find specified fabric or 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)
