Appearance
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
| Field | Type | Description |
|---|---|---|
| tx | integer<int64> | Transaction ID of the write operation. |
| duration | string | Time 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"
}