Assets

Import code or a dataset

Import a GitHub repository, a Hugging Face dataset repository, or a public HTTPS file or archive. GitHub imports can use the team's connected GitHub account. URL imports use signed links for private downloads and reject tokens. GitHub, Hugging Face and URL imports may take up to ten minutes. It has no idempotency contract. After a timeout, inspect the asset list before repeating the request. Database connection queries return 202 after durable admission and export to Parquet or CSV in bounded workers. Poll the returned asset until ready or failed. Execution including queue time is bounded to ten minutes. reuse may return a ready export from the last 24 hours. New requests otherwise create fresh assets. Failed exports expose a safe error and retain their storage reservation until object cleanup succeeds.

post/v1/assets/import

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Request body

kind'github' | 'huggingface' | 'url' | 'connection_query' required
urlstring

Public HTTPS direct download URL for kind=url. Private downloads use signed links.

repostring

owner/name for GitHub or a Hugging Face dataset. Matching HTTPS repository URLs are also accepted.

refstring

Repository revision. Omitted or empty selects main. Carriage returns and newlines are rejected.

filesstring[] nullable

Hugging Face dataset file patterns. Omitted selects recognized data file extensions. GitHub imports include the repository archive.

tokenstring

Optional GitHub or Hugging Face credential. Rejected for URL imports.

connection_idstring

Database connection name or ID for connection_query. Requires read or readwrite scope and an active pinned credential.

sqlstring

One SELECT or WITH statement, executed in a read-only transaction with a ten-minute timeout.

format'parquet' | 'csv'
branchstring

Optional Neon branch assertion. Must match the branch already verified on the connection.

reuseboolean

Reuse an eligible ready export for this tenant, connection, exact SQL apart from outer whitespace, branch and format from the last 24 hours.

Response

Eligible query export reused

idstring
kindstring

Includes workspace_source for a generated workspace project revision. These copies use their separate included source pool.

namestring
statestring

Current asset state: importing, ready, failed, deleting or deleted.

revisionstring
sha256string
stored_bytesinteger
imported_bytesinteger
created_atstring date-time
ready_atstring date-time nullable
deleted_atstring date-time nullable
errorstring

Value-free terminal query export error. Failed assets remain observable after cleanup, with zero stored bytes once their reservation is released.

Changes

No recorded changes to this operation across all 70 revisions of this API.