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

# Delete function

> Permanently delete a serverless function. This will also remove the function from the runtime platform and delete all associated secrets.

After deletion:
- Function will be removed from Cloudflare Workers or Supabase Edge Functions
- All function secrets are automatically deleted
- Function endpoint URL will return 404
- Function invocation records are preserved for audit history

This operation cannot be undone. Make sure to backup function code if needed before deletion.




## OpenAPI

````yaml /api/platform/v1/openapi-workflows.yaml delete /functions/{function_id}
openapi: 3.1.0
info:
  title: Kapso Platform API – Advanced Resources
  version: 0.1.0
  description: >
    Build WhatsApp automation workflows and serverless functions. Create
    multi-step conversation flows, inspect executions, and deploy custom logic.
servers:
  - url: https://api.kapso.ai/platform/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Workflows
    description: Create and manage conversation workflows and executions
  - name: Workflow Triggers
    description: Configure workflow triggers to automate execution
  - name: Functions
    description: Manage serverless functions, deployments, and secrets
  - name: WhatsApp Conversations
    description: Query WhatsApp conversation data and related resources
paths:
  /functions/{function_id}:
    parameters:
      - name: function_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Function identifier
    delete:
      tags:
        - Functions
      summary: Delete function
      description: >
        Permanently delete a serverless function. This will also remove the
        function from the runtime platform and delete all associated secrets.


        After deletion:

        - Function will be removed from Cloudflare Workers or Supabase Edge
        Functions

        - All function secrets are automatically deleted

        - Function endpoint URL will return 404

        - Function invocation records are preserved for audit history


        This operation cannot be undone. Make sure to backup function code if
        needed before deletion.
      operationId: deleteFunction
      responses:
        '204':
          description: Function deleted successfully (no content returned)
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  responses:
    UnauthorizedError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````