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

# Delete secret

> Mark a secret as inactive (soft delete). Cannot delete reserved secrets.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/secrets.yaml delete /api/secrets/{key}
openapi: 3.0.3
info:
  title: Insforge Secrets API
  version: 1.0.0
  description: >-
    Secure secrets management for storing API keys, tokens, and sensitive
    configuration
servers: []
security: []
paths:
  /api/secrets/{key}:
    delete:
      tags:
        - Admin
      summary: Delete secret
      description: Mark a secret as inactive (soft delete). Cannot delete reserved secrets.
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Z0-9_]+$
          description: Secret key identifier
          example: STRIPE_API_KEY
      responses:
        '200':
          description: Secret deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
              example:
                success: true
                message: Secret STRIPE_API_KEY has been deleted successfully
        '403':
          description: Cannot delete reserved secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: FORBIDDEN
                message: 'Cannot delete reserved secret: OPENAI_API_KEY'
                statusCode: 403
        '404':
          description: Secret not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: NOT_FOUND
                message: 'Secret not found: INVALID_KEY'
                statusCode: 404
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling
          example: INVALID_INPUT
        message:
          type: string
          description: Human-readable error message
          example: Invalid input data
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        nextActions:
          type: string
          description: Suggested action to resolve the error
          example: Check the request body format
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````