[[data-streams-delete-global-retention]]
=== Delete the global retention of data streams
++++
<titleabbrev>Delete Data Stream Global Retention</titleabbrev>
++++

preview::[]

Deletes the global retention configuration that applies on every data stream managed by <<data-stream-lifecycle,data stream lifecycle>>.

[[delete-global-retention-api-prereqs]]
==== {api-prereq-title}

** If the {es} {security-features} are enabled, you must have the `manage_data_stream_global_retention` <<privileges-list-cluster,cluster privilege>> to use this API.

[[data-streams-delete-global-retention-request]]
==== {api-request-title}

`DELETE _data_stream/_global_retention`

[[data-streams-delete-global-retention-desc]]
==== {api-description-title}

Deletes the global retention configuration that is applied on data streams managed by data stream lifecycle.

[role="child_attributes"]
[[delete-global-retention-api-query-parms]]
==== {api-query-parms-title}

`dry_run`::
(Boolean) Signals that the request should determine the effect of the removal of the existing without updating
the global retention. The default value is `false`, which means the removal will happen.

[[delete-global-retention-api-response-body]]
==== {api-response-body-title}

`acknowledged`::
(boolean)
True, if the global retention has been removed. False, if it fails or if it was a dry run.

`dry_run`::
(boolean)
True, if this was a dry run, false otherwise.

`affected_data_streams`::
(array of objects)
Contains information about the data streams affected by the change.
+
.Properties of objects in `affected_data_streams`
[%collapsible%open]
====
`name`::
(string)
Name of the data stream.
`previous_effective_retention`::
(string)
The retention that was effective before the change of this request. `infinite` if there was no retention applicable.
`new_effective_retention`::
(string)
The retention that is or would be effective after this request. `infinite` if there is no retention applicable.
====

[[data-streams-delete-global-retention-example]]
==== {api-examples-title}

////

[source,console]
--------------------------------------------------
PUT _data_stream/_global_retention
{
  "default_retention": "7d",
  "max_retention": "90d"
}

PUT /_index_template/template
{
  "index_patterns": ["my-data-stream*"],
  "template": {
    "lifecycle": {}
  },
  "data_stream": { }
}

PUT /_data_stream/my-data-stream
----
// TESTSETUP
////

////
[source,console]
----
DELETE /_data_stream/my-data-stream*
DELETE /_index_template/template
DELETE /_data_stream/_global_retention
----
// TEARDOWN
////

Let's update the global retention:
[source,console]
--------------------------------------------------
DELETE _data_stream/_global_retention
--------------------------------------------------

The response will look like the following:

[source,console-result]
--------------------------------------------------
{
  "acknowledged": true,
  "dry_run": false,
  "affected_data_streams": [
    {
      "name": "my-data-stream",
      "previous_effective_retention": "7d",
      "new_effective_retention": "infinite"
    }
  ]
}
--------------------------------------------------
