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

# Preview the output of a Code Action.

> Preview the output of a Code Action. This endpoint is useful for testing a Code Action.




## OpenAPI

````yaml post /organisations/{organisationId}/boards/{boardId}/actors/{actorId}/code/preview
openapi: 3.0.3
info:
  title: Switchboard API
  description: >-
    The Switchboard API provides users the ability to manage their Apps,
    Integrations and Workflows
  version: 0.0.1-alpha.0
servers:
  - url: https://platform.versori.com/api/switchboard/v1alpha1/
    description: Production server
  - url: http://localhost:8080/v1alpha1/
    description: Localhost
security:
  - apiKey: []
paths:
  /organisations/{organisationId}/boards/{boardId}/actors/{actorId}/code/preview:
    post:
      tags:
        - boards
        - code
      summary: Preview the output of a Code Action.
      description: >
        Preview the output of a Code Action. This endpoint is useful for testing
        a Code Action.
      operationId: PreviewCodeAction
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
        - name: boardId
          in: path
          required: true
          schema:
            type: string
        - name: actorId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/CodePreviewRequest'
      responses:
        '200':
          $ref: '#/components/responses/CodePreviewResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  requestBodies:
    CodePreviewRequest:
      description: |
        Payload to pass configuration and preview input data to the Code Action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CodePreviewInput'
  responses:
    CodePreviewResponse:
      description: |
        The processed data from the code action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CodePreviewOutput'
    ErrorResponse:
      description: The default error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    CodePreviewInput:
      type: object
      properties:
        selectors:
          type: object
          description: The selector data form the code action.
        data:
          type: object
          description: The input data form the code action.
        code:
          type: string
          description: The code data form the code action.
        userId:
          type: string
          description: Id of the user.
      required:
        - selectors
        - data
        - code
        - userId
    CodePreviewOutput:
      type: object
      properties:
        output:
          type: object
          description: The output data from the transformer.
        executionId:
          type: string
          description: Id of the execution that can be used to search logs.
      required:
        - output
        - executionId
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        extensions:
          type: object
      required:
        - code
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization

````