---
title: "Create a KV Table"
method: POST
path: "/kvservice.createtable/{tableName}"
tags: ["Key-Value Store"]
---

# Create a KV Table

`POST /kvservice.createtable/{tableName}`

Creates a table in the Key-Value Database Storage.

## Request body

- object
  - `data` object
    - `keys` object[]
      - `columnType` 'UUID' | 'TEXT' | 'INT' | 'TIMESTAMP' | 'DECIMAL' | 'DATE'
      - `columnName` string — A unique name of the column. Only lower case letters, numbers and underscores are allowed. Do not use special characters.
      - `isPrimaryKey` boolean — Sets the column as a primary key. A primary key uniquely identifies a column, so it can be used for a look up. At least one column must be set as a primary key.
      - `isIndexed` boolean — Additional non-Primary Key columns can be added for further filtering (you cannot filter on “payload”). If also fast lookup on these secondary columns is required they should be indexed. See also [Performance Considerations](https://knowledge.pricefx.com/configuration-engineer-knowledge-base/reference/groovy-api-functions/key-value-database-storage#Performance-Considerations).

## Response `200`

A general response that contains `data` property with a content depending on returned objects (e.g., Product master table fields when calling the `/fetch/P` endpoint). Can be `null`.

- object
  - `response` object
    - `node` string
    - `data` object, nullable
    - `status` integer
    - `startRow` integer
    - `endRow` integer

---

[API](https://skmtc.net/pricefx/apis/the-pricefx-backend-api.md) · [All operations](https://skmtc.net/pricefx/apis/the-pricefx-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pricefx/the-pricefx-backend-api/versions/0850b5d6be73/schema)
