# Delete Credential

- **Method:** `DELETE`
- **Path:** `/api/v1/credentials/{name}`
- **Operation ID:** `delete_credential`
- **Tags:** credentials

Force-delete the secret and free the name. A name this tenant does not have is a 404 - the same
404 whether it belongs to nobody or to another tenant, because the lookup never leaves this one.

## Effective servers

- `https://api.saram.sh`

  Saram

## Authentication

- **HTTPBearer**: HTTP bearer

  a Saram API key (`sk_saram_<env>_...`) or a person's AuthKit access token, as `Authorization: Bearer <credential>`. Both are told apart by shape and produce the same principal.

## Path parameters

- **`name` (required)**: `string`

## Responses

### 200 Successful Response

**Content type:** `application/json`

schema: `CredentialRecord`, no additional properties

One of this tenant's credentials, a provider key or a test account, as all three routes answer it.
Metadata only.

- **`created_at` (required)**: `string`, format: `date-time`
- **`id` (required)**: `string`
- **`kind` (required)**: `string`
- **`name` (required)**: `string`
- **`secret_ref` (required)**: `string`

  The awssm:// ref to paste into a run spec as providers.entries\[].credential\_ref, for an account into target.seed.accounts, as connectors.webhook.secret\_ref for a webhook key, or as connectors.github.token\_ref for a github token. Only this tenant's specs may name it.
- **`deleted_at`**: `string | null`, format: `date-time`

  Set on the record `DELETE` answers with, absent on a live one: the secret is gone and the name is free.

**Example:**

```json
{
  "id": "",
  "name": "",
  "kind": "",
  "secret_ref": "",
  "created_at": "",
  "deleted_at": ""
}
```

### 403 the API key lacks the credentials:write scope, or the request carries no tenant

### 404 this tenant has no credential by that name

### 422 Validation Error

**Content type:** `application/json`

schema: `HTTPValidationError`

- **`detail`**: `array`

  **Items:**

  schema: `ValidationError`
  - **`loc` (required)**: `array of (string | integer)`
  - **`msg` (required)**: `string`
  - **`type` (required)**: `string`
  - **`ctx`**: `object`
  - **`input`**: `any`

**Example:**

```json
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Schemas

- `CredentialRecord` — shown above.
- `HTTPValidationError` — shown above.
- `ValidationError` — shown above.
