Skip to main content
PATCH
/
streams
/
{stream}
/
config
Reconfigure Stream
curl --request PATCH \
  --url https://api.example.com/streams/{stream}/config \
  --header 'Content-Type: application/json' \
  --data '
{
  "storage_class": "<string>",
  "retention_policy": {},
  "timestamping": {
    "mode": "<string>",
    "uncapped": true
  },
  "delete_on_empty": {
    "min_age_secs": 123
  }
}
'
{
  "storage_class": "<string>",
  "retention_policy": {},
  "timestamping": {},
  "delete_on_empty": {}
}

Overview

Update the configuration of an existing stream. Only the specified fields will be updated; unspecified fields remain unchanged. This endpoint uses PATCH semantics, meaning you only need to include the fields you want to change.

Authentication

This endpoint requires authentication via the S2-Basin header containing your basin name.

Path Parameters

stream
string
required
The name of the stream to reconfigure.Example: logs/application

Request Body

All fields are optional. Include only the fields you want to update.
storage_class
string
Update the storage class:
  • standard - Append tail latency under 400ms
  • express - Append tail latency under 40ms
retention_policy
object
Update the retention policy.Options:
  • {"age": <seconds>} - Age in seconds for automatic trimming (must be > 0)
  • {"infinite": {}} - Retain records unless explicitly trimmed
timestamping
object
Update timestamping behavior. You can update individual fields within this object.
delete_on_empty
object
Update automatic deletion configuration.

Response

Returns the complete updated stream configuration.
storage_class
string
Current storage class.
retention_policy
object
Current retention policy.
timestamping
object
Current timestamping configuration.
delete_on_empty
object
Current delete-on-empty configuration.

Example Requests

Update Storage Class Only

cURL
curl -X PATCH 'https://{basin}.b.aws.s2.dev/v1/streams/logs%2Fapplication/config' \
  -H 'S2-Basin: my-basin' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "storage_class": "express"
  }'

Update Retention Policy

cURL
curl -X PATCH 'https://{basin}.b.aws.s2.dev/v1/streams/logs%2Fapplication/config' \
  -H 'S2-Basin: my-basin' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "retention_policy": {
      "age": 2592000
    }
  }'

Update Multiple Settings

cURL
curl -X PATCH 'https://{basin}.b.aws.s2.dev/v1/streams/logs%2Fapplication/config' \
  -H 'S2-Basin: my-basin' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "storage_class": "express",
    "timestamping": {
      "mode": "arrival"
    },
    "delete_on_empty": {
      "min_age_secs": 3600
    }
  }'
Stream names in the URL must be properly URL-encoded. For example, logs/application becomes logs%2Fapplication.

Example Response

{
  "storage_class": "express",
  "retention_policy": {
    "age": 2592000
  },
  "timestamping": {
    "mode": "arrival",
    "uncapped": false
  },
  "delete_on_empty": {
    "min_age_secs": 3600
  }
}

Error Responses

  • 404 Not Found - Stream does not exist
  • 400 Bad Request - Invalid configuration (e.g., retention age of 0)
  • 403 Forbidden - Insufficient permissions to reconfigure the stream
  • 409 Conflict - Configuration conflict

Build docs developers (and LLMs) love