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

# Dry run a function

> Starts an asynchronous dry run for TypeScript function source code against a connection without deploying it.

<Info>
  Requires an API key with the `environment:functions:dryrun` scope. [Learn more about API key scopes](/reference/backend/http-api/api-keys#scopes).
</Info>

Starts an asynchronous dry run for TypeScript function source code against a connection without deploying it.


## OpenAPI

````yaml POST /functions/dryruns
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /functions/dryruns:
    post:
      summary: Dry run a function
      description: >-
        Starts an asynchronous dry run for TypeScript function source code
        against a connection without deploying it.
      operationId: createFunctionDryrun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunctionDryrunRequest'
      responses:
        '202':
          description: Successfully started the dry run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionDryrunCreateResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  schemas:
    FunctionDryrunRequest:
      type: object
      additionalProperties: false
      required:
        - integration_id
        - function_type
        - code
        - connection_id
      properties:
        integration_id:
          type: string
          description: The integration ID (unique_key) that you created in Nango.
        function_type:
          $ref: '#/components/schemas/RunnableFunctionType'
        code:
          type: string
          minLength: 1
          description: The TypeScript source code for the function.
        connection_id:
          type: string
          description: The connection ID to use for the dry run.
        input:
          description: Optional JSON input payload passed to the function.
        metadata:
          type: object
          additionalProperties: true
          description: Optional metadata available to the function during the dry run.
        checkpoint:
          type: object
          additionalProperties: true
          description: >-
            Optional checkpoint payload available to sync functions during the
            dry run.
        last_sync_date:
          type: string
          format: date-time
          description: >-
            Optional last sync date available to sync functions during the dry
            run.
    FunctionDryrunCreateResponse:
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - waiting
            - running
        created_at:
          type: string
          format: date-time
    RunnableFunctionType:
      type: string
      enum:
        - action
        - sync
    StdError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
            errors:
              type: array
              items:
                type: object
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    ServiceUnavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    GatewayTimeout:
      description: Gateway timeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The secret key from your Nango environment.

````