Skip to main content
Applies to:
  • Plan -
  • Deployment -

Summary

Issue: A deleted prompt shows no undo option or unarchive control in the UI. There is no way to restore a soft-deleted prompt through the API. Cause: Prompt deletion triggers a soft-delete window before permanent removal. No UI or API restore endpoint exists for prompts specifically. Resolution: Retrieve prompt content via API during the soft-delete window. For prevention, restrict users to Viewer access or implement external prompt caching.

Resolution steps

If a prompt was recently deleted

Step 1: Retrieve the prompt content via API

During the soft-delete window, you can read (but not restore) a deleted prompt using its ID and version.
curl --location 'https://api.braintrust.dev/v1/prompt?version=<prompt version>&project_id=<project id>&id=<prompt id>' --header 'Authorization: Bearer sk-your-api-key'
This only works while the object is still soft-deleted. Once hard-deleted, the data is unrecoverable.

If you want to prevent accidental deletion

Keep users who should not delete objects in the Viewers group. This is the lowest access level and prevents destructive actions. Custom permission groups with fine-grained destructive-action controls are available on the Enterprise plan only.