> ## 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.

# List functions

> Retrieve all serverless functions for your project. Functions are custom JavaScript code that runs on-demand in response to API invocations.

Use this endpoint to:
- List all configured functions
- Review function deployment status
- Audit function creation and updates




## OpenAPI

````yaml /api/platform/v1/openapi-workflows.yaml get /functions
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:
    get:
      tags:
        - Functions
      summary: List functions
      description: >
        Retrieve all serverless functions for your project. Functions are custom
        JavaScript code that runs on-demand in response to API invocations.


        Use this endpoint to:

        - List all configured functions

        - Review function deployment status

        - Audit function creation and updates
      operationId: listFunctions
      responses:
        '200':
          description: Functions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionListResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    FunctionListResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Function'
      description: List of functions for the project
    Function:
      type: object
      required:
        - id
        - name
        - slug
        - status
        - function_type
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique function identifier
        name:
          type: string
          description: Function display name (user-friendly identifier)
        slug:
          type: string
          description: >
            URL-safe function identifier (lowercase alphanumeric with hyphens).
            Used in endpoint URLs. Must match pattern: /^[a-z0-9-]+$/
          pattern: ^[a-z0-9-]+$
          example: calculate-shipping-cost
        lock_version:
          type: integer
          description: >
            Optimistic locking version. Increments on each update. Include this
            value on update to detect concurrent modifications — stale values
            return `409 Conflict`.
          example: 0
        description:
          type:
            - string
            - 'null'
          description: Optional function description explaining purpose and usage
        code:
          type: string
          description: >
            JavaScript function code. Maximum size: 1 megabyte. This is the
            actual code that will execute when the function is invoked. Must be
            valid JavaScript that can run in the target environment (Cloudflare
            Workers or Supabase Edge Functions).
        version:
          type:
            - integer
            - 'null'
          description: >
            Function version number. Increments with each deployment. Use this
            to track which version is currently deployed in production.
        status:
          type: string
          enum:
            - draft
            - deployed
            - error
          description: |
            Deployment status:
            - `draft`: Function code saved but not yet deployed to runtime
            - `deployed`: Successfully deployed and available for invocation
            - `error`: Deployment failed (check error logs for details)
        last_deployed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp of most recent successful deployment, null if never
            deployed
        function_type:
          type: string
          enum:
            - cloudflare_worker
            - supabase_function
          description: >
            Serverless runtime platform:

            - `cloudflare_worker`: Deploys to Cloudflare Workers (global edge
            network)

            - `supabase_function`: Deploys to Supabase Edge Functions (Deno
            runtime)
        invoke_response_mode:
          type: string
          enum:
            - wrapped
            - passthrough
          default: passthrough
          description: >
            Controls how successful invoke responses are returned:

            - `wrapped`: Legacy behavior. Successful JSON responses are nested
            under `data`.

            - `passthrough`: Kapso forwards the function response body, status
            code, and `Content-Type` directly.


            Existing functions may still be `wrapped`. Newly created functions
            default to `passthrough`.
        public_endpoint:
          type: boolean
          default: false
          description: >
            Whether the invoke endpoint can be called without an API key. Only
            supported for `cloudflare_worker` functions.

            When `true`, Kapso serves the function through the Platform API
            invoke route and anonymous requests are allowed.
        runtime_config:
          type:
            - object
            - 'null'
          description: >
            Platform-specific runtime configuration. Structure varies by
            function_type. Use this to configure environment variables, resource
            limits, or platform-specific features.
          additionalProperties: true
        endpoint_url:
          type:
            - string
            - 'null'
          format: uri
          description: >
            Invocation URL for this function. Computed based on `function_type`.

            - `cloudflare_worker`:
            `https://api.kapso.ai/platform/v1/functions/{function_id}/invoke`

            - `supabase_function`: Direct Supabase Edge Function URL


            For private Cloudflare functions, include `X-API-Key`. For public
            Cloudflare functions (`public_endpoint=true`), the API key is
            optional.
          example: https://api.kapso.ai/platform/v1/functions/{function_id}/invoke
        project_id:
          type: string
          format: uuid
          description: Project this function belongs to
        created_by_id:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of user who created this function
        created_at:
          type: string
          format: date-time
          description: Function creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last modification timestamp
      description: >
        Serverless function configuration. Functions are custom JavaScript code
        that runs on-demand in response to API invocations. Deploy functions to
        either Cloudflare Workers (global edge network) or Supabase Edge
        Functions (Deno runtime).
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message
  responses:
    UnauthorizedError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````