Reconfigure Basin
curl --request PATCH \
--url https://api.example.com/basins/{basin} \
--header 'Content-Type: application/json' \
--data '
{
"default_stream_config": {
"storage_class": "<string>",
"retention_policy": {},
"timestamping": {
"mode": "<string>",
"uncapped": true
},
"delete_on_empty": {
"min_age_secs": 123
}
},
"create_stream_on_append": true,
"create_stream_on_read": true
}
'import requests
url = "https://api.example.com/basins/{basin}"
payload = {
"default_stream_config": {
"storage_class": "<string>",
"retention_policy": {},
"timestamping": {
"mode": "<string>",
"uncapped": True
},
"delete_on_empty": { "min_age_secs": 123 }
},
"create_stream_on_append": True,
"create_stream_on_read": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
default_stream_config: {
storage_class: '<string>',
retention_policy: {},
timestamping: {mode: '<string>', uncapped: true},
delete_on_empty: {min_age_secs: 123}
},
create_stream_on_append: true,
create_stream_on_read: true
})
};
fetch('https://api.example.com/basins/{basin}', 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/basins/{basin}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'default_stream_config' => [
'storage_class' => '<string>',
'retention_policy' => [
],
'timestamping' => [
'mode' => '<string>',
'uncapped' => true
],
'delete_on_empty' => [
'min_age_secs' => 123
]
],
'create_stream_on_append' => true,
'create_stream_on_read' => true
]),
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/basins/{basin}"
payload := strings.NewReader("{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/basins/{basin}")
.header("Content-Type", "application/json")
.body("{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/basins/{basin}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}"
response = http.request(request)
puts response.read_body{
"default_stream_config": {},
"create_stream_on_append": true,
"create_stream_on_read": true
}Basins
Reconfigure Basin
PATCH
/
basins
/
{basin}
Reconfigure Basin
curl --request PATCH \
--url https://api.example.com/basins/{basin} \
--header 'Content-Type: application/json' \
--data '
{
"default_stream_config": {
"storage_class": "<string>",
"retention_policy": {},
"timestamping": {
"mode": "<string>",
"uncapped": true
},
"delete_on_empty": {
"min_age_secs": 123
}
},
"create_stream_on_append": true,
"create_stream_on_read": true
}
'import requests
url = "https://api.example.com/basins/{basin}"
payload = {
"default_stream_config": {
"storage_class": "<string>",
"retention_policy": {},
"timestamping": {
"mode": "<string>",
"uncapped": True
},
"delete_on_empty": { "min_age_secs": 123 }
},
"create_stream_on_append": True,
"create_stream_on_read": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
default_stream_config: {
storage_class: '<string>',
retention_policy: {},
timestamping: {mode: '<string>', uncapped: true},
delete_on_empty: {min_age_secs: 123}
},
create_stream_on_append: true,
create_stream_on_read: true
})
};
fetch('https://api.example.com/basins/{basin}', 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/basins/{basin}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'default_stream_config' => [
'storage_class' => '<string>',
'retention_policy' => [
],
'timestamping' => [
'mode' => '<string>',
'uncapped' => true
],
'delete_on_empty' => [
'min_age_secs' => 123
]
],
'create_stream_on_append' => true,
'create_stream_on_read' => true
]),
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/basins/{basin}"
payload := strings.NewReader("{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/basins/{basin}")
.header("Content-Type", "application/json")
.body("{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/basins/{basin}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_stream_config\": {\n \"storage_class\": \"<string>\",\n \"retention_policy\": {},\n \"timestamping\": {\n \"mode\": \"<string>\",\n \"uncapped\": true\n },\n \"delete_on_empty\": {\n \"min_age_secs\": 123\n }\n },\n \"create_stream_on_append\": true,\n \"create_stream_on_read\": true\n}"
response = http.request(request)
puts response.read_body{
"default_stream_config": {},
"create_stream_on_append": true,
"create_stream_on_read": true
}Reconfigure an existing basin. Only the specified fields will be updated.
Path Parameters
string
required
Basin name.
Body Parameters
object
Basin configuration to update.
Set to
Show StreamReconfiguration
Show StreamReconfiguration
string
Storage class for recent writes.
standard- Append tail latency under 400 millisecondsexpress- Append tail latency under 40 milliseconds
null to clear this field.object
Retention policy for the stream.
{"age": <seconds>}- Age in seconds (must be > 0){"infinite": {}}- Retain records unless explicitly trimmed
null to clear this field and use default (7 days).object
Timestamping behavior to update.
Set the entire
Show TimestampingReconfiguration
Show TimestampingReconfiguration
string
Timestamping mode:
client-prefer- Prefer client-specified timestamp if presentclient-require- Require a client-specified timestamparrival- Use arrival time and ignore client-specified timestamp
null to clear this field.boolean
Allow client-specified timestamps to exceed the arrival time.Set to
null to clear this field.timestamping object to null to clear all timestamping configuration.object
Delete-on-empty configuration to update.
Set the entire
Show DeleteOnEmptyReconfiguration
Show DeleteOnEmptyReconfiguration
number
Minimum age in seconds before an empty stream can be deleted.
Set to 0 to disable delete-on-empty.Set to
null to clear this field.delete_on_empty object to null to clear all delete-on-empty configuration.null to clear the entire default stream configuration.boolean
Create a stream on append if it doesn’t exist.
boolean
Create a stream on read if it doesn’t exist.
Response
Returns the updated basin configuration with the same structure as Get Basin Config.object
Default stream configuration.
boolean
Create stream on append if it doesn’t exist.
boolean
Create stream on read if it doesn’t exist.
Example
curl -X PATCH "https://aws.s2.dev/v1/basins/my-basin" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"default_stream_config": {
"retention_policy": {"age": 2592000}
},
"create_stream_on_append": true
}'
Response
{
"default_stream_config": {
"storage_class": "standard",
"retention_policy": {"age": 2592000},
"timestamping": {
"mode": "client-prefer",
"uncapped": false
},
"delete_on_empty": {
"min_age_secs": 0
}
},
"create_stream_on_append": true,
"create_stream_on_read": false
}
Notes
- Only specified fields are updated; unspecified fields retain their current values
- Setting a field to
nullclears it and restores the default value - Omitting a field leaves it unchanged
Error Responses
404 Not Found- Basin does not exist400 Bad Request- Invalid basin name or configuration403 Forbidden- Insufficient permissions408 Request Timeout- Request timed out