---
title: Delete a Repository
description: The Backup Service REST API allows an archived repository to be deleted.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbase/docs-server/edit/release/8.0/modules/rest-api/pages/backup-delete-repository.adoc
  xref: xref:server:rest-api:backup-delete-repository.adoc[]
---

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

# Delete a Repository

> The Backup Service REST API allows an archived repository to be deleted. 

## [](#http-methods-and-uris)HTTP Methods and URIs

DELETE /cluster/self/repository/archived/<repository-id>

DELETE /cluster/self/repository/archived/<repository-id>"?remove_repository=true"

## [](#description)Description

These delete an _archived_ repository. They cannot be used on a repository that is either _active_ or _imported_. No other interfaces for repository-deletion are provided: therefore, in order to be deleted, a repository must first be archived. For information on archiving a repository, see [Archive a Repository](backup-archive-a-repository.md).

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

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

curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self\
  /repository/archived/<repository-id>"?remove_repository=true"
  -u <username>:<password>

The `repository-id` argument must be the name of a currently active repository. If `repository-id` is specified with the `remove_repository=true` query-parameter, the repository data is removed from disk, as well as being removed from the Backup Service. If `repository-id` is specified without the query-paramter, the repository is removed from the Backup Service, but remains on disk.

The `username` and `password` must identify an administrator with the Full Admin role.

## [](#responses)Responses

Success returns `200 OK`. If the specified repository cannot be found, or if the URI is otherwise incorrectly specified, `404 Object Not Found` is returned. If the query-parameter is incorrectly specified, `400 Bad Request` is returned. If an internal server error prevents deletion of the repository, `500 Internal Server Error` is returned.

Failure to authenticate returns `401 Unauthorized`.

## [](#examples)Examples

The following call deletes the archived repository `quickRepo`:

curl -v -X DELETE http://127.0.0.1:8097/api/v1/cluster/self/\
repository/archived/quickRepo \
-u Administrator:password

Success returns `200 OK`, and the archived repository is deleted from the Backup Service. However, since the query-parameter has _not_ been specified, the repository and its data survive on disk.

The following call deletes the archived repository `oldRepo`, specifying the query-parameter:

curl -v -X DELETE http://127.0.0.1:8097/api/v1/cluster/self/\
repository/archived/oldRepo?remove_repository=true \
-u Administrator:password

Success returns `200 OK`. Since the query-parameter `remove_repository=true` has been specified, the archived repository is deleted both from the Backup Service and from disk.

## [](#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). To create a repository with the REST API, see [Create a Repository](backup-create-repository.md).