# Store record


```
PUT 
https://api.apify.com/v2/key-value-stores/:storeId/records/:recordKey
```


Stores a value under a specific key to the key-value store.

The value is passed as the PUT payload and it is stored with a MIME content type defined by the `Content-Type` header and with encoding defined by the `Content-Encoding` header.

To save bandwidth, storage, and speed up your upload, send the request payload compressed with Gzip compression and add the `Content-Encoding: gzip` header. It is possible to set up another compression type with `Content-Encoding` request header.

Below is a list of supported `Content-Encoding` types.

* Gzip compression: `Content-Encoding: gzip`
* Deflate compression: `Content-Encoding: deflate`
* Brotli compression: `Content-Encoding: br`

## Request

### Path Parameters

* **storeId** string required

  Key-value store ID or `username~store-name`.

  **Example:** `WkzbQMuFYuamGv3YF`

  **recordKey** string required

  Key of the record.

  **Example:** `someKey`

### Header Parameters

* **Content-Encoding** string required

  **Possible values:** \[`gzip`]

  **Example:** `gzip`

### Body**required**

* **property name\*** any

  The request body contains the value to store in the record. The content type should be specified in the Content-Type header.

  **Example:** `{"message":"Hello, world!","count":42}`

### Status 201

**Response Headers**

* **Location**


```
{}
```


**Schema**

* **object** object

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
