canonical: https://jentic.com/apis/basespace.illumina.com/basespace-illumina

# Basespace Illumina Illumina BaseSpace API

BaseSpace Sequence Hub is Illumina's cloud platform for genomic sequencing data, and the BaseSpace API exposes programmatic access to runs, projects, samples, files, and app results. It supports authenticated lookup of the current user, listing and management of sequencing projects, retrieval of FASTQ and BAM file content, and OAuth 2.0 token issuance for app integrations. The API is the standard integration point for bioinformatics pipelines, LIMS systems, and analysis tooling that need to read or write data alongside an Illumina sequencer.

## For AI agents

Browse and manage Illumina sequencing runs, projects, samples, and files in BaseSpace Sequence Hub. Useful for agents automating bioinformatics pipelines or sample tracking.

## Scope

Does not handle variant calling, alignment, or sequencing instrument control - use for browsing and managing runs, projects, samples, and files in BaseSpace Sequence Hub only.

## Capabilities

- Look up the authenticated user and list their associated sequencing runs
- Create and manage projects that group sequencing samples and analyses
- Retrieve sample metadata and download FASTQ or BAM file content
- List app results produced by BaseSpace analysis apps for a given project
- Issue OAuth 2.0 access tokens for app integrations using POST /oauthv2/token
- Delete obsolete runs, samples, or app results to manage storage

## Use cases

### Bioinformatics Pipeline Ingestion

An automated pipeline needs to pick up newly completed sequencing runs and pull the resulting FASTQ files into a downstream analysis system. The BaseSpace API exposes GET /users/current/runs for run discovery, GET /runs/{id}/files to enumerate outputs, and GET /files/{id}/content to stream the data. Projects with hundreds of samples can be processed by paging through the listing endpoints.

Example prompt: Call GET /users/current/runs, find the most recent completed run, list its files via GET /runs/{id}/files, and stream each file with GET /files/{id}/content

### Sample and Project Management

Lab managers organising sequencing output by study or cohort can use the API to create projects, attach samples, and tear down completed work. Endpoints include POST /projects to create a project, GET /projects/{id}/samples to list its samples, and DELETE /samples/{id} or DELETE /projects/{id} to clean up. The flow integrates with LIMS systems that treat BaseSpace as the storage tier for sequencing output.

Example prompt: Call POST /projects to create a project named cohort-A, then list samples with GET /projects/{id}/samples and delete any flagged with QC failures via DELETE /samples/{id}

### App Result Retrieval

BaseSpace apps run analyses (alignment, variant calling, QC) and write results back into projects as app results. Downstream systems can list these via GET /projects/{id}/appresults and fetch specific outputs with GET /appresults/{id}, allowing automated reporting tools to surface variant calls or QC summaries without manual export from the BaseSpace UI.

Example prompt: Call GET /projects/{id}/appresults for a project, fetch each app result with GET /appresults/{id}, and post a summary into the lab notebook

### Agent-Driven Sample Lookup via Jentic

An AI agent embedded in a lab assistant tool can use BaseSpace through Jentic to answer scientist questions like 'show me the latest run for sample X' without the operator hand-rolling auth. Jentic isolates the OAuth 2.0 access token in its vault and exposes the 29 BaseSpace operations as discoverable tools, mapped to natural-language search queries.

Example prompt: Search Jentic for 'list sequencing runs for current user', load the GET /users/current/runs schema, and execute to return the latest run summary

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /users/current/runs | List sequencing runs for the authenticated user |
| GET | /runs/{id} | Fetch metadata for a specific run |
| POST | /projects | Create a new BaseSpace project |
| GET | /projects/{id}/samples | List samples within a project |
| GET | /files/{id}/content | Stream the binary content of a file |
| GET | /projects/{id}/appresults | List analysis app results in a project |
| POST | /oauthv2/token | Issue an OAuth 2.0 access token |

## Key resources

- **Users** — Look up the authenticated user via GET /users/current and their runs
- **Runs** — List, fetch, and delete sequencing runs and their associated files
- **Projects** — Create, list, fetch, and delete projects that group samples
- **Samples** — Fetch and delete samples; list samples within a project
- **Files** — List files attached to runs or samples and stream file content
- **AppResults** — List and fetch outputs produced by BaseSpace analysis apps
- **OAuth** — Issue and inspect OAuth 2.0 access tokens for app integrations

## Why Jentic

- **Setup:** Wiring the Illumina BaseSpace API by hand means running the OAuth 2.0 token exchange, carrying the bearer token or apiKey on every call, and threading run, project, and file ids through the browse endpoints yourself. Through Jentic you install once, import the BaseSpace API from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** BaseSpace puts the resource id in the URL path (/projects/{id}/samples, /runs/{id}, /files/{id}/content), so a rule can pin your agent to one project: it reads that project's samples and files and nothing else. You choose the operations it may call, so project creation is not included unless you add it.
- **Credential handling:** Your BaseSpace OAuth access token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list sequencing runs' or 'download a file', and Jentic returns the matching BaseSpace operation with its input schema and parameter requirements so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Baseten API** — ML model deployment - pair with BaseSpace to serve genomics models on top of sequencing data
- **Basesnap API** — Database snapshot service - useful for snapshotting LIMS databases that index BaseSpace samples
- **BC Laws** — Unrelated domain; included because no genomics-API competitor exists in the corpus

## FAQ

### What authentication does the Illumina BaseSpace API use?

BaseSpace uses OAuth 2.0 bearer tokens, with an additional access token header scheme available. Issue a token via POST /oauthv2/token, then pass it as Authorization: Bearer <token>. Through Jentic the token is stored encrypted in the vault and never enters the agent's context.

### Can I download FASTQ files with the Illumina BaseSpace API?

Yes. List a sample's files via GET /samples/{id}/files, then stream each file with GET /files/{id}/content. Files are returned as their native binary format (FASTQ, BAM, etc.) - for large files, use range requests or streaming clients.

### How do I list a user's sequencing runs through Jentic?

Search Jentic for 'list sequencing runs for current user', which surfaces GET /users/current/runs. Load the schema and execute. Jentic returns a paginated list of runs the authenticated BaseSpace user owns or has access to.

### What are the rate limits for the BaseSpace API?

The OpenAPI spec does not declare explicit rate limits. Illumina applies per-account quotas and may throttle large file downloads - check the BaseSpace developer portal for current limits before running batch ingestion.

### Can I create a new project with the BaseSpace API?

Yes. Call POST /projects with the project name and description. The response returns the new project ID, which you can pass to GET /projects/{id}/samples or POST /projects/{id}/appresults to attach related resources.

### Does the BaseSpace API support deleting old runs and samples?

Yes. The API exposes DELETE /runs/{id}, DELETE /samples/{id}, DELETE /projects/{id}, and DELETE /appresults/{id}. Use these carefully - deletion is generally irreversible and will free associated file storage.

### Can I limit what my agent is allowed to do with the Illumina BaseSpace API?

Yes. Because you self-host Jentic One, your own rules decide which BaseSpace operations and credentials the agent may use. Since BaseSpace carries the resource id in the URL path (/runs/{id}, /projects/{id}/samples, /files/{id}/content), you can pin the agent to a single project so it reads only that project's samples and files and nothing else. You also pick which operations it can call, so destructive or write actions like POST /projects, DELETE /samples/{id}, or DELETE /runs/{id} stay off limits unless you explicitly grant them.
