DecreaseStreamRetentionPeriod
Written by
Updated at August 15, 2025
Decreases the record retention period in a data stream.
Available retention period options: 4 hours, 12 hours, 24 hours.
This operation may result in data loss. For example, if the retention period is reduced from 24 to 12 hours, any data older than 12 hours will no longer be available.
Request
The request contains JSON-formatted data.
{
"RetentionPeriodHours": number,
"StreamName": "string"
}
Request options
| Option | Description |
|---|---|
RetentionPeriodHours |
Record retention period, hours. Must be less than the current value. Type: Integer Allowed values: 4, 12.Required: Yes |
StreamName |
Data stream name. Type: String Size: 1-128 characters.The possible values are: [a-zA-Z][a-zA-Z0-9-]+*(?<!-)$Required: Yes |
Response
Successful responses include an HTTP 200 code and an empty response body.
Errors
| Error | Description | HTTP code |
|---|---|---|
InvalidArgumentException |
The argument is invalid. See the error message for details. | 400 |
LimitExceededException |
The request limit is exceeded. | 400 |
ResourceInUseException |
The resource is currently locked by another operation. | 400 |
ResourceNotFoundException |
The requested resource was not found. | 400 |
Errors common to all methods may occur.