Skip to content

Set record

POST /v4/storage/{storage}/key?key={key}

Set a single record. The path parameter storage specifies the namespace name, and the query parameter key specifies the record key.

Request Body

The raw content to store, sent as application/octet-stream.

Response schema

FieldTypeDescription
txinteger<int64>Transaction ID of the write operation.
durationstringTime taken to process the request, returned in a human-readable format (e.g., "1.234567ms").

Example

sh
curl --location 'https://api.litebase.io/v4/storage/sample/key?key=city:1' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $LITEBASE_API_KEY" \
--data '{
    "name": "Braavos"
}'

Response:

json
HTTP/1.1 200 OK
Content-Type: application/json

{
    "tx": 1,
    "duration": "1.234567ms"
}