Write a key
Last updated Oct 12, 2026
Last updated Oct 12, 2026
PUT
https://api.emberline.example/v4 /accounts/{account_id}/kv/{namespace_id}/values/{key} OpenAPI specParameters
account_idstringpathrequirednamespace_idstringpathrequiredkeystringpathrequiredexpiration_ttlintegerqueryRequest body text/plain
"string"
Code samples
cURL
curl -X PUT "https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=" \
-H "Content-Type: text/plain" \
-d '"string"'TypeScript
const res = await fetch('https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=', {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
body: JSON.stringify("string"),
});
const data = await res.json();Python
import requests
res = requests.request(
"PUT",
"https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=",
headers={
"Content-Type": "text/plain",
},
json="string",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("PUT", "https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=", strings.NewReader(`"string"`))
req.Header.Set("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: text/plain']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '"string"');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl=')
req = Net::HTTP::Put.new(uri)
req['Content-Type'] = 'text/plain'
req.body = '"string"'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emberline.example/v4/accounts/{account_id}/kv/{namespace_id}/values/{key}?expiration_ttl="))
.header("Content-Type", "text/plain")
.method("PUT", BodyPublishers.ofString("\"string\""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
200 Written
Was this helpful?