Skip to main content

delete_corpus

Function delete_corpus 

Source
pub fn delete_corpus(
    name: &str,
    confirm: Option<&str>,
    actor: Actor,
    pool: &State<DbPool>,
) -> Status
Expand description

Deletes a corpus and all of its tasks and log messages. Token-gated via the Actor guard (an unauthenticated wipe of a corpus must not be possible — 401 without a valid token) and double-guarded: the caller must also echo the corpus name via ?confirm=<name> to proceed (prevents accidental wipes; the UI confirms the same way). Returns 204 on success, 400 if the confirmation does not match, 404 if unknown. Every sandbox carved from the corpus (the corpora whose parent chain leads to it in GET /api/corpora) is deleted with it — FK cascade.