API Reference
The AI engine exposes a REST API documented interactively via Swagger UI. This page documents the primary endpoints and their schemas; the live, auto-generated OpenAPI documentation is the authoritative reference.
Live API docs (Swagger UI): https://backend.bridges.cm/docs
OpenAPI schema: https://backend.bridges.cm/openapi.json
Base URL
https://backend.bridges.cm # production
http://localhost:8000 # local development
Content-Type: application/json
POST /recommendations/get22
Generates recommendations for a single user.
Minimal request payload
{
"id": "user-uuid",
"category": "IDP",
"user": {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-05-15",
"gender": "MALE"
},
"skillProfile": {
"skills": [
{"translations": [{"languageCode": "EN", "name": "Agriculture"}]}
]
},
"educationLevel": "SECONDARY",
"mobility": "REGIONAL",
"availableCapital": 5000,
"max_recommendations": 8
}
The category field accepts IDP, RETURNING_MIGRANT, or
EXPATRIATE. Each category adds specific fields:
Category |
Additional fields |
|---|---|
|
|
|
|
|
|
Response — a ranked list of recommendations, each containing
opportunityType, title, description, relevance_score (0.0–1.0),
reason, and metadata. Recommendations are automatically persisted to the
recommendations table.
POST /recommendations/get22-batch
Generates recommendations for a batch of users. Accepts an array of the single-user payload shown above and returns the recommendations grouped per user.
POST /documents/upload
Uploads and indexes a single document into Qdrant.
Parameters (multipart/form-data):
Parameter |
Description |
|---|---|
|
Target Qdrant collection (e.g. |
|
Owner of the data (e.g. |
|
Description of the content |
|
Document type ( |
|
File to index ( |
POST /documents/index-json-batch
Indexes a batch of opportunities supplied directly as JSON, bypassing file parsing. Useful for ingesting data from ETL pipelines and partner feeds.
GET /analytics/* and statistics
A family of analytics endpoints expose platform statistics. Collection-level
indexing statistics are available via
GET /collections/{name}/stats.
Data Schemas
Beneficiary profile
Common fields (id, category, user, skillProfile,
educationLevel, mobility, availableCapital) plus the
category-specific fields listed above.
Opportunity
opportunityType, title, description,
metadata { Amount, source, ApplyUrl, location, sector }
Recommendation
opportunityType, title, description,
relevance_score (0.0-1.0), reason, metadata
Complete Endpoint Inventory
The following table lists every route exposed by the production engine
(main.py), grouped by area. Always confirm the exact request/response
schema against the live OpenAPI docs at https://backend.bridges.cm/docs.
System and health
Endpoint |
Purpose |
|---|---|
|
Service root / metadata |
|
Health check |
Documents and indexing
Endpoint |
Purpose |
|---|---|
|
Upload and index a single document |
|
Upload and index multiple documents |
|
Analyse a document’s security classification |
|
Index a single opportunity provided as JSON |
|
Index a batch of opportunities as JSON |
|
Index opportunities sourced from PostgreSQL |
|
Batch index from PostgreSQL |
|
List indexed documents |
|
Delete indexed document(s) |
|
Semantic vector search |
Collections
Endpoint |
Purpose |
|---|---|
|
List Qdrant collections |
|
Collection indexing statistics |
Analytics
Endpoint |
Purpose |
|---|---|
|
Document counts grouped by data owner |
|
Document counts grouped by week |
|
Distribution by document type |
|
Distribution by data owner |
|
Word-cloud data from descriptions |
Recommendations
Endpoint |
Purpose |
|---|---|
|
Primary single-user recommendation endpoint (current) |
|
Batch recommendations (current) |
|
Batch profile processing |
|
Submit an asynchronous recommendation job |
|
Poll an asynchronous job’s status |
|
Retrieve an asynchronous job’s result |
|
Conversational recommendation interface |
|
Recommendation history for a user |
|
Conversation history for a user |
|
Create / update a stored profile |
|
Retrieve a stored profile |
|
Earlier recommendation variants retained for compatibility |
Note
The get22 / get22-batch endpoints are the current recommendation
interface. The get, get1, get12, and get224 variants are
earlier iterations kept for backward compatibility and may be deprecated in
a future release.