---
title: "corestack_environment_registry_secret_delete"
url: https://docs.corefinity.com/mcp/tools/corestack_environment_registry_secret_delete
type: tool
last_updated: 2026-11-13
feature: registry-secrets
related:
  - https://docs.corefinity.com/guides/sites/code-and-deployments/registry-secrets.md
---
# corestack_environment_registry_secret_delete

**Delete a CoreStack Enterprise registry credential.** Delete one of a CoreStack Enterprise environment's Composer registry credentials; builds that install from that registry then fail. Send confirm_delete set to its id once the person has agreed. Scope: write.

- Scope: `write`
- Confirmation: `confirm_delete`
- Runs as a task: no

## When to use it

Delete one of a CoreStack Enterprise environment's Composer registry credentials: the "Composer registries" card's
Delete. Builds that install packages from that registry then fail until another credential is added (saved
credentials are used by v2 builds only once Composer registry credentials are switched on for the environment). Read
`corestack_environment_registry_secret_list` first for its `id`.

Deleting cannot be undone. Ask the person first, then send `confirm_delete` set to the credential's id, as a string.

The public API's `DELETE /api/corestack/environments/{environment}/deploy-secrets/{secret}` does the same.

## Inputs

- `enterprise_env_id` (integer, ≥ 1, required)
- `secret_id` (integer, ≥ 1, required)
- `confirm_delete` (string): the same id again, sent only after the person agreed. Without it, or with another value,
  nothing is deleted and the refusal says what to send.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_delete": {
      "description": "The same id again, as a string, sent only after the person agreed.",
      "maxLength": 20,
      "type": "string"
    },
    "enterprise_env_id": {
      "description": "A CoreStack Enterprise environment's id; for a CoreStack or CoreCluster site use corestack_deployments_secrets_list by site_id.",
      "minimum": 1,
      "type": "integer"
    },
    "secret_id": {
      "description": "The credential (corestack_environment_registry_secret_list).",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "enterprise_env_id",
    "secret_id"
  ],
  "type": "object"
}
```

## Refusals

- `confirm_mismatch` (field `confirm_delete`): missing, or not the credential's id. Nothing was deleted.
- `forbidden`: the person's role lacks the Edit Environment Deployment Pipeline permission. The message names it and
  says an owner of the company can grant it in Roles; `details.permission` is `editEnvironmentDeploymentPipeline`.
  Nothing is deleted.
- `invalid_arguments` (field `enterprise_env_id`): a CoreStack or CoreCluster environment; use
  `corestack_deployments_secret_delete` by `site_id`.
- `tenant_mismatch` (also for a credential that is not this environment's, or already deleted), `pin_refused`,
  `rate_limited` (shared with the public API), and the refusals every tool can answer: `scope_required`,
  `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_environment_registry_secret_delete",
  "arguments": {
    "enterprise_env_id": 1530,
    "secret_id": 3301,
    "confirm_delete": "3301"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_environment_registry_secret_delete with enterprise_env_id 1530, secret_id 3301. (Delete a CoreStack Enterprise registry credential.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Private registries](https://docs.corefinity.com/guides/sites/code-and-deployments/registry-secrets.md)
