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

# Upload Source Table

> Register an uploaded parquet relation and hand back a presigned PUT.

One call does both server-side halves of the upload flow: mint a presigned PUT
into the platform's own bucket and persist the ``source_table`` row pointing at
where the bytes will land. The caller then PUTs the parquet to ``upload_url``.

The row is a *managed* upload: ``connector_type`` is ``file_upload`` and
``credential_id`` is NULL — there is no per-upload connector. Reads resolve the
platform's own S3 credentials (``S3ConnectorService.managed_config``) off that
sentinel.

The parquet footer is *not* validated here (unlike ``create_source_table``) —
the object does not exist yet; the schema is derived on demand once the upload
lands.



## OpenAPI

````yaml https://api.outerproduct.com/openapi.json post /v1/source_tables/upload
openapi: 3.1.0
info:
  title: OuterProduct API
  description: >-
    Public-facing REST API for OuterProduct model distillation, prediction, and
    explanation.
  version: 0.1.8
servers: []
security: []
paths:
  /v1/source_tables/upload:
    post:
      tags:
        - source_tables
      summary: Upload Source Table
      description: >-
        Register an uploaded parquet relation and hand back a presigned PUT.


        One call does both server-side halves of the upload flow: mint a
        presigned PUT

        into the platform's own bucket and persist the ``source_table`` row
        pointing at

        where the bytes will land. The caller then PUTs the parquet to
        ``upload_url``.


        The row is a *managed* upload: ``connector_type`` is ``file_upload`` and

        ``credential_id`` is NULL — there is no per-upload connector. Reads
        resolve the

        platform's own S3 credentials (``S3ConnectorService.managed_config``)
        off that

        sentinel.


        The parquet footer is *not* validated here (unlike
        ``create_source_table``) —

        the object does not exist yet; the schema is derived on demand once the
        upload

        lands.
      operationId: upload_source_table_v1_source_tables_upload_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSourceTableUploadRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSourceTableUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateSourceTableUploadRequest:
      properties:
        table_name:
          type: string
          maxLength: 63
          minLength: 1
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          title: SQLIdentifier
      type: object
      required:
        - table_name
      title: CreateSourceTableUploadRequest
    CreateSourceTableUploadResponse:
      properties:
        source_table:
          $ref: '#/components/schemas/SourceTableResponse'
        upload_url:
          type: string
          title: Upload Url
        content_type:
          type: string
          title: Content Type
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
        - source_table
        - upload_url
        - content_type
        - expires_in
      title: CreateSourceTableUploadResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SourceTableResponse:
      properties:
        id:
          $ref: '#/components/schemas/ID'
        short_id:
          type: string
          title: Short Id
        table_name:
          type: string
          title: Table Name
        connector_type:
          $ref: '#/components/schemas/ConnectorType'
        location:
          $ref: '#/components/schemas/SourceTableLocation'
      type: object
      required:
        - id
        - short_id
        - table_name
        - connector_type
        - location
      title: SourceTableResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ID:
      anyOf:
        - type: string
          format: uuid
        - type: string
    ConnectorType:
      type: string
      enum:
        - s3
        - snowflake
        - databricks
        - file_upload
      title: ConnectorType
    SourceTableLocation:
      anyOf:
        - $ref: '#/components/schemas/S3SourceLocation'
        - $ref: '#/components/schemas/SnowflakeSourceLocation'
    S3SourceLocation:
      properties:
        uri:
          type: string
          minLength: 1
          format: uri
          title: Uri
        file_format:
          type: string
          const: parquet
          title: File Format
          default: parquet
      type: object
      required:
        - uri
      title: S3SourceLocation
    SnowflakeSourceLocation:
      properties:
        database:
          type: string
          maxLength: 63
          minLength: 1
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          title: SQLIdentifier
        schema_name:
          type: string
          maxLength: 63
          minLength: 1
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          title: SQLIdentifier
        table_name:
          type: string
          maxLength: 63
          minLength: 1
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          title: SQLIdentifier
      type: object
      required:
        - database
        - schema_name
        - table_name
      title: SnowflakeSourceLocation
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key or OAuth2/OIDC access token
      description: >-
        An API key or OAuth2/OIDC access token sent as `Authorization: Bearer
        <token>`.

````