> ## 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 function secrets

> Retrieve all secret names configured for this function. Secret values are NEVER included in list responses for security.

Secrets are injected as environment variables when your function executes. Use this endpoint to:
- Audit which secrets are configured
- Verify secret names before creating new ones
- Check secret types (text, json, inherited)

Important: If the function is not deployed, this endpoint returns an empty array. Secrets can only be managed for deployed functions.

Secret values are only returned once when creating a secret via POST /functions/{id}/secrets. After creation, values cannot be retrieved - only the secret name and type are visible.




## OpenAPI

````yaml /api/platform/v1/openapi-workflows.yaml get /functions/{function_id}/secrets
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}/secrets:
    parameters:
      - name: function_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Function identifier
    get:
      tags:
        - Functions
      summary: List function secrets
      description: >
        Retrieve all secret names configured for this function. Secret values
        are NEVER included in list responses for security.


        Secrets are injected as environment variables when your function
        executes. Use this endpoint to:

        - Audit which secrets are configured

        - Verify secret names before creating new ones

        - Check secret types (text, json, inherited)


        Important: If the function is not deployed, this endpoint returns an
        empty array. Secrets can only be managed for deployed functions.


        Secret values are only returned once when creating a secret via POST
        /functions/{id}/secrets. After creation, values cannot be retrieved -
        only the secret name and type are visible.
      operationId: listFunctionSecrets
      responses:
        '200':
          description: Secrets retrieved successfully (values not included)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionSecretListResponse'
              example:
                data:
                  - name: STRIPE_API_KEY
                    type: text
                  - name: DATABASE_CONFIG
                    type: json
                  - name: API_ENDPOINT
                    type: inherited
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '502':
          description: Error communicating with Cloudflare API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Failed to retrieve secrets from Cloudflare
components:
  schemas:
    FunctionSecretListResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - name
              - type
            properties:
              name:
                type: string
                description: Secret name
              type:
                type: string
                enum:
                  - text
                  - json
                  - inherited
                description: Secret value type
      description: >
        List of function secrets. Note: Secret values are never included in list
        responses for security. Values are only returned when creating a secret.
    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'
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````