> ## Documentation Index
> Fetch the complete documentation index at: https://docs.knoxcall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Secret Metadata

> Updates the expiry metadata on an existing secret without changing the encrypted value

## Update Secret Metadata

```http theme={"dark"}
PATCH /v1/secrets/:id
```

Updates the expiry metadata on an existing secret. Use this to set or clear `expires_at` and `strict_expiry_enforcement` without changing the encrypted value.

### Path Parameters

| Parameter | Type | Description   |
| --------- | ---- | ------------- |
| `id`      | uuid | The secret ID |

### Request Body

At least one field is required.

| Field                       | Type           | Description                                                   |
| --------------------------- | -------------- | ------------------------------------------------------------- |
| `expires_at`                | string \| null | ISO-8601 datetime for expiry, or `null` to clear              |
| `strict_expiry_enforcement` | boolean        | `true` to block injection when expired; `false` for warn-only |

### Response

```json theme={"dark"}
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "STRIPE_API_KEY",
    "expires_at": "2027-01-15T00:00:00.000Z",
    "strict_expiry_enforcement": true
  },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}
```

### Errors

| Status | Type               | Description                                                                          |
| ------ | ------------------ | ------------------------------------------------------------------------------------ |
| 400    | `validation_error` | No fields provided, invalid `expires_at`, or non-boolean `strict_expiry_enforcement` |
| 404    | `not_found`        | Secret not found                                                                     |
