Skip to content

Restore a deleted asset

POST
/admin/assets/{id}/restore

Takes an asset out of the trash. You can restore an asset you deleted yourself, and system.admin can restore any; the /admin in the path doesn’t mean you need an admin role.

Owning the asset isn’t enough: if someone else deleted it, only they or system.admin can bring it back. An asset deleted before deleters were recorded can be restored only by system.admin.

Restoring clears deleted_at and deleted_reason and updates updated_at; status and the recorded deleter stay as they were. The server then tries to write an admin.asset.restored audit event, and a failure is only logged. Restoring doesn’t add back the asset’s hold on its stored file, which the delete tried to drop.

It fails with a 500 if the owner has since created another live asset with the same file. Once the retention period has removed an asset for good, it can’t be restored. A live or unknown id gets 404, and 403 means you didn’t delete it.

id
required
string format: uuid

Restored

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed