API Reference
Table Relationships API
Manage FK-style table relationships used by the enrichment pipeline.
The Table Relationships API manages foreign-key-style connections between database tables. Relationships are used by the enrichment pipeline to resolve fields from related tables during CDC event processing.
List Relationships
GET /api/table-relationshipsReturns all relationships scoped to the current application.
Response:
{
"relationships": [
{
"id": "trel_abc123",
"applicationId": "app_abc123",
"sourceTable": "salesforce.exam_session__c",
"sourceColumn": "application_install_id__r_sid__c",
"targetTable": "salesforce.application_install__c",
"targetColumn": "sid__c",
"createdAt": 1710000000000
}
]
}Create Relationship
POST /api/table-relationshipsRequest Body:
{
"sourceTable": "salesforce.exam_session__c",
"sourceColumn": "application_install_id__r_sid__c",
"targetTable": "salesforce.application_install__c",
"targetColumn": "sid__c"
}| Field | Required | Description |
|---|---|---|
sourceTable | Yes | Source table name (schema-qualified) |
sourceColumn | Yes | Column on the source table that references the target |
targetTable | Yes | Target table name (schema-qualified) |
targetColumn | Yes | Column on the target table that is referenced |
Relationships are bidirectional for enrichment purposes — the BFS traversal follows them in both directions. Define them once from either direction.
Response: 201 Created with the relationship object.
Delete Relationship
DELETE /api/table-relationships/:idResponse: 200 OK with { "message": "Relationship deleted" }.
Usage with Enrichment
Relationships define the graph the enrichment pipeline traverses when resolving fields from related tables. For example, given:
exam_session → application_install → account_deploymentA mapping on exam_session can enrich with fields from account_deployment (2 hops away). The pipeline uses BFS to find the shortest path and builds LEFT JOIN queries automatically.
See Database API - Enrichment for mapping configuration details.