Deleted a Cloudflare D1 database by mistake? You now have seven days from the time of deletion to restore it through the API. Announced on October 23, 2026, the change means requests for databases deleted more than seven days ago will fail. In an incident, confirm the database ID and submit an undelete request as soon as possible.

What changed
The recovery method requires the account ID and the UUID of the deleted database; you can provide a new name in the request body. By default, the database is restored under its previous name. If another database in the account already uses that name, you must specify new_name for the restoration. These requirements are listed in the D1 undelete API reference.
The window is seven days, or 7 × 24 hours. A calendar date alone is therefore not enough: record the deletion time and compare it with the time you submit the request. If the deadline is near, submit the recovery request first, then check the name and data.
Steps to take
- Locate the deleted database. Confirm the account ID and database ID using logs, infrastructure code, or incident records. The API path uses the database UUID; its display name alone is not enough to make the request.
- Check the time window. Make sure fewer than seven days have passed since deletion. Cloudflare recommends submitting the request as soon as you discover an accidental deletion.
- Resolve any name conflict. If the previous name is already in use, provide an available value through
new_name; otherwise, you do not need to change the name. - Call the documented method. The API uses
POST /accounts/{account_id}/d1/database/{database_id}/undelete. Authorize the request with an API token that has the required permissions, and do not put the secret in logs. - Verify the result. After a successful response, confirm that the database appears in the account under the expected name and that your application connects to the correct instance.
Undelete and Time Travel serve different purposes
Undelete restores a deleted database. Time Travel restores an existing database to a point in time or a bookmark. Cloudflare’s documentation says that history is available for the past 30 days; the actual retention period depends on the plan. After an undelete, Time Travel cannot return the database to a point or time before the restoration. For an error in the data of a live database, use Time Travel; for a deleted object, use undelete within the specified time limit.
For operational readiness, include a check of the seven-day window in your incident response procedure and record the database ID and deletion time in the incident log. This can help you submit the correct request quickly without wasting time tracking down identifiers or resolving a name conflict.