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

# Check function

> Run a function's saved code on test cases and compare the results.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/function/{functionID}/check
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/function/{functionID}/check:
    post:
      tags:
        - Function
      summary: Check function
      description: Run a function's saved code on test cases and compare the results.
      operationId: StableFunctionController_check
      parameters:
        - name: functionID
          required: true
          in: path
          schema:
            type: string
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableFunctionCheckRequest"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableFunctionCheckResponse"
      security:
        - token: []
components:
  schemas:
    StableFunctionCheckRequest:
      type: object
      properties:
        cases:
          minItems: 1
          maxItems: 12
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 80
                description: What this case checks, e.g. "3 items, at the limit".
              inputs:
                type: object
                additionalProperties:
                  type: string
                description: A text value for every input of the function, by input name, as a
                  variable sends it. Send "0" for what an unset variable sends.
              expectPath:
                description: The exit path this case should take. The result says whether it
                  did.
                type: string
              expectOutputs:
                description: Output values this case should return, compared as text.
                type: object
                additionalProperties:
                  type: string
            required:
              - name
              - inputs
            additionalProperties: false
      required:
        - cases
      additionalProperties: false
    StableFunctionCheckResponse:
      oneOf:
        - type: object
          properties:
            checked:
              type: boolean
              enum:
                - false
              x-enumNames:
                - "FALSE"
            reason:
              type: string
          required:
            - checked
            - reason
        - type: object
          properties:
            checked:
              type: boolean
              enum:
                - true
              x-enumNames:
                - "TRUE"
            functionID:
              type: string
            summary:
              type: string
            cases:
              type: array
              items:
                $ref: "#/components/schemas/StableFunctionCheckCaseResult"
          required:
            - checked
            - functionID
            - summary
            - cases
    StableFunctionCheckCaseResult:
      type: object
      properties:
        name:
          type: string
        ran:
          type: boolean
        success:
          type: boolean
        path:
          nullable: true
          type: string
        outputs:
          type: object
          additionalProperties: {}
        error:
          nullable: true
          type: string
        matched:
          type: boolean
        mismatches:
          type: array
          items:
            type: string
        uncompared:
          description: Expected outputs left uncompared because the run cut a long value.
          type: array
          items:
            type: string
      required:
        - name
        - ran
        - success
        - path
        - outputs
        - error
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
