Download OpenAPI specification:Download
The EvoNEST User documentation and the EvoNEST Developer Docs are found here: https://daniele-liprandi.github.io/EvoNEST-backbone/
The EvoNEST API allows users to interact with the MongoDB databases generated in their NEST, plus it gives access to utility functions useful in ecological, evolutionary and biological research.
Get a list of all users in the system. When not in auth mode, filters users by database access based on the current user's permissions.
| auth | boolean Set to true to bypass database filtering (for authentication flows) |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "name": "John Doe",
- "email": "john.doe@example.com",
- "institution": "University of Science",
- "role": "researcher",
- "databases": [
- "spiderdb",
- "evolutiondb"
], - "activeDatabase": "spiderdb",
- "isActive": true,
- "createdDate": "2024-01-15T10:30:00Z",
- "recentChangeDate": "2024-03-15T10:30:00Z",
- "logbook": [
- "2024-01-15T10:30:00Z: User created",
- "2024-03-15T14:20:00Z: Profile updated"
], - "auth0id": "auth0|507f1f77bcf86cd799439011"
}
]Handles multiple user operations based on the method field:
| method required | string Value: "create" Action to perform |
| name required | string User's full name |
| email required | string <email> User's email address |
| institution | string User's affiliated institution |
| role | string Enum: "admin" "researcher" "student" "viewer" User's role in the system |
| databases | Array of strings List of databases the user should have access to |
{- "method": "create",
- "name": "Dr. Jane Smith",
- "email": "jane.smith@university.edu",
- "institution": "University of Science",
- "role": "researcher",
- "databases": [
- "spiderdb"
]
}{- "message": "User updated successfully",
- "id": "507f1f77bcf86cd799439011"
}Retrieves the current authenticated user's profile information from the database
{- "_id": "507f1f77bcf86cd799439011",
- "name": "John Doe",
- "email": "john.doe@example.com",
- "institution": "University of Science",
- "role": "researcher",
- "databases": [
- "spiderdb",
- "evolutiondb"
], - "activeDatabase": "spiderdb",
- "isActive": true,
- "createdDate": "2024-01-15T10:30:00Z",
- "recentChangeDate": "2024-03-15T10:30:00Z",
- "logbook": [
- "2024-01-15T10:30:00Z: User created",
- "2024-03-15T14:20:00Z: Profile updated"
], - "auth0id": "auth0|507f1f77bcf86cd799439011"
}Updates specific fields in the current authenticated user's profile
| method required | string Value: "setfield" Update method |
| id | string User ID to update |
| name | string User's full name |
string <email> User's email address | |
| institution | string User's affiliated institution |
| role | string Enum: "admin" "researcher" "student" "viewer" User's role in the system |
| databases | Array of strings List of databases the user should have access to |
| isActive | boolean Whether the user account is active |
| field required | string Field name to update |
required | string or number or boolean New value for the field |
{- "method": "setfield",
- "field": "name",
- "value": "Jane Doe"
}{- "message": "User updated successfully"
}Switch the user's active database to a different one they have access to
| database required | string Name of the database to set as active |
{- "database": "string"
}Retrieve all API keys associated with the current user account, showing only key previews for security
[- {
- "id": "string",
- "name": "string",
- "keyPreview": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "expiresAt": "2019-08-24T14:15:22Z",
- "lastUsedAt": "2019-08-24T14:15:22Z",
- "usageCount": 0,
- "databases": [
- "string"
]
}
]Create a new API key for the authenticated user with specified name and expiration
| name | string Name/description for the API key |
| expiresInDays | number Number of days until key expires (optional) |
{- "name": "string",
- "expiresInDays": 0
}{- "message": "string",
- "apiKey": "string",
- "keyInfo": { }
}Retrieves the current user's authentication status and database profile information. Used to determine if a user needs to complete their profile setup after authentication.
{- "user": {
- "sub": "auth0|507f1f77bcf86cd799439011",
- "name": "John Doe",
- "email": "john.doe@example.com"
}, - "dbuser": {
- "_id": "507f1f77bcf86cd799439012",
- "auth0id": "auth0|507f1f77bcf86cd799439011",
- "name": "John Doe",
- "email": "john.doe@example.com"
}, - "needsIdentification": false
}Get a list of all samples in the database. Supports query parameters for filtering and pagination.
| method | string Value: "get-schema" Special method to get sample schema instead of data |
| type | string Enum: "animal" "silk" "other" Filter samples by type |
| family | string Filter samples by taxonomic family |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "name": "Araneus diadematus #42",
- "type": "animal",
- "family": "Araneidae",
- "genus": "Araneus",
- "species": "diadematus",
- "location": "Berlin, Germany",
- "date": "2024-03-15",
- "collector": "Dr. Smith"
}
]Create new samples, update existing ones, or perform bulk operations
| method | string Enum: "update" "setfield" "incrementfield" Operation type |
| id | string Sample ID for update operations |
| field | string Field name to update |
| value | any New value for the field |
{- "name": "Nephila clavipes #15",
- "type": "animal",
- "family": "Araneidae",
- "genus": "Nephila",
- "species": "clavipes"
}{- "success": true,
- "message": "string",
- "insertedId": "string"
}Export all samples from a database using API key authentication. Supports various filtering and relationship inclusion options.
| database required | string Database name to export from |
| apiKey | string API key for authentication (can also use Authorization header) |
| format | string Default: "json" Export format (only JSON supported) |
| type | string Enum: "animal" "silk" "other" Filter samples by type |
| includeRelated | boolean Default: false Include parent sample data chain |
[- { }
]Get a list of trait measurements with optional filtering by type and optional inclusion of sample features for enhanced data analysis.
| includeSampleFeatures | boolean Example: includeSampleFeatures=true Include associated sample information in the response |
| type | string Example: type=silk_diameter Filter traits by specific type |
| id | string Example: id=507f1f77bcf86cd799439011 Retrieve a specific trait by its ID |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "type": "silk_diameter",
- "measurement": 2.5,
- "std": 0.3,
- "unit": "μm",
- "sampleId": "507f1f77bcf86cd799439012",
- "responsible": "507f1f77bcf86cd799439013",
- "date": "2024-03-15",
- "detail": "major ampullate silk",
- "equipment": "SEM",
- "nfibres": "1",
- "listvals": [
- 2.3,
- 2.5,
- 2.7,
- 2.4,
- 2.6
], - "notes": "Good quality sample",
- "filesId": [
- "507f1f77bcf86cd799439014"
], - "recentChangeDate": "2024-03-15T14:20:00Z",
- "logbook": [
- "string"
]
}
]Handles multiple trait operations based on the method field:
| method required | string Value: "create" Action to perform |
| type required | string Type of trait measurement |
| sampleId required | string Reference to the sample |
| responsible required | string ID of the user responsible for this measurement |
| date required | string <date> Date when the measurement was taken |
| measurement | number The measured value |
| unit | string Unit of measurement |
| detail | string Additional details about the measurement |
| equipment | string Equipment used for measurement |
| nfibres | string Number of fibers measured |
| listvals | Array of numbers Individual measurement values |
| notes | string Additional notes about the measurement |
| filesId | Array of strings Associated file IDs |
{- "method": "create",
- "type": "silk_diameter",
- "sampleId": "507f1f77bcf86cd799439012",
- "responsible": "507f1f77bcf86cd799439013",
- "date": "2024-03-15",
- "measurement": 2.5,
- "unit": "μm",
- "equipment": "SEM",
- "nfibres": "1",
- "detail": "major ampullate silk",
- "notes": "Good quality sample"
}{- "message": "Trait created successfully",
- "id": "507f1f77bcf86cd799439011"
}Export all trait measurements from a database using API key authentication. Supports filtering and inclusion of sample features and related data.
| database required | string Database name to export from |
| apiKey | string API key for authentication (can also use Authorization header) |
| format | string Default: "json" Export format (only JSON supported) |
| type | string Filter traits by type |
| includeSampleFeatures | boolean Default: false Include associated sample information |
| includeRelated | boolean Default: false Include related sample chain data |
[- { }
]Converts trait measurements to their default units based on SI prefix conversion. Can convert specific traits by ID or all traits in the database. Only converts traits where the current unit is compatible with the default unit (i.e., same base unit with different SI prefix).
| traitIds | Array of strings Optional array of trait IDs to convert. If not provided, converts all traits. |
{- "traitIds": [
- "507f1f77bcf86cd799439011",
- "507f1f77bcf86cd799439012"
]
}{- "success": true,
- "totalTraits": 150,
- "converted": 45,
- "skipped": 105,
- "details": [
- {
- "traitId": "string",
- "type": "string",
- "converted": true,
- "oldValue": 0,
- "oldUnit": "string",
- "newValue": 0,
- "newUnit": "string",
- "reason": "string"
}
]
}Analyzes which traits would be converted and returns preview data without modifying the database. Shows the first 10 conversions that would be applied.
| traitIds | Array of strings Optional array of trait IDs to preview. If not provided, previews all traits. |
{- "traitIds": [
- "string"
]
}{- "totalTraits": 0,
- "willConvert": 0,
- "willSkip": 0,
- "preview": [
- { }
]
}Analyze trait measurements with statistical calculations (mean, stddev, min, max, median) grouped by various sample features
| traitType required | string Type of trait to analyze (e.g., stressAtBreak, diameter, toughness) |
| groupBy | string Default: "all" Field to group results by (e.g., species, sex, sampleType) |
| filters | object Optional filters to apply to the data |
| unitConversion | boolean Default: true Whether to apply unit conversions |
{- "traitType": "string",
- "groupBy": "all",
- "filters": { },
- "unitConversion": true
}{- "results": [
- {
- "group": "string",
- "statistics": {
- "mean": 0,
- "stddev": 0,
- "min": 0,
- "max": 0,
- "median": 0,
- "count": 0
}
}
], - "processingTime": 0
}Get a list of experiments with optional inclusion of raw experimental data and filtering options.
| includeRawData | boolean Example: includeRawData=true Include raw experimental data in the response |
| includeOriginalData | boolean Include original (unprocessed) data instead of current data |
| type | string Example: type=mechanical_test Filter experiments by type |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "name": "Silk tensile strength study",
- "type": "mechanical_test",
- "description": "Testing the tensile strength of spider silk under various conditions",
- "responsible": "507f1f77bcf86cd799439013",
- "date": "2024-03-15",
- "samples": [
- "507f1f77bcf86cd799439012",
- "507f1f77bcf86cd799439014"
], - "status": "completed",
- "equipment": "Instron 5544",
- "conditions": {
- "temperature": "22°C",
- "humidity": "55%",
- "strain_rate": "0.1 mm/min"
}, - "rawdata": {
- "data": [ ],
- "metadata": { }
}, - "isOriginalData": false,
- "recentChangeDate": "2024-03-15T14:20:00Z"
}
]Handles multiple experiment operations based on the method field:
| method required | string Value: "create" Action to perform |
| name required | string Experiment name |
| type required | string Type of experiment |
| description | string Detailed description of the experiment |
| responsible required | string ID of the user responsible for this experiment |
| date | string <date> Experiment date |
| samples | Array of strings List of sample IDs used in this experiment |
| equipment | string Equipment used for the experiment |
| conditions | object Environmental or experimental conditions |
{- "method": "create",
- "name": "Silk tensile strength study",
- "type": "mechanical_test",
- "description": "Testing the tensile strength of spider silk",
- "responsible": "507f1f77bcf86cd799439013",
- "date": "2024-03-15",
- "samples": [
- "507f1f77bcf86cd799439012"
], - "equipment": "Instron 5544"
}{- "message": "Experiment created successfully",
- "id": "507f1f77bcf86cd799439011"
}Export all experiments from a database using API key authentication. Supports filtering and inclusion of raw data and related samples.
| database required | string Database name to export from |
| apiKey | string API key for authentication (can also use Authorization header) |
| format | string Default: "json" Export format (only JSON supported) |
| type | string Filter experiments by type |
| includeRawData | boolean Default: false Include raw experimental data |
| includeOriginalData | boolean Default: false Include original unprocessed data |
| includeRelated | boolean Default: false Include related sample data chain |
[- { }
]Export tensile test experiment data in JSON format with session-based authentication
| format | string Default: "json" Export format (only JSON supported) |
| type | string Default: "tensile_test" Experiment type filter |
[- { }
]Get a list of all files stored in the system with their metadata.
[- {
- "_id": "507f1f77bcf86cd799439011",
- "filename": "spider_silk_image.jpg",
- "path": "/storage/507f1f77bcf86cd799439011_spider_silk_image.jpg",
- "size": 1024000,
- "mimeType": "image/jpeg",
- "uploadDate": "2024-03-15T10:30:00Z",
- "entryType": "trait",
- "entryId": "507f1f77bcf86cd799439012",
- "description": "SEM image of silk fiber cross-section",
- "uploader": "507f1f77bcf86cd799439013"
}
]Upload one or more files to the system. Files are stored with metadata and can be linked to specific entries.
| files | Array of strings <binary> Files to upload |
| entryType | string Type of entry to link files to |
| deferredLink | boolean Whether to defer linking until later |
| mediaType | string Expected media type |
{- "message": "Files uploaded successfully",
- "fileIds": [
- "507f1f77bcf86cd799439011",
- "507f1f77bcf86cd799439012"
]
}Links a file to a specific entry (sample, trait, or experiment). If the file was temporary, it will be moved to the appropriate directory structure and marked as permanent. The entry's logbook will be updated with the linking action.
| fileId required | string^[0-9a-fA-F]{24}$ MongoDB ObjectId of the file to link |
| entryType required | string Enum: "sample" "trait" "experiment" Type of entry to link the file to |
| entryId required | string^[0-9a-fA-F]{24}$ MongoDB ObjectId of the entry to link the file to |
{- "fileId": "507f1f77bcf86cd799439011",
- "entryType": "sample",
- "entryId": "507f1f77bcf86cd799439012"
}{- "success": true
}Downloads a file from the server using its database ID. The file metadata is retrieved from the database and the actual file is served from the file system.
| id required | string^[0-9a-fA-F]{24}$ Example: id=507f1f77bcf86cd799439011 MongoDB ObjectId of the file to download |
{- "error": "File ID is required."
}Search the Global Biodiversity Information Facility (GBIF) database for images of species based on a query string.
| query required | string Example: query=Araneus diadematus Species name or search query |
{- "rightsHolder": "John Doe",
- "country": "Germany"
}Converts latitude and longitude coordinates to a human-readable address using OpenStreetMap's Nominatim service
| lat required | number <float> [ -90 .. 90 ] Latitude coordinate |
| lon required | number <float> [ -180 .. 180 ] Longitude coordinate |
{- "lat": 52.52,
- "lon": 13.405
}{- "location": {
- "house_number": "1",
- "road": "Unter den Linden",
- "city": "Berlin",
- "state": "Berlin",
- "country": "Deutschland",
- "postcode": "10117"
}
}Retrieves all current system notifications from an external JSON source with intelligent caching and fallback mechanisms.
Caching Strategy:
Current Implementation Note:
NOTIFICATIONS_URL is temporarily hardcoded to "https://raw.githubusercontent.com/daniele-liprandi/EvoNEST-news/refs/heads/main/notifications.json"Fast response from in-memory cache
nullDownloads a QR code image from a URL and adds text labels to the right side of the image
| qrcodeurl required | string <uri> Example: qrcodeurl=https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=Sample URL of the QR code image to modify |
| labelwidth | integer [ 100 .. 1000 ] Default: 400 Example: labelwidth=400 Width of the label area in pixels |
| label1 | string <= 50 characters Example: label1=Sample ID: 001 First label text (truncated if longer than 12 characters) |
| label2 | string <= 50 characters Example: label2=Date: 2024-03-15 Second label text (truncated if longer than 12 characters) |
| label3 | string <= 50 characters Example: label3=Location: Lab A Third label text (truncated if longer than 12 characters) |
{- "error": "Failed to process image"
}Convert location names or addresses to latitude/longitude coordinates using OpenStreetMap Nominatim service.
| location required | string Location name or address to geocode |
{- "location": "Berlin, Germany"
}{- "coordinates": {
- "lat": "52.5200066",
- "lon": "13.4049540",
- "display_name": "Berlin, Deutschland",
- "importance": 0.75
}
}Validates and corrects scientific names using various taxonomic databases. Supports two methods:
Data sources:
| taxa required | string Scientific name to check or validate |
| method | string Default: "correctName" Enum: "correctName" "fullTaxaInfo" Type of operation to perform |
| source | string Default: "auto" Enum: "auto" "WSC" "GNames" Data source for name checking (WSC = World Spider Catalog, GNames = Global Names Verifier) |
| family | string Optional family name to provide taxonomic context (used with GNames) |
{- "taxa": "Araneus diadematus",
- "method": "correctName",
- "source": "auto"
}{- "status": "success",
- "data": "Araneus diadematus",
- "source": "WSC"
}Retrieve the main settings configuration including ID generation and lab info
{- "success": true,
- "data": {
- "idGeneration": {
- "combinations": [
- [
- 0
]
], - "defaultGenusLength": 0,
- "defaultSpeciesLength": 0,
- "startingNumber": 0,
- "useCollisionAvoidance": true,
- "numberPadding": 0
}, - "labInfo": {
- "name": "string",
- "location": "string",
- "latitude": 0,
- "longitude": 0
}
}
}Update the main settings configuration
object | |
object |
{- "idGeneration": {
- "combinations": [
- [
- 0
]
], - "defaultGenusLength": 0,
- "defaultSpeciesLength": 0,
- "maxGenusLength": 0,
- "maxSpeciesLength": 0,
- "startingNumber": 0,
- "useCollisionAvoidance": true,
- "numberPadding": 0
}, - "labInfo": {
- "name": "string",
- "location": "string",
- "latitude": 0,
- "longitude": 0
}
}Get a single sample by name, ID, or other query parameters using JSON body
| name | string Filter by sample name (exact match) |
| id | string Filter by sample ID |
| type | string Enum: "animal" "silk" "subsample" "other" Filter by sample type |
{- "name": "MACN-Ar 47148",
- "type": "animal"
}{- "_id": "507f1f77bcf86cd799439011",
- "name": "Araneus diadematus #42",
- "type": "animal",
- "family": "Araneidae",
- "genus": "Araneus",
- "species": "diadematus",
- "location": "Berlin, Germany",
- "date": "2024-03-15",
- "collector": "Dr. Smith"
}Get all configuration types or a specific type
| type | string Enum: "sampletypes" "traittypes" "equipmenttypes" "samplesubtypes" "silkcategories" "siprefixes" "baseunits" Specific configuration type to retrieve |
{- "_id": "string",
- "type": "sampletypes",
- "data": [
- {
- "value": "animal",
- "label": "Animal",
- "description": "Animal individual",
- "unit": "g",
- "shortened": "an"
}
], - "version": 0,
- "lastModified": "2019-08-24T14:15:22Z",
- "modifiedBy": "string",
- "isDefault": true
}Handle configuration operations:
| method | string Enum: "create" "update" "additem" "updateitem" "deleteitem" "seed" |
| type | string Enum: "sampletypes" "traittypes" "equipmenttypes" "samplesubtypes" "silkcategories" "siprefixes" |
Array of objects (ConfigItem) | |
object (ConfigItem) | |
| oldValue | string For updateitem - the current value to update |
{- "method": "create",
- "type": "sampletypes",
- "data": [
- {
- "value": "animal",
- "label": "Animal",
- "description": "Animal individual",
- "unit": "g",
- "shortened": "an"
}
], - "item": {
- "value": "animal",
- "label": "Animal",
- "description": "Animal individual",
- "unit": "g",
- "shortened": "an"
}, - "oldValue": "string"
}