Delete
/api/v2/deleteDelete data
Deletes data from a bucket.
Use this endpoint to delete points from a bucket in a specified time range.
InfluxDB Cloud
Does the following when you send a delete request:
- Validates the request and queues the delete.
- If queued, responds with success (HTTP
2xxstatus code); error otherwise. - Handles the delete asynchronously and reaches eventual consistency.
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
wait for a success response (HTTP 2xx status code) before you send the next request.
Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response.
InfluxDB OSS v2
- Validates the request, handles the delete synchronously, and then responds with success or failure.
Required permissions
write-bucketsorwrite-bucket BUCKET_ID.
BUCKET_ID is the ID of the destination bucket.
Rate limits (with InfluxDB Cloud)
write rate limits apply.
For more information, see limits and adjustable quotas.
Related guides
- Delete data
- Learn how to use delete predicate syntax.
- Learn how InfluxDB handles deleted tags and deleted fields.
Parameters
Query parameters
org
stringAn organization name or ID.
InfluxDB Cloud
- Doesn’t use the
orgparameter ororgIDparameter. - Deletes data from the bucket in the organization associated with the authorization (API token).
InfluxDB OSS v2
- Requires either the
orgparameter or theorgIDparameter. - Deletes data from the bucket in the specified organization.
- If you pass both
orgIDandorg, they must both be valid.
bucket
stringbucket and bucketID, bucketID takes precedence.orgID
stringAn organization ID.
InfluxDB Cloud
- Doesn’t use the
orgparameter ororgIDparameter. - Deletes data from the bucket in the organization associated with the authorization (API token).
InfluxDB OSS v2
- Requires either the
orgparameter or theorgIDparameter. - Deletes data from the bucket in the specified organization.
- If you pass both
orgIDandorg, they must both be valid.
bucketID
stringbucket and bucketID, bucketID takes precedence.Header parameters
Zap-Trace-Span
stringRequest body required
Time range parameters and an optional delete predicate expression.
To select points to delete within the specified time range, pass a
delete predicate expression in the predicate property of the request body.
If you don’t pass a predicate, InfluxDB deletes all data with timestamps
in the specified time range.
Related guides
- Delete data
- Learn how to use delete predicate syntax.
application/jsonpredicate
string"tag1=\"value1\" and (tag2=\"value2\" and tag3!=\"value3\")"start
required
string <date-time>stop
required
string <date-time>curl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/delete" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"predicate": "tag1=\"value1\" and (tag2=\"value2\" and tag3!=\"value3\")",
"start": "START",
"stop": "STOP"
}'Responses
Success.
InfluxDB Cloud
- Validated and queued the request.
- Handles the delete asynchronously - the deletion might not have completed yet.
An HTTP 2xx status code acknowledges that the write or delete is queued.
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
wait for a response before you send the next request.
Because writes are asynchronous, data might not yet be written when you receive the response.
InfluxDB OSS v2
- Deleted the data.
Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if the
orgparameter ororgIDparameter doesn’t match an organization.
code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.