# Key-Value Store See the [Key-Value Database Storage Knowledge Base](https://knowledge.pricefx.com/space/KB/3130624547/Key-Value+Database+Storage) article for more details. ## Create a KV Table - [POST /kvservice.createtable/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.createtable.md): Creates a table in the Key-Value Database Storage. ## Drop a KV Table - [POST /kvservice.droptable/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.droptable.md): Drops (deletes) a table in the Key-Value Database Storage. ## List KV Tables - [GET /kvservice.listtables](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/get-kvservice.listtables.md): Retrieves a list of tables in the Key-Value Database. ## Insert Bulk KV Data - [POST /kvservice.loaddata/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.loaddata-tablename.md): Inserts bulk data to the Key-Value Store. Existing Primary Key combos are overwritten automatically. This is the only command where you explicitly have to specify the automatic “payload” column. While technically you could put any text into that column, other endpoints and Groovy perform JSON conversions (e.g. return a proper map) when you perform key lookups. So inserting a valid JSON into payload is highly recommended! ## Search a KV Table - [POST /kvservice.fetch/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.fetch-tablename.md): Returns records that match the search criteria. ## Upsert a Key - [POST /kvservice.putkey/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.putkey.md): Inserts a new key to the table or updates the existing one. ## Get a Table Info - [GET /kvservice.describetable/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/get-kvservice.describetable-tablename.md): Retrieves primary keys, column names, column types, and indexes of the specified table. ## Get a Key - [POST /kvservice.fetchkey/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.fetchkey-tablename.md): Retrieves the payload from the table with the specified key. The request must contain key/value pairs for all primary keys as defined in table. ## Count Keys - [GET /kvservice.count/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/get-kvservice.count-tablename.md): Retrieves the number of keys in the specified table. ## Truncate a Table - [GET /kvservice.truncate/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/get-kvservice.truncate-tablename.md): Truncates the table; removes all key values from the table. Table structure (primary keys, columns, indexes) remains. ## Delete a Key - [POST /kvservice.removekey/{tableName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/key-value-store/post-kvservice.removekey-tablename.md): Removes a value based on the primary key match – the request must contain all table's primary keys (see the request example).