# Delete Repository

Once you have created a repository using the [<mark style="color:blue;">**Docker URIs**</mark>](https://distribution.github.io/distribution/spec/api/#overview) and completed your operations, you may want to delete it. As the [<mark style="color:blue;">**Docker Registry V2 API**</mark>](https://docs.docker.com/reference/api/registry/latest/) does not support deleting entire repositories, you must use the <code class="expression">space.vars.ionos\_cloud</code> **Container Registry API**. To perform this operation, you need:

* The `repository_name` you wish to delete. For more information about retrieving a list of repositories, see [<mark style="color:blue;">Retrieve all Repositories</mark>](https://api.ionos.com/docs/containerregistry/v1/#tag/Repositories/operation/registriesRepositoriesGet).
* The `registryId`, which can be obtained through the [<mark style="color:blue;">GET Registries</mark>](/cloud/containers/private-container-registry/api-howtos/registries.md) API call.

## Request

Run the following `curl` command to delete the repository:

{% hint style="info" %}
**Note:**

* In the following code, the sample `registryId` is `8fb592e4-494c-11ed-b878-0242ac120002` and `repository_name` is `dev/tests`.
* The repository name in the API URL must be URL-encoded. For example, `dev/tests` should be written as `dev%2Ftests` to prevent the slash from being interpreted as a path separator and causing a 404 error.
  {% endhint %}

```bash
curl --location \
--header 'Authorization: Bearer ${TOKEN}' \
--request DELETE 'https://api.ionos.com/containerregistries/registries/8fb592e4-494c-11ed-b878-0242ac120002/repositories/dev%2Ftests'
```

### Path parameters

| **Field**         | **Type** | **Description**                                                | **Example**                            |
| ----------------- | -------- | -------------------------------------------------------------- | -------------------------------------- |
| `registryId`      | string   | The ID of the registry to be returned. This is required.       | `8fb592e4-494c-11ed-b878-0242ac120002` |
| `repository_name` | string   | The name of the registry. It must be unique within the folder. | `dev%2Ftests`                          |

## Response

Upon success, the server returns **204 - No Content** to indicate the request was fulfilled without a response body.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/containers/private-container-registry/api-howtos/delete_repo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
