Set value (SDK)
curl --request PUT \
--url https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key} \
--header 'Content-Type: application/json' \
--data '
{
"value": {
"step": "checkout",
"items": 3
},
"ttl": 3600
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}"
payload = {
"value": {
"step": "checkout",
"items": 3
},
"ttl": 3600
}
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({value: {step: 'checkout', items: 3}, ttl: 3600})
};
fetch('https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}', 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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}",
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([
'value' => [
'step' => 'checkout',
'items' => 3
],
'ttl' => 3600
]),
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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}"
payload := strings.NewReader("{\n \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}")
.header("Content-Type", "application/json")
.body("{\n \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}")
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 \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\n}"
response = http.request(request)
puts response.read_bodyRuntime API - Key-Value Store
Set value (SDK)
Sets a value with optional TTL (seconds). The namespace is created implicitly on first write.
PUT
/
api
/
v1
/
runtime
/
v1
/
kv
/
{namespace}
/
item
/
{key}
Set value (SDK)
curl --request PUT \
--url https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key} \
--header 'Content-Type: application/json' \
--data '
{
"value": {
"step": "checkout",
"items": 3
},
"ttl": 3600
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}"
payload = {
"value": {
"step": "checkout",
"items": 3
},
"ttl": 3600
}
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({value: {step: 'checkout', items: 3}, ttl: 3600})
};
fetch('https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}', 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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}",
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([
'value' => [
'step' => 'checkout',
'items' => 3
],
'ttl' => 3600
]),
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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}"
payload := strings.NewReader("{\n \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\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.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}")
.header("Content-Type", "application/json")
.body("{\n \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/kv/{namespace}/item/{key}")
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 \"value\": {\n \"step\": \"checkout\",\n \"items\": 3\n },\n \"ttl\": 3600\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Value to store (any JSON-serializable value, max 256 KB). null is rejected — use DELETE to remove a key.
Example:
{ "step": "checkout", "items": 3 }Time-to-live in seconds. Omit for a persistent entry. Setting a value without ttl clears any previous TTL.
Required range:
x >= 1Example:
3600
Response
200
Value stored successfully.
⌘I