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

# Create a new stream

`POST /storage/streams`

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

---

[API](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-5.md) · [All operations](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-5/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quivaworks/quiva-ai-gateway-5/revisions/072de10ada5e/schema)
