Delete
The Delete API allows you to remove data from Telemetry. You can delete specific rows based on a condition or remove an entire table. Be cautious when using this API, as deleting data is irreversible.
DELETE https://api.telemetry.sh/delete
Headers
| Name | Type | Description |
|---|---|---|
| Content-Type | String | application/json |
| Authorization | String | Your API key, either as the raw key or as Bearer <key> |
Scope rules:
DELETE /deleterequireswriteorread-and-write
Body
| Name | Type | Description |
|---|---|---|
| table | String | The table you want to delete data from |
| where | String (optional) | SQL clause for what rows to delete |
If where is omitted, Telemetry treats the request as a whole-table delete.
Success responses
Delete responses are asynchronous cleanup acknowledgements. The API returns 200 OK as soon as the delete rewrite or table-disable step has been scheduled successfully.
Delete matching rows
{
"status": "success",
"message": "Delete rewrite completed; part cleanup is asynchronous"
}
Delete an entire table
{
"status": "success",
"message": "Table disabled; part cleanup is asynchronous"
}
Example usage with cURL
To delete all rows older than 3 days from the table named uber_rides using cURL, you can use the following command:
API_KEY="YOUR_API_KEY"
WHERE_CONDITION="timestamp <= (now() - INTERVAL '3 day')"
curl -X DELETE https://api.telemetry.sh/delete \
-H "Content-Type: application/json" \
-H "Authorization: $API_KEY" \
-d @- <<EOF
{
"table": "uber_rides",
"where": "$WHERE_CONDITION"
}
EOF
If you want to delete the entire uber_rides table, simply omit the where field:
API_KEY="YOUR_API_KEY"
curl -X DELETE https://api.telemetry.sh/delete \
-H "Content-Type: application/json" \
-H "Authorization: $API_KEY" \
-d '{
"table": "uber_rides"
}'
Important Notes
- Data Deletion: Be careful when using the delete endpoint. If the
wherecondition is not provided, the entire table will be deleted. - Irreversibility: Once data is deleted, it cannot be recovered.
- Legacy endpoint: Prefer the Tables API for whole-table lifecycle operations when possible.
DELETE /deleteremains useful for row-level deletes with awhereclause.
Common errors
400 Bad Requestif the JSON body is invalid400 Bad Requestif the table name contains invalid characters after normalization403 Forbiddenif the API key only hasreadscope401 Unauthorizedif the API key is missing or invalid404 Not Foundif you try to delete rows from a table that has no schema yet500 Internal Server Errorif Telemetry fails to execute the delete request