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

# connector.functions.test(side, request): runs the saved function or a draft; records and publishes nothing; an outbound test delivers for real



## OpenAPI

````yaml /api-reference/openapi.json post /connectors/{idOrName}/functions/{side}/test
openapi: 3.1.0
info:
  title: paddock API
  version: 1.0.0
  description: >-
    The paddock API. Send an API key, or a session token on its own session, as
    a bearer token.
servers:
  - url: https://api.paddock.build/v1
security:
  - bearer: []
paths:
  /connectors/{idOrName}/functions/{side}/test:
    post:
      summary: >-
        connector.functions.test(side, request): runs the saved function or a
        draft; records and publishes nothing; an outbound test delivers for real
      operationId: testConnectorFunction
      parameters:
        - $ref: '#/components/parameters/ConnectorIdOrName'
        - $ref: '#/components/parameters/FunctionSide'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunctionTestRequest'
      responses:
        '200':
          description: The result
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTest'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    ConnectorIdOrName:
      name: idOrName
      in: path
      required: true
      description: The connector's ID, or for connectors.get its name
      schema:
        type: string
    FunctionSide:
      name: side
      in: path
      required: true
      description: The connector's side
      schema:
        $ref: '#/components/schemas/FunctionSide'
  schemas:
    FunctionTestRequest:
      description: >-
        Inbound: a sample request, or a recorded delivery's request; outbound: a
        message delivered for real. With a draft, the draft runs instead of the
        saved version.
      type: object
      additionalProperties: false
      properties:
        event:
          $ref: '#/components/schemas/FunctionTestEvent'
        deliveryId:
          type: string
          pattern: ^dlv_[0-7][0-9a-hjkmnp-tv-z]{25}$
        replay:
          description: 'With deliveryId: run as a replay would, with ctx.replay set.'
          type: boolean
        message:
          $ref: '#/components/schemas/DeliverTestMessage'
        draft:
          $ref: '#/components/schemas/FunctionDraft'
    FunctionTest:
      type: object
      required:
        - side
        - version
        - result
        - answer
        - dedupeKey
        - routes
        - response
        - externalId
        - retryAfter
        - code
        - reason
        - error
        - durationMs
        - logs
      properties:
        side:
          $ref: '#/components/schemas/FunctionSide'
        version:
          description: The saved version that ran; null for a draft.
          type:
            - integer
            - 'null'
        result:
          $ref: '#/components/schemas/FunctionResult'
        answer:
          description: >-
            Inbound: the HTTP status a real request would have been answered
            with.
          type:
            - integer
            - 'null'
        dedupeKey:
          type:
            - string
            - 'null'
          description: Inbound accept.
        routes:
          description: 'Inbound accept: what a real request would deliver.'
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/Route'
            - type: 'null'
        response:
          oneOf:
            - $ref: '#/components/schemas/FunctionResponse'
            - type: 'null'
        externalId:
          type:
            - string
            - 'null'
          description: Outbound ok.
        retryAfter:
          description: 'Outbound retryable: seconds.'
          type:
            - integer
            - 'null'
        code:
          type:
            - string
            - 'null'
          description: Outbound permanent.
        reason:
          type:
            - string
            - 'null'
          description: Inbound reject; outbound retryable and permanent.
        error:
          type:
            - string
            - 'null'
          description: error and timeout, and an answer outside the contract.
        durationMs:
          type: integer
          minimum: 0
        logs:
          description: The last 4 KiB the code wrote to its standard output and error.
          type: string
    FunctionSide:
      type: string
      enum:
        - inbound
        - outbound
    FunctionTestEvent:
      type: object
      additionalProperties: false
      required:
        - body
      properties:
        method:
          type: string
          enum:
            - POST
        query:
          type: object
          additionalProperties:
            type: string
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          description: The raw body.
          type: string
        bodyEncoding:
          description: Default utf8.
          type: string
          enum:
            - utf8
            - base64
    DeliverTestMessage:
      type: object
      additionalProperties: false
      required:
        - address
        - text
      properties:
        address:
          description: The key is the connector's name, ":", and this.
          type: string
        text:
          type: string
        attachments:
          description: URLs the function downloads, as given.
          type: array
          items:
            $ref: '#/components/schemas/DeliverTestAttachment'
    FunctionDraft:
      description: >-
        Unsaved code to run instead of the saved version, checked as set checks
        code.
      type: object
      additionalProperties: false
      required:
        - runtime
        - code
      properties:
        runtime:
          $ref: '#/components/schemas/FunctionRuntime'
        code:
          type: string
        params:
          type: object
          additionalProperties:
            type: string
          description: 'Default: none.'
    FunctionResult:
      type: string
      enum:
        - accept
        - respond
        - reject
        - ok
        - retryable
        - permanent
        - error
        - timeout
    Route:
      description: One entry of an inbound function's deliver list.
      type: object
      required:
        - agent
        - sessionKey
        - message
      properties:
        agent:
          description: An agent's ID.
          type: string
        sessionKey:
          type:
            - string
            - 'null'
          description: 'null: a new session.'
        replyTo:
          description: 'A reply match: the external ID of the message the event answers.'
          type: string
        matchOnly:
          description: 'With replyTo: deliver only to the matched session.'
          type: boolean
        message:
          type: string
        replyKey:
          description: Becomes the session's reply key when delivered.
          type: string
        settings:
          $ref: '#/components/schemas/SessionSettings'
    FunctionResponse:
      description: A handshake's answer.
      type: object
      required:
        - status
        - headers
        - body
      properties:
        status:
          type: integer
          minimum: 200
          maximum: 299
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
    ErrorBody:
      description: The body of every non-2xx response.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    DeliverTestAttachment:
      type: object
      additionalProperties: false
      required:
        - name
        - contentType
        - url
      properties:
        name:
          type: string
        contentType:
          type: string
        url:
          type: string
    FunctionRuntime:
      description: AWS Lambda's runtime identifiers.
      type: string
      enum:
        - nodejs24.x
        - python3.14
    SessionSettings:
      description: >-
        As agent.sessions.create takes them; used only when a session is
        created. connectorKey is the route's and refused in metadata.
      type: object
      additionalProperties: false
      properties:
        cwd:
          type: string
        systemPrompt:
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
    ErrorObject:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
        details:
          type: object
    Metadata:
      description: The customer's own string keys and values; never case-converted.
      type: object
      additionalProperties:
        type: string
    ErrorCode:
      type: string
      enum:
        - invalid_request
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - payload_too_large
        - unsupported
        - unavailable
        - internal
  headers:
    RequestId:
      description: The request's ID, for support and logs
      schema:
        type: string
  responses:
    Error:
      description: Every non-2xx response
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key, or a session token on its own session

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.