Documentation

Delete data

Use the influx CLI or the InfluxDB API /delete endpoint to delete data.

Delete data using the influx CLI

If you haven’t already, download and set up the influx CLI. Following these setup instructions creates a configuration profile that stores your credentials, including your organization and token.

  1. Use the influx delete command to delete points from InfluxDB.
  2. If you set up a configuration profile with your organization and token, specify the bucket (-b) to delete from. Otherwise, specify your organization (-o), bucket (-b), and authentication token (-t) with write permissions.
  3. Define the time range to delete data from with the --start and --stop flags.
  4. (Optional) Specify which points to delete using the predicate parameter and delete predicate syntax.

Example

influx delete --bucket my-bucket \
 --start '1970-01-01T00:00:00.00Z' \
 --stop '2020-01-01T00:00:00.00Z' \

Delete data using the API

  1. Use the InfluxDB API /delete endpoint to delete points from InfluxDB.
  2. Include your organization and bucket as query parameters in the request URL.
  3. Use the Authorization header to provide your InfluxDB authentication token with write permissions.
  4. In your request payload, define the time range to delete data from with start and stop.
  5. (Optional) Specify which points to delete using the predicate parameter and delete predicate syntax.

Example

curl --request POST \
  https://cloud2.influxdata.com/api/v2/delete?org=<org-name>&bucket=<bucket-name> \
  --header 'Authorization: Token <INFLUXDB_AUTH_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{
  "predicate": "_measurement=\"example-measurement\" and _field=\"example-field\"",
  "start": "2020-08-16T08:00:00Z",
  "stop": "2020-08-17T08:00:00Z"
   }'

For more information, see the /delete API documentation.


New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: