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

# Create a stream

> Pre-declare a stream.

```http theme={null}
POST /api/v1/streams
```

Streams are also created implicitly on first intake; use this to pre-declare one with an explicit
schema or retention.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:5080/api/v1/streams \
    -H "authorization: Bearer $MS_JWT" \
    -H 'content-type: application/json' \
    -d '{
      "name": "app",
      "stream_type": "logs",
      "fields": [
        {
          "name": "trace_id",
          "data_type": "utf8",
          "nullable": true,
          "indexed": true,
          "index_type": "exact",
          "encrypted": false
        }
      ],
      "retention_days": 30
    }'
  ```
</RequestExample>

<Note>
  `profiles` and `extend` streams cannot be used as pipeline targets. Manage extend-table data
  through the `/api/v1/extend_tables` API.
</Note>

Names may contain letters, numbers, `_`, `-`, and `.`. Field types are `bool`, `int64`, `float64`,
`utf8`, `timestamp`, and `json`. Creating a stream requires `streams.create`.
