Docs  |  API Reference

Core views

The Core external API provides SQL access to bioprocess data in Invert. See Authentication for how to obtain an access token.

Available Views

v_bioprocesses

Note: parents of bioprocesses (aka experiments) have been moved to a separate table called experiments

curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_bioprocesses LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/
Field NameTypeDescription
idStringUnique identifier for the bioprocess
external_idStringAn external identifier for the bioprocess
nameStringName of the bioprocess
parent_idString or nullIdentifier of the parent bioprocess, if this is a child process
scheduled_start_timestampString or nullScheduled start time (ISO 8601)
scheduled_end_timestampString or nullScheduled end time (ISO 8601)
start_timestampStringRecord start time (ISO 8601 with timezone)
run_start_timestampString or nullStart time of the bioprocess run
run_end_timestampString or nullEnd time of the bioprocess run
end_timestampStringRecord end time (ISO 8601 with timezone)
duration_msNumberDuration of the bioprocess in milliseconds
statusStringDraft / Requested / Scheduled / In-progress / Completed
qcObjectQuality control information: {status, failure_mode}
dataArrayList of data objects associated with the bioprocess
eventsArrayList of events associated with the bioprocess
induction_eventObject or nullInformation about the induction event
attachmentsArrayList of attachments
lineageObject or nullLineage information
last_updated_atStringTimestamp of the last update (ISO 8601)
Common Event Types

DbObservationEvent

FieldTypeDescription
noteStringTextual observation or comment

DbAdditionEvent

FieldTypeDescription
lot_numberString or nullLot number of the added material
reagent_nameString or nullName of the reagent added
addition_typeStringType of addition (e.g., "Reagent Bolus", "Feed Start", "Induction", "Inoculation")
volumeObject{unit: string, value: number}

DbRemovalEvent

FieldTypeDescription
volumeObject{unit: string, value: number}
lot_numberString or nullLot number associated with the removal
sample_nameString or nullName or identifier of the sample removed
removal_typeStringType of removal (e.g., "Sample", "Harvest")

DbBioprocessPhaseEvent

FieldTypeDescription
phaseStringName of the bioprocess phase (e.g., "growth", "production")
time_pointStringIndicator of the phase timing (e.g., "start", "end")

v_timeseries

curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_timeseries LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/
Field NameTypeDescription
idStringUnique identifier for the timeseries
bioprocess_idStringIdentifier of the associated bioprocess
quantity_idStringIdentifier of the associated quantity
start_timestampStringStart time (ISO 8601 with timezone)
end_timestampStringEnd time (ISO 8601 with timezone)
duration_msNumberDuration in milliseconds
unitStringUnit of measurement
statisticsObjectStatistical summary (see below)
last_updated_atStringTimestamp of last update (ISO 8601)

statistics object:

FieldTypeDescription
maxNumber or nullMaximum value
minNumber or nullMinimum value
sumNumberSum of all values
lastNumber or nullLast value
countNumberNumber of data points
firstNumber or nullFirst value
arithmetic_meanNumber or nullAverage of all values
standard_deviationNumber or nullStandard deviation

v_timeseries_data

curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_timeseries_data LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/
Field NameTypeDescription
idStringIdentifier of the timeseries this data point belongs to (ref to v_timeseries.id)
timestampStringTimestamp of the data point (ISO 8601)
valueNumber or nullThe recorded value at this timestamp
data_item_idString or nullOptional identifier for the specific data item

v_quantities

curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_quantities LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/
Field NameTypeDescription
idStringUnique identifier
nameStringPrimary name of the quantity
alternative_namesArray of StringsList of alternative names
is_timeseriesBooleanWhether this quantity represents time series data
data_typeStringThe data type
default_unitStringThe default display unit
default_ingestion_unitStringThe default unit used when ingesting data
base_unitsObjectBase units object
molar_massNumber or nullThe molar mass, if applicable
notesString or nullAdditional notes
last_updated_atStringTimestamp of last update (ISO 8601)

v_formulas

curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_formulas LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/
Field NameTypeDescription
idStringUnique identifier
nameStringName of the formula
formulaStringThe actual formula/calculation
log_scaleBooleanWhether to apply on a logarithmic scale
disable_interpolationBooleanWhether interpolation is disabled
default_unitString or nullDefault unit for the result
run_phaseString or nullPhase during which this formula is applicable
notesString or nullAdditional notes
stateStringCurrent state (e.g., "ready")
last_updated_atStringTimestamp of last update (ISO 8601)

Example formula types:

  1. Simple references: A, B
  2. Basic arithmetic: (A+B+C)/3, A+B
  3. More complex: (A*3)*B/100
  4. Time-based: time_derivative_hours(A), time_integral_hours(A*2)
  5. Advanced statistical: log_linear_regression(A)

v_formula_results

Field NameTypeDescription
idStringUnique identifier
formula_idStringIdentifier of the formula used
bioprocess_idStringIdentifier of the associated bioprocess
unitStringUnit of measurement
dataObject or nullSingle value result (if not a time series)
timeseriesObject or nullTime series data (if formula produces multiple values)
timeseries_start_timestampStringStart time of the time series
timeseries_offset_msNumberTime offset in milliseconds
timeseries_statistics_minNumberMinimum value
timeseries_statistics_maxNumberMaximum value
timeseries_statistics_arithmetic_meanNumberArithmetic mean
timeseries_statistics_standard_deviationNumberStandard deviation
timeseries_statistics_sumNumberSum of all values
timeseries_statistics_firstNumberFirst value
timeseries_statistics_lastNumberLast value
timeseries_statistics_countNumberNumber of data points
last_updated_atStringTimestamp of last update

When timeseries is not null: {data: Array<Number>, times_ms: Array<Number>}

v_archived_records

Field NameTypeDescription
record_idStringUnique identifier for the archived record
table_nameStringName of the source table
archived_atStringTimestamp of archival (ISO 8601)

v_experiments

Field NameTypeDescription
idStringUnique identifier
external_idStringAn external identifier
scheduled_start_timestampString or nullScheduled start time (ISO 8601)
scheduled_end_timestampString or nullScheduled end time (ISO 8601)
last_updated_atStringTimestamp of last update (ISO 8601)

Example Queries

Delta Loads

Request data produced after a given date:

curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_bioprocesses WHERE last_updated_at > '"'"'2024-07-29'"'"' LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/

Get timeseries updated since a bioprocess was last updated:

curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT * FROM v_timeseries WHERE last_updated_at > (SELECT MAX(last_updated_at) FROM v_bioprocesses)"}' \
 https://api.invertbio.com/external/v1/statements/

View Joins

Get bioprocesses associated to a timeseries:

curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
 -H "Content-Type: application/json" \
 -X POST \
 -d '{"statement": "SELECT t.*, b.* FROM v_timeseries t LEFT JOIN v_bioprocesses b ON t.bioprocess_id = b.id LIMIT 1"}' \
 https://api.invertbio.com/external/v1/statements/

Error States

Timeouts

Long running requests (>30 seconds) will be terminated and return a 504. Modify your query to reduce/chunk the amount of data.

SQL execution errors

No data returned:

{
  "data": [],
  "status": {
    "state": "success",
    "message": "Statement executed successfully, but returned no results."
  }
}

Non-existent view:

{
  "data": [],
  "status": {
    "state": "error",
    "message": "relation \"v_non_existent_view\" does not exist"
  }
}

Syntax errors: JSON decode error — be careful about use of single vs double quotation marks.

Unexpected exceptions

{
  "data": [],
  "status": {
    "state": "error",
    "message": "Error executing statement"
  }
}