> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or update a stream

> Creates a new stream or updates an existing stream with the provided configuration. If the stream does not exist, it will be created. If it exists, it will be updated with the new configuration.

Note that some properties cannot be changed after a stream is created, such as the storage type. If you attempt to change these properties, the request will fail with a 400 error.



## OpenAPI

````yaml /api-reference/endpoint/storage/openapi.json put /storage/streams/{name}
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    A comprehensive interface for managing key-value stores, object stores,
    streams, and search indexing
  contact:
    name: quiva.ai Support
    url: https://quiva.ai/help-center/
  version: 1.0.0
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /storage/streams/{name}:
    put:
      tags:
        - Streams
      summary: Create or update a stream
      description: >-
        Creates a new stream or updates an existing stream with the provided
        configuration. If the stream does not exist, it will be created. If it
        exists, it will be updated with the new configuration.


        Note that some properties cannot be changed after a stream is created,
        such as the storage type. If you attempt to change these properties, the
        request will fail with a 400 error.
      operationId: createOrUpdateStream
      parameters:
        - $ref: '#/components/parameters/streamName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStreamRequest'
            examples:
              update_description:
                summary: Update stream description
                value:
                  description: Updated description for the user events stream
              update_limits:
                summary: Update stream limits
                value:
                  max_msgs: 2000000
                  max_bytes: 209715200
                  max_msg_size: 131072
              full_update:
                summary: Full stream configuration update
                value:
                  description: High-capacity event stream
                  max_msgs: 10000000
                  max_bytes: 1073741824
                  max_msg_size: 262144
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    streamName:
      name: name
      in: path
      description: Name of the stream
      required: true
      schema:
        type: string
  schemas:
    UpdateStreamRequest:
      type: object
      properties:
        description:
          type: string
          description: Updated description of the stream
        max_msgs:
          type: integer
          description: Updated maximum number of messages
          minimum: 1
        max_bytes:
          type: integer
          description: Updated maximum size in bytes
          minimum: 1
        max_msg_size:
          type: integer
          description: Updated maximum message size in bytes
          minimum: 1
    SuccessMessage:
      type: object
      properties:
        message:
          type: string
          example: success
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
  responses:
    SuccessResponse:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessMessage'
          example:
            message: success
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: validation_error
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: unauthorized
    NotFoundError:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: not_found
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: internal_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````