---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/api-ref/Secrets/DeleteSecret.md
  - https://sourcecraft.dev/portal/docs/ru/api-ref/Secrets/DeleteSecret.md
  - href: ru/api-ref/Secrets/DeleteSecret.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/ru/llms.txt

<div class="openapi">

# Delete a secret entry

<!-- markdownlint-disable-file -->

Deletes a secret entry asynchronously. Poll operation status at the returned status_url.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-delete);margin-bottom: 12px">

<div class="openapi__request">

DELETE {.openapi__method}
```text translate=no
https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/secrets/{key}
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_key_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_org_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_repo_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_secret_group_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Optional: name of the secret group. Defaults to "default".

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__202">

## 202 Accepted

A successful response.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operation_id": "example",
  "status_url": "example",
  "status": "scheduled",
  "created_at": "2025-01-01T00:00:00Z",
  "modified_at": "2025-01-01T00:00:00Z",
  "response": {},
  "error": {
    "error_code": "example",
    "message": "example",
    "details": {}
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_created_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [OperationError](#entity-OperationError)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "details": {}
}
```

{% endcut %}
{.table-cell}
||
||

_modified_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_operation_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_response_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [SecretsOperationResult](#entity-SecretsOperationResult)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [OperationStatus](#entity-OperationStatus)

_Enum:_{.json-schema-reset .json-schema-value} `scheduled`, `in_progress`, `success`, `failed`, `cancel`
{.table-cell}
||
||

_status_url_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### OperationStatus {#entity-OperationStatus}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `scheduled`, `in_progress`, `success`, `failed`, `cancel`

</div>

<div class="openapi-entity">

### SecretsOperationResult {#entity-SecretsOperationResult}

**Type**: object

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}

</div>

<div class="openapi-entity">

### OperationError {#entity-OperationError}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: Optional details. Exact structure depends on error_code" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% endcut %}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "details": {}
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__default">

## default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: unknown

_Example:_{.json-schema-reset .json-schema-example} `null`
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_request_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.