API reference

Every path below is relative to https://blueprint.love. The API is not versioned, so an endpoint can change without notice.

This page was last checked against the server code on .

Conventions

Requests and responses are JSON unless an endpoint says it returns a file. JSON responses share one envelope:

code
The HTTP status as a number. A queued job answers HTTP 202 but still carries 200 here. One exception: a busy /api/plot/generate answers 503 with the string "PLOT_BUSY".
message
A short summary: usually success, otherwise what happened or what went wrong. Check code or the HTTP status, not this text.
data
The result. Absent on errors.
timestamp
Server time in Unix seconds. On a job-creation answer it is the job's creation time as an RFC 3339 string instead, so do not rely on its type.

An error looks like this:

JSON
{
  "code": 401,
  "message": "Incorrect username or password",
  "timestamp": 1790726400
}

Pages

Lists answer with data set to { items, total, page, pageSize, totalPages }. Projects and samples take page and pageSize; job lists take limit and offset.

Jobs

Creating a plot or analysis job answers HTTP 202 with the job in data. Poll it no more often than every 2 seconds until its status is completed, failed or cancelled, then download the result. By default you can hold 20 unfinished plot jobs and 20 unfinished analysis jobs.

Files and tracing

Figure, table and export endpoints return the file itself, so check the HTTP status before reading the body. Every response from the API server carries an X-Request-ID header; quote it when you report a problem.

Where to call from

Browsers accept API responses only on this site's own pages, so call the API from a script, a notebook or a server rather than from another website.

Authentication

Endpoints marked Token required need the access token in a header. Replace ACCESS_TOKEN with yours:

HTTP header
Authorization: Bearer ACCESS_TOKEN
  • Access tokens last 15 minutes by default. There are no long-lived API keys.
  • For a quick test, copy the token from your Profile page. A script should sign in by itself and refresh.
  • Signing in also sets a refresh_token cookie that lasts 30 days by default. Each refresh replaces it, so keep the newest one.
  • Accounts with two-factor authentication get a pending_token at sign-in and exchange it, with a code, within 5 minutes.
  • Signing out ends every session of the account, in browsers as well as scripts.

Rate limits

Limits are token buckets: a burst can go through at once, then requests refill at the listed rate. A refused request gets HTTP 429 with a Retry-After header giving the seconds to wait. Reads such as project lists and job status have no limit of their own. Where one limit covers two routes, they share one budget when the server runs with Redis, and each counts separately without it.

Applies toRateBurstCounted per
Sign-in, token refresh, registration and password-reset requests3 per second6IP address
Two-factor code checks1 per second2IP address
Gene lookups under /api/genes30 per second60IP address
Plot submissions (POST /api/plot/jobs and /api/plot/generate)30 per minute60user
Analysis submissions (POST /api/analysis/jobs)10 per minute20user
File uploads20 per minute40user, or IP address without a token
Download catalogue listings60 per minute120IP address
Download links (also 120 per minute per IP address)30 per minute30user

Status codes

StatusMeaning
200Success. The body is the JSON envelope, or a file for downloads.
202A job was queued. The envelope's code is still 200; poll the job for its result.
400The request was refused as invalid. message says what was wrong.
401On sign-in and two-factor checks: wrong credentials or code, so sign in again. Elsewhere: the access token is missing, malformed, expired or revoked, so refresh it or sign in again.
403The account may not do this, or the file is not openly published.
404Nothing with that id exists, or it belongs to another account.
408A plot render took longer than its limit, 30 seconds by default.
409The resource is in the wrong state: a job not finished yet or already finished, two token refreshes raced, or a download file is waiting to be re-verified.
410The endpoint or export has been retired or has expired.
413The upload is larger than the proxy accepts. This one comes as an HTML page, not JSON; the API itself answers 400 for a file over its limit.
429Too many requests, or too many unfinished jobs. Wait the number of seconds in Retry-After.
500An unexpected server error. Quote the X-Request-ID response header when you report it.
502An analysis engine failed while running the request.
503The service or an engine is busy or unavailable. Retry after the seconds in Retry-After, when present.

30 endpoints

Sign-in and sessions

Sign in to get a short-lived access token. The refresh token arrives as an httpOnly cookie, so keep a cookie jar if your script refreshes.

POST/api/auth/login

No token#

Signs in with a username and password.

POST/api/auth/login/email

No token#

Signs in with an email address and password.

POST/api/auth/2fa/verify

No token#

Completes sign-in for an account with two-factor authentication.

POST/api/auth/refresh

No token#

Exchanges the refresh token for a new access token.

GET/api/auth/me

Token required#

Returns the signed-in account.

POST/api/auth/logout

Token required#

Signs the account out everywhere.

Projects and samples

The TCGA project catalogue is public. Per-sample clinical rows need a token because they describe individual patients.

GET/api/projects

No token#

Lists projects.

GET/api/projects/filters

No token#

Lists the values the project filters accept.

GET/api/projects/{id}

No token#

Returns one project with cohort summaries.

GET/api/projects/{id}/samples

Token required#

Lists a project's samples with their clinical fields.

Genes

Lookups for gene symbols and Ensembl ids, for building plot and analysis requests.

GET/api/genes/suggest

No token#

Suggests genes by symbol, Ensembl id or transcript id prefix.

POST/api/genes/resolve

No token#

Maps Ensembl gene ids to gene symbols.

Plot jobs

Figures render in the background. Create a job, poll it until it finishes, then download the result.

POST/api/plot/jobs

Token required#

Queues a figure.

GET/api/plot/jobs

Token required#

Lists your plot jobs, newest first.

GET/api/plot/jobs/{id}

Token required#

Returns a plot job's status.

GET/api/plot/jobs/{id}/result

Token required#

Downloads a finished figure.

DELETE/api/plot/jobs/{id}

Token required#

Cancels a queued or running plot job.

POST/api/plot/generate

Token required#

Renders a figure synchronously. Prefer plot jobs.

Analysis jobs

PCA, differential expression, survival signatures and single-cell pipelines run as jobs. Sending the same request while your earlier job is queued, running or completed returns that job instead of running it again.

POST/api/analysis/jobs

Token required#

Queues an analysis.

GET/api/analysis/jobs

Token required#

Lists your analysis jobs, newest first.

GET/api/analysis/jobs/{id}

Token required#

Returns an analysis job's status.

GET/api/analysis/jobs/{id}/logs

Token required#

Returns new lines of a job's run log.

GET/api/analysis/jobs/{id}/results

Token required#

Downloads a differential-expression results table.

GET/api/analysis/jobs/{id}/artifact/{name}

Token required#

Downloads a figure from a differential-expression job.

GET/api/analysis/jobs/{id}/export/scores

Token required#

Exports PCA sample scores.

DELETE/api/analysis/jobs/{id}

Token required#

Cancels a queued or running analysis.

Uploads

Upload your own table and use its fileId wherever a request takes a projectId. Send a valid token: a missing, expired or revoked one is not refused, so the file is stored anonymously and your jobs cannot use it.

POST/api/upload

Token optional#

Uploads a data file.

DELETE/api/upload/{fileId}

Token required#

Deletes one of your uploads.

Downloads

The published TCGA files: per-cohort count, TPM and FPKM matrices, sample information and a gene annotation. Listing them is public; asking for a download link needs a token.

GET/api/download/files

No token#

Lists the published TCGA files.

POST/api/download/files/{id}/link

Token required#

Creates a temporary HTTPS link to one file.