---
title: Perform an Immediate Prune
description: The Backup Service REST API allows an immediate prune to be triggered.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbase/docs-server/edit/release/8.0/modules/rest-api/pages/backup-trigger-prune.adoc
  xref: xref:server:rest-api:backup-trigger-prune.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/server/current/rest-api/backup-trigger-prune.html)

# Perform an Immediate Prune

> The Backup Service REST API allows an immediate prune to be triggered. 

## [](#http-methods-and-uris)HTTP Method and URI

POST /cluster/self/repository/active/<repository-id>/prune

## [](#description)Description

Triggers an immediate pruning of backups for the specified active repository. As a result, the need to wait for a scheduled pruning can be skipped when necessary.

## [](#curl-syntax)Curl Syntax

curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self\
/repository/active/<repository-id>/prune \
  -u <username>:<password>

The `username` and `password` must identify an administrator with the Full Admin role. The `repository-id` must be the name of an active repository on the cluster.

## [](#responses)Responses

| Value                                                                                       | Description                                                            | Value example                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200 OK and JSON array containing repository information depending on the specific endpoint. | Successful call.                                                       | {"status":404,"msg":"repository \`res4tRepo does not exist"}\`                                                                                                                                      |
| 400                                                                                         | Invalid parameter.                                                     |                                                                                                                                                                                                     |
| 400 Object Not found                                                                        | The repository in the endpoint URI does not exist.                     | {"status":400,"msg":"invalid request body","extras":"invalid character '{' looking for beginning of object key string"}}                                                                            |
| 401 Unauthorized                                                                            | Authorization failure due to incorrect username or password.           |                                                                                                                                                                                                     |
| 403 Forbidden, plus a JSON message explaining the minimum permissions.                      | The provided username has insufficient privileges to call this method. |                                                                                                                                                                                                     |
| 404 Object Not Found                                                                        | Error in the URI path.                                                 |                                                                                                                                                                                                     |
| 500 Could not retrieve the requested repository                                             | Error in Couchbase Server.                                             | {"status":500,"msg":"could not send task","extras":"failed bucket check for bucket 'travel-sample': bucket UUIDs don't match bf5e2d0ec35e7957ed96509b8ed7e13f != 15b15c78439db91ba73f27ac4d6ba116"} |

## [](#example)Example

The following example requests an immediate pruning for the `repoNewForPrune` active repository:

curl -v -X POST http://127.0.0.1:8097/api/v1/cluster/self/\
repository/active/repoNewForPrune/prune \
-u Administrator:password \
-d '{"full_backup": true}' | jq

If successful, the call returns `200 OK`, and a message similar to the following:

[
  {
  "task_name": "PRUNE-975564a7-f6c2-491e-8488-ef2cdcffb0a6"
  }
]

## [](#see-also)See Also

* An overview of the Backup Service is provided in [Backup Service](../learn/services-and-indexes/services/backup-service.md).
* A step-by-step guide to using Couchbase Web Console to configure and use the Backup Service is provided in [Manage Backup and Restore](../manage/manage-backup-and-restore/manage-backup-and-restore.md).
* For information on scheduling pruning tasks, see [Schedule Pruning](../manage/manage-backup-and-restore/manage-backup-and-restore.md#schedule-backup-pruning).
* For information on backup retention, see [Retain Backups](../manage/manage-backup-and-restore/manage-backup-and-restore.md#backup-retention).