---
title: "Create a new stream"
method: POST
path: "/storage/streams"
tags: ["Streams"]
---

# Create a new stream

`POST /storage/streams`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/storage/streams`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/docs/storage/streams/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new stream for message publishing

## Request body

- CreateStreamRequest
  - `name` string, required: Name of the stream to create
  - `description` string: Description of the stream
  - `subjects` string[]: Subject patterns to capture
  - `max_consumers` integer: Maximum number of consumers
  - `max_msgs` integer: Maximum number of messages
  - `max_bytes` integer: Maximum size in bytes
  - `discard` 0 | 1: Discard policy (0 = old, 1 = new)
  - `max_msgs_per_subject` integer: Maximum messages per subject
  - `max_msg_size` integer: Maximum message size in bytes
  - `storage` 'file' | 'memory'
  - `num_replicas` integer: Number of replicas
  - `mirror` StreamSource
    - `name` string, required: Name of the source stream
    - `opt_start_seq` integer: Optional starting sequence number
    - `opt_start_time` string, date-time: Optional starting time
    - `filter_subject` string: Optional subject filter
    - `domain` string: Optional domain
  - `sources` StreamSource[]: Optional sources configuration
    - `name` string, required: Name of the source stream
    - `opt_start_seq` integer: Optional starting sequence number
    - `opt_start_time` string, date-time: Optional starting time
    - `filter_subject` string: Optional subject filter
    - `domain` string: Optional domain
  - `sealed` boolean: Whether the stream is sealed
  - `deny_delete` boolean: Whether deletes are denied
  - `deny_purge` boolean: Whether purges are denied

## Response `200`

Bad Request

- SuccessMessage
  - `message` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

## Changes

- **2025-07-04** `ad8205bf93a3`: 3 breaking, 3 info
  - removed the enum value `0.00` of the request property `storage`
  - removed the enum value `1.00` of the request property `storage`
  - the `storage` request property type changed from `integer` to `string`
  - the `storage` request property default value `0` was removed
  - …2 more
- **2025-07-04** `d566a61279be`: 2 breaking, 1 warning, 18 info
  - added the new required request property `name`
  - the request's body type changed from no type to `object`
  - removed `#/components/schemas/StreamCreateName, #/components/schemas/StreamConfig` from the request body `allOf` list
  - added the new optional request property `deny_delete`
  - …17 more
- **2025-06-13** `e4ad9e1ccd66`: 6 warning, 1 info
  - removed the optional property `config` from the response with the `200` status
  - removed the optional property `created` from the response with the `200` status
  - removed the optional property `did_create` from the response with the `200` status
  - removed the optional property `error` from the response with the `200` status
  - …3 more

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/changes/storage/streams/post.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/revisions/104591eadd10?raw)
