Base URL
By default, the MCRIT server runs on:REST Principles
The MCRIT API follows REST conventions:- GET requests retrieve data
- POST requests create new resources or submit queries
- PUT requests update existing resources
- DELETE requests remove resources
Response Format
All API responses follow a consistent structure:Success Response
When a request succeeds, the response includes:status: Always"successful"data: The actual response data (varies by endpoint)- HTTP status code:
200(OK) or202(Accepted for async operations)
Error Response
When a request fails, the response includes:status: Typically"failed"data: May include error details or message- HTTP status code:
400(Bad Request),404(Not Found),500(Server Error), etc.
HTTP status codes
200 and 202 indicate success. Check the status field in the JSON response body for additional information.Asynchronous Operations
Many operations in MCRIT are asynchronous and return ajob_id instead of immediate results:
/jobs/{job_id} endpoint and retrieve results via /jobs/{job_id}/result once complete.
Error Handling
The API uses standard HTTP status codes:- 200 OK - Request succeeded
- 202 Accepted - Request accepted for async processing
- 400 Bad Request - Invalid request parameters or body
- 401 Unauthorized - Missing or invalid authentication token
- 404 Not Found - Resource not found
- 410 Gone - Resource no longer available
- 500 Internal Server Error - Server error occurred
- 501 Not Implemented - Endpoint not yet implemented
Rate Limiting
MCRIT does not currently implement rate limiting at the API level. However, for production deployments, consider:- Implementing rate limiting at the reverse proxy level (nginx, Apache)
- Using the authentication token to track and limit usage per client
- Monitoring queue statistics via
/jobs/statsto avoid overwhelming the system
API Endpoint Categories
The MCRIT API is organized into the following categories:Status & Configuration
GET /- Welcome messageGET /status- Server statistics and statusGET /version- Server version informationGET /config- Configuration (not implemented)
Data Management
GET /export- Export all dataGET /export/{sample_ids}- Export specific samplesPOST /import- Import dataPOST /respawn- Reset the MCRIT instance
Maintenance
GET /complete_minhashes- Calculate missing MinHashesGET /rebuild_index- Rebuild the entire indexGET /recalculate_pichashes- Recalculate PIC hashesGET /recalculate_minhashes- Recalculate MinHashes
Search
GET /search/families- Search family entriesGET /search/samples- Search sample entriesGET /search/functions- Search function entries
Families
GET /families- List all familiesGET /families/{family_id}- Get family detailsPUT /families/{family_id}- Update family metadataDELETE /families/{family_id}- Delete family and optionally samples
Samples
GET /samples- List all samplesPOST /samples- Add SMDA reportPOST /samples/binary- Submit binary sampleGET /samples/{sample_id}- Get sample detailsPUT /samples/{sample_id}- Update sample metadataDELETE /samples/{sample_id}- Delete sampleGET /samples/sha256/{sha256}- Get sample by SHA256GET /samples/{sample_id}/functions- Get functions in sample
Functions
GET /functions- List all functionsPOST /functions- Get functions by IDsGET /functions/{function_id}- Get function details
Matching
GET /matches/sample/{sample_id}- Get matches for sampleGET /matches/sample/cross/{sample_ids}- Cross-match samplesGET /matches/sample/{sample_id}/{sample_id_b}- Compare two samplesGET /matches/function/{function_id}/{function_id_b}- Compare two functionsGET /matches/function/{function_id}- Get matches for function
Query
POST /query- Query with SMDA reportPOST /query/binary- Query with unmapped binaryPOST /query/binary/mapped/{base_address}- Query with mapped binaryPOST /query/function- Query with single functionGET /query/pichash/{pichash}- Query by PIC hashGET /query/pichash/{pichash}/summary- Query PIC hash summaryGET /query/picblockhash/{hash}- Query by PIC block hashGET /query/picblockhash/{hash}/summary- Query PIC block hash summary
Unique Blocks
GET /uniqueblocks/samples/{sample_ids}- Get unique blocks for samplesGET /uniqueblocks/family/{family_id}- Get unique blocks for family
Jobs & Results
GET /jobs- List jobsGET /jobs/stats- Queue statisticsGET /jobs/{job_id}- Get job detailsDELETE /jobs/{job_id}- Delete jobGET /jobs/{job_id}/result- Get job resultGET /results/{result_id}- Get result by IDGET /results/{result_id}/job- Get job for result
Detailed documentation for each endpoint category is available in dedicated API reference pages.
Next Steps
- Authentication - Learn how to authenticate API requests
- Python Client - Use the McritClient for easier API access
- Samples - Work with binary samples
- Matching - Query and match code similarities