Skip to main content
PUT
/
store
/
items
Store or update an item.
curl --request PUT \
  --url https://api.example.com/store/items \
  --header 'Content-Type: application/json' \
  --data '
{
  "namespace": [
    "<string>"
  ],
  "key": "<string>",
  "value": {},
  "index": false,
  "ttl": null
}
'
import requests

url = "https://api.example.com/store/items"

payload = {
    "namespace": ["<string>"],
    "key": "<string>",
    "value": {},
    "index": False,
    "ttl": None
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({namespace: ['<string>'], key: '<string>', value: {}, index: false, ttl: null})
};

fetch('https://api.example.com/store/items', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/store/items",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'namespace' => [
        '<string>'
    ],
    'key' => '<string>',
    'value' => [
        
    ],
    'index' => false,
    'ttl' => null
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/store/items"

	payload := strings.NewReader("{\n  \"namespace\": [\n    \"<string>\"\n  ],\n  \"key\": \"<string>\",\n  \"value\": {},\n  \"index\": false,\n  \"ttl\": null\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.example.com/store/items")
  .header("Content-Type", "application/json")
  .body("{\n  \"namespace\": [\n    \"<string>\"\n  ],\n  \"key\": \"<string>\",\n  \"value\": {},\n  \"index\": false,\n  \"ttl\": null\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/store/items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"namespace\": [\n    \"<string>\"\n  ],\n  \"key\": \"<string>\",\n  \"value\": {},\n  \"index\": false,\n  \"ttl\": null\n}"

response = http.request(request)
puts response.read_body
{
  "detail": "<string>"
}

Body

application/json

Request to store or update an item.

namespace
string[]
required

A list of strings representing the namespace path.

key
string
required

The unique identifier for the item within the namespace.

value
Value · object
required

A dictionary containing the item's data.

index

Controls search indexing - null (use defaults), false (disable), or list of field paths to index.

Available options:
false
ttl
number | null

Optional time-to-live in minutes for the item, or null for no expiration.

Response

Success