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

# Load Connector Data

> Execute a SQL query against a connector and load the results into the sandbox as a pandas DataFrame

<Note>
  **v2 available:** See [POST /v2/sandcastles/{id}/query](/api-reference/v2/sandbox/load-connector-data) for the REST-native version of this endpoint.
</Note>


## OpenAPI

````yaml POST /v1/sandbox/query
openapi: 3.1.0
info:
  title: textql.rpc.platform
  version: '1.0'
servers: []
security: []
tags:
  - name: textql.rpc.platform.SandboxService
    description: >-
      Platform Sandbox Service - External API for creating and managing Python
      sandbox environments
paths:
  /v1/sandbox/query:
    post:
      tags:
        - textql.rpc.platform.SandboxService
      summary: LoadConnectorData
      description: >-
        Execute a SQL query against a connector and load the results into the
        sandbox as a pandas DataFrame
      operationId: textql.rpc.platform.SandboxService.LoadConnectorData
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/textql.rpc.platform.LoadConnectorDataRequest
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/textql.rpc.platform.LoadConnectorDataResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
components:
  schemas:
    connect-protocol-version:
      type: number
      title: Connect-Protocol-Version
      enum:
        - 1
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    textql.rpc.platform.LoadConnectorDataRequest:
      type: object
      properties:
        sandboxId:
          type: string
          title: sandbox_id
        connectorId:
          type: integer
          title: connector_id
          format: int32
        query:
          type: string
          title: query
          description: SQL query to execute against the connector
        dataframeName:
          type: string
          title: dataframe_name
          description: >-
            Optional name for the resulting DataFrame. Auto-generated if not
            provided.
          nullable: true
      required:
        - sandboxId
        - connectorId
        - query
      title: LoadConnectorDataRequest
      additionalProperties: false
    textql.rpc.platform.LoadConnectorDataResponse:
      type: object
      properties:
        dataframeName:
          type: string
          title: dataframe_name
        numRows:
          type: integer
          title: num_rows
          format: int64
        numCols:
          type: integer
          title: num_cols
          format: int64
        preview:
          type: string
          title: preview
          description: Text preview of the loaded data
      title: LoadConnectorDataResponse
      additionalProperties: false
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/connect.error_details.Any'
          description: >-
            A list of messages that carry the error details. There is no limit
            on the number of messages.
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    connect.error_details.Any:
      type: object
      properties:
        type:
          type: string
          description: >-
            A URL that acts as a globally unique identifier for the type of the
            serialized message. For example:
            `type.googleapis.com/google.rpc.ErrorInfo`. This is used to
            determine the schema of the data in the `value` field and is the
            discriminator for the `debug` field.
        value:
          type: string
          format: binary
          description: >-
            The Protobuf message, serialized as bytes and base64-encoded. The
            specific message type is identified by the `type` field.
        debug:
          oneOf:
            - type: object
              title: Any
              additionalProperties: true
              description: Detailed error information.
          discriminator:
            propertyName: type
          title: Debug
          description: >-
            Deserialized error detail payload. The 'type' field indicates the
            schema. This field is for easier debugging and should not be relied
            upon for application logic.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message, with an additional debug
        field for ConnectRPC error details.

````