> ## Documentation Index
> Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Update only provided fields in an S2 stream's configuration; omitted fields are left unchanged.

# Reconfigure a stream.



## OpenAPI

````yaml patch /streams/{stream}
openapi: 3.1.0
info:
  title: S2, the durable streams API
  description: Streams as a cloud storage primitive.
  termsOfService: https://s2.dev/terms
  contact:
    email: support@s2.dev
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://aws.s2.dev/v1
security:
  - access_token: []
tags:
  - name: metrics
    description: Usage metrics and data.
  - name: basins
    description: Manage basins
  - name: access-tokens
    description: Manage access tokens
  - name: locations
    description: Manage locations
  - name: streams
    description: Manage streams
  - name: records
    description: Manage records
paths:
  /streams/{stream}:
    servers:
      - url: https://{basin}.b.s2.dev/v1
        description: Endpoint for the basin
        variables:
          basin:
            default: ''
            description: Basin name
    patch:
      tags:
        - streams
      summary: Reconfigure a stream.
      operationId: reconfigure_stream
      parameters:
        - name: stream
          in: path
          description: Stream name.
          required: true
          schema:
            $ref: '#/components/schemas/StreamNameStr'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StreamReconfiguration'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamConfig'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '408':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
components:
  schemas:
    StreamNameStr:
      type: string
      maxLength: 512
      minLength: 1
    StreamReconfiguration:
      type: object
      properties:
        delete_on_empty:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DeleteOnEmptyReconfiguration'
              description: Delete-on-empty configuration.
        retention_policy:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RetentionPolicy'
              description: |-
                Retention policy for the stream.
                If unspecified, the default is to retain records for 7 days.
        storage_class:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/StorageClass'
              description: Storage class for recent writes.
        timestamping:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampingReconfiguration'
              description: Timestamping behavior.
    StreamConfig:
      type: object
      properties:
        delete_on_empty:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DeleteOnEmptyConfig'
              description: Delete-on-empty configuration.
        retention_policy:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RetentionPolicy'
              description: |-
                Retention policy for the stream.
                If unspecified, the default is to retain records for 7 days.
        storage_class:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/StorageClass'
              description: Storage class for recent writes.
        timestamping:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampingConfig'
              description: Timestamping behavior.
    ErrorInfo:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    DeleteOnEmptyReconfiguration:
      type: object
      properties:
        min_age_secs:
          type:
            - integer
            - 'null'
          format: int64
          description: |-
            Minimum age in seconds before an empty stream can be deleted.
            Set to 0 to disable delete-on-empty (don't delete automatically).
          minimum: 0
    RetentionPolicy:
      oneOf:
        - type: object
          description: >-
            Age in seconds for automatic trimming of records older than this
            threshold.

            This must be set to a value greater than 0 seconds.
          required:
            - age
          properties:
            age:
              type: integer
              format: int64
              description: >-
                Age in seconds for automatic trimming of records older than this
                threshold.

                This must be set to a value greater than 0 seconds.
              minimum: 0
        - type: object
          description: Retain records unless explicitly trimmed.
          required:
            - infinite
          properties:
            infinite:
              $ref: '#/components/schemas/InfiniteRetention'
              description: Retain records unless explicitly trimmed.
    StorageClass:
      type: string
      enum:
        - standard
        - express
    TimestampingReconfiguration:
      type: object
      properties:
        mode:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampingMode'
              description: >-
                Timestamping mode for appends that influences how timestamps are
                handled.
        uncapped:
          type:
            - boolean
            - 'null'
          description: Allow client-specified timestamps to exceed the arrival time.
    DeleteOnEmptyConfig:
      type: object
      properties:
        min_age_secs:
          type: integer
          format: int64
          description: >-
            Minimum age in seconds before an empty stream can be deleted.

            Set to 0 (default) to disable delete-on-empty (don't delete
            automatically).
          minimum: 0
    TimestampingConfig:
      type: object
      properties:
        mode:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampingMode'
              description: >-
                Timestamping mode for appends that influences how timestamps are
                handled.
        uncapped:
          type:
            - boolean
            - 'null'
          description: >-
            Allow client-specified timestamps to exceed the arrival time.

            If this is `false` or not set, client timestamps will be capped at
            the arrival time.
    InfiniteRetention:
      type: object
    TimestampingMode:
      type: string
      enum:
        - client-prefer
        - client-require
        - arrival
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your access token.

````