> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a function secret

> Permanently deletes a secret from a function. This action cannot be undone.



## OpenAPI

````yaml api/legacy/openapi-functions.yaml delete /functions/{function_id}/secrets/{secret_name}
openapi: 3.0.3
info:
  title: Kapso External API - Functions and App Accounts API
  description: >-
    API for programmatically managing and invoking Kapso Functions, and for
    making API calls to connected app accounts through the Pipedream proxy. This
    specification includes all Functions and App Accounts API endpoints.
  version: 1.0.0
  contact:
    name: Kapso Support
servers:
  - url: https://app.kapso.ai/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /functions/{function_id}/secrets/{secret_name}:
    delete:
      tags:
        - Function Secrets
      summary: Delete a function secret
      description: >-
        Permanently deletes a secret from a function. This action cannot be
        undone.
      operationId: deleteFunctionSecret
      parameters:
        - name: function_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: secret_name
          in: path
          required: true
          schema:
            type: string
            example: API_KEY
      responses:
        '204':
          description: Secret deleted successfully
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Function not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Function must be deployed before managing secrets
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Function must be deployed before managing secrets
        '502':
          description: Failed to delete secret from function platform
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: Resource not found
        status:
          type: integer
          example: 404
        message:
          type: string
          example: The requested resource could not be found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required for all endpoints

````