[role="xpack"]
[[indices-create-data-stream]]
=== Create data stream API
++++
Create data stream
++++
Creates a new <>.
////
[source,console]
----
PUT /_index_template/template
{
"index_patterns": ["my-data-stream*"],
"data_stream": { }
}
----
////
[source,console]
----
PUT /_data_stream/my-data-stream
----
// TEST[continued]
////
[source,console]
-----------------------------------
DELETE /_data_stream/my-data-stream
DELETE /_index_template/template
-----------------------------------
// TEST[continued]
////
[[indices-create-data-stream-request]]
==== {api-request-title}
`PUT /_data_stream/`
[[indices-create-data-stream-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `create_index`
or `manage` <> for the data stream.
* A matching <> with data stream enabled.
See <>.
[[indices-create-data-stream-api-path-params]]
==== {api-path-parms-title}
``::
+
--
(Required, string) Name of the data stream to create. Data stream names must
meet the following criteria:
- Lowercase only
- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
space character
- Cannot start with `-`, `_`, `+`, or `.ds-`
- Cannot be `.` or `..`
- Cannot be longer than 255 bytes. Multi-byte characters
count towards this limit faster.
--