> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.modbox.run/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.modbox.run/_mcp/server.

# Delete a registry credential

DELETE /registries/{registry_id}

Removes a registry credential. Images that reference it will fail to pull on the next provision — update them first.

Reference: https://docs.modbox.run/api-reference/modbox-api/registries/delete-registry

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `registry_id` (string, required)

### Headers

- `x-workspace-id` (string, optional, nullable) — UUID of the workspace that scopes this request. List the workspaces you belong to with GET /workspaces.

## Response

### 200

Successful Response

- `any`

## Errors

### 401 Unauthorized Error

Unauthenticated — the Bearer token is missing or invalid.

- `error` (ErrorBody, required) — Machine-readable description of a failure.
- `detail` (string, optional, nullable) — DEPRECATED — mirrors 'error.message' for backwards compatibility. Read 'error.code' instead.

### 403 Forbidden Error

Forbidden — the caller lacks permission for this resource.

- `error` (ErrorBody, required) — Machine-readable description of a failure.
- `detail` (string, optional, nullable) — DEPRECATED — mirrors 'error.message' for backwards compatibility. Read 'error.code' instead.

### 404 Not Found Error

Not found — no such resource in this workspace.

- `error` (ErrorBody, required) — Machine-readable description of a failure.
- `detail` (string, optional, nullable) — DEPRECATED — mirrors 'error.message' for backwards compatibility. Read 'error.code' instead.

### 422 Unprocessable Entity Error

Validation error — see 'error.details' for the offending fields.

- `error` (ErrorBody, required) — Machine-readable description of a failure.
- `detail` (string, optional, nullable) — DEPRECATED — mirrors 'error.message' for backwards compatibility. Read 'error.code' instead.

## Types

### ErrorBody

Machine-readable description of a failure.

- `code` (enum, required) — Stable identifier for this class of failure. Branch on this value instead of parsing 'message'.
  - Allowed values: `unauthenticated`, `invalid_token`, `invalid_credentials`, `email_not_verified`, `forbidden`, `insufficient_role`, `workspace_required`, `workspace_forbidden`, `workspace_not_found`, `member_not_found`, `sandbox_not_found`, `sandbox_name_conflict`, `sandbox_not_ready`, `provisioning_failed`, `image_not_found`, `image_disabled`, `image_immutable`, `registry_not_found`, `api_key_not_found`, `validation_error`, `not_found`, `conflict`, `rate_limited`, `internal_error`, `upstream_error`
- `message` (string, required) — Human-readable explanation of what went wrong.
- `hint` (string, optional, nullable) — Concrete next step that is likely to resolve the error.
- `docs_url` (string, optional, nullable) — Link to the documentation section for this error code.
- `retryable` (boolean, optional, default: false) — True when retrying the identical request may succeed (transient failure). False means the request must change first.
- `request_id` (string, optional, nullable) — Correlation id, also returned in the 'X-Request-Id' header.
- `details` (list of ErrorDetail, optional, nullable) — Field-level problems, present on validation errors.

### ErrorDetail

A single field-level problem, typically from request validation.

- `issue` (string, required) — Human-readable description of what is wrong with this field.
- `field` (string, optional, nullable) — Dotted path to the offending field, e.g. 'body.task_id'.

## Examples

**SDK Code**

```python
import requests

url = "https://api.example.com/registries/registry_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/registries/registry_id';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/registries/registry_id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/registries/registry_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.example.com/registries/registry_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.example.com/registries/registry_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/registries/registry_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/registries/registry_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```