Relations
Returns relations visible to the current caller, optionally filtered by status.
Permissions: Visibility is checked only on the source side of each relation; the target's permissions are not independently evaluated.
When the source is a business concept, the caller must hold at least one of the following on the concept's domains (own domain plus shared domains):
'View published business concepts'
'View draft business concepts'
'View deprecated business concepts'
'View versioned business concepts'
'View rejected business concepts'
'View business concepts pending approval' When the concept is confidential, the caller must additionally hold 'Manage confidential business concepts' on the concept's domains.
When the source is an ingest, the caller must hold at least one of the following:
'View published ingests'
'View draft ingests'
'View deprecated ingests'
'View versioned ingests'
'View rejected ingests'
'View ingests pending approval'
When the source is a data structure, no permission clause applies and the relation is filtered out. The status-sensitive permission is generic: any of the listed view permissions grants access, without matching the resource's actual current status.
Query parameter:
status(optional, string) – Default:'approved'. Includes relations whosestatuscolumn isNULL(treated as approved). Use'nil'to filter only relations without an explicit status.
The response includes hypermedia metadata for navigation and related actions. No pagination is applied; all matching visible relations are returned.
Filter by status. Default: 'approved'
OK
Unauthorized
Forbidden
Internal Server Error
GET /api/relations HTTP/1.1
Accept: */*
{
"_actions": {
"create": {
"href": "/api/relations",
"input": {},
"method": "POST"
},
"search": {
"href": "/api/relations/search",
"input": {},
"method": "POST"
}
},
"data": [
{
"context": {},
"deleted_at": null,
"disabled_at": null,
"disabled_reason": null,
"id": 1,
"inserted_at": "2025-01-01T00:00:00Z",
"origin": null,
"source_id": 123,
"source_type": "business_concept",
"status": null,
"tag": null,
"tag_id": null,
"tag_type": null,
"tags": [],
"target_id": 456,
"target_type": "data_field",
"updated_at": "2025-01-01T00:00:00Z"
}
]
}Creates a new relation between two resources. The source_type must be either 'business_concept' or 'ingest'; 'data_structure' is not permitted as a source but it may be the target.
Request body:
Wrap fields inside a top-level
relationobject.Required:
source_id,source_type,target_id,target_type.Optional:
context(object): additional metadata; defaults to%{}.tag_ids(array of integers): associates a tag; only the first ID is used (tag_idis derived in the controller).origin(string, nullable): relation origin; schema default isnil.status(string, nullable): default isnil. On create, only'pending'is accepted besidesnull/omission. Values'approved'and'rejected'cannot be set at creation; usePOST /api/relations/statusto transition a pending relation.
Permissions The permission required depends on the source resource type:
If
source_typeis'business_concept': requiresManage business concept linkspermission.If
source_typeis'ingest': requiresManage ingest relationspermission.
The system also validates that the target resource exists and is accessible. The response includes a Location header pointing to the created relation.
Created
Bad Request
Unauthorized
Forbidden
Unprocessable Entity
Internal Server Error
POST /api/relations HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 179
{
"relation": {
"context": {
"some": "value"
},
"origin": "manual",
"source_id": 123,
"source_type": "business_concept",
"status": null,
"tag_ids": [
1
],
"target_id": 456,
"target_type": "data_field"
}
}{
"data": {
"context": {},
"deleted_at": null,
"disabled_at": null,
"disabled_reason": null,
"id": 1,
"inserted_at": "2025-01-01T00:00:00Z",
"origin": null,
"source_id": 123,
"source_type": "business_concept",
"status": null,
"tag": null,
"tag_id": null,
"tag_type": null,
"tags": [],
"target_id": 456,
"target_type": "data_field",
"updated_at": "2025-01-01T00:00:00Z"
}
}Permanently removes multiple relations from the database based on a list of IDs. This operation is irreversible.
Response parameters:
deleted: IDs successfully removed.errors: error messages for IDs that could not be deleted (already deleted or user's permission failure). May be empty.
Requires administrative privileges (administrator or service account).
List of relation IDs to permanently delete
OK
Unauthorized
Forbidden
Unprocessable Entity
Internal Server Error
DELETE /api/relations/hard_delete HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}{
"data": {
"deleted": [
1,
2
],
"errors": []
}
}Searches relations directly in the database (not the Elasticsearch index; use POST /api/relations/index_search for indexed search).
Two request modes:
Resource-based mode – the three fields below must be provided together:
resource_id(integer) – ID of the anchor resource.resource_type(string) – Type of the anchor resource. One of 'business_concept', 'ingest', or 'data_structure'.related_to_type(string) – Type of the related resource on the opposite side of the relation. The query runs in both directions (anchor as source and anchor as target). However, only relations whose source is a business concept or an ingest are returned. Relations whose source is a data structure are silently filtered out, so for a data structure anchor only the direction where the anchor is the target is effective.
General mode – any combination of
source_id,source_type,target_id,target_type,status, andtag_id. Do not mix this mode with the three resource-based fields above.
Status filter (both modes):
status(string, optional) – Default:'approved'. When the effective status is'approved', relations whosestatuscolumn isNULLare also returned (treated as approved). Use'nil'to filter only relations without an explicit status.
Permissions: Visibility is checked only on the source side of each relation; the target's permissions are not independently evaluated.
When the source is a business concept, the caller must hold at least one of the following on the concept's domains (own domain plus shared domains):
'View published business concepts'
'View draft business concepts'
'View deprecated business concepts'
'View versioned business concepts'
'View rejected business concepts'
'View business concepts pending approval' Additionally, when the concept is confidential, the caller must hold 'Manage confidential business concepts' on the concept's domains.
When the source is an ingest, the caller must hold at least one of the following on the ingest:
'View published ingests'
'View draft ingests'
'View deprecated ingests'
'View versioned ingests'
'View rejected ingests'
'View ingests pending approval'
When the source is a data structure, no permission clause applies and the relation is filtered out of the result. The status-sensitive permission is generic: any of the listed view permissions grants access, without matching the resource's actual current status.
Response:
data– array of relation objects withid,source_id,source_type,target_id,target_type,context,status,origin,tag/tags,tag_id,tag_type, and timestamps (inserted_at,updated_at,deleted_at,disabled_at,disabled_reason)._actions/hypermedia– navigation metadata keyed to the anchor resource.
When related_to_type is 'business_concept' or 'ingest', the corresponding side of the relation's context is enriched with the cached name and version_id. When related_to_type is 'data_structure', no enrichment is applied.
The search does not paginate; all matching visible relations are returned in a single response.
Related resource type (required for resource-based search)
Root resource ID for search (required for resource-based search)
Root resource type (required for resource-based search)
Source ID (alternative search)
Source type (alternative search)
Status filter (defaults to 'approved')
OK
Unauthorized
Forbidden
Internal Server Error
POST /api/relations/search HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 105
{
"related_to_type": "data_field",
"resource_id": 123,
"resource_type": "business_concept",
"status": "approved"
}{
"_actions": {
"create": {
"href": "/api/relations",
"input": {},
"method": "POST"
},
"search": {
"href": "/api/relations/search",
"input": {},
"method": "POST"
}
},
"data": [
{
"context": {},
"deleted_at": null,
"disabled_at": null,
"disabled_reason": null,
"id": 1,
"inserted_at": "2025-01-01T00:00:00Z",
"origin": null,
"source_id": 123,
"source_type": "business_concept",
"status": null,
"tag": null,
"tag_id": null,
"tag_type": null,
"tags": [],
"target_id": 456,
"target_type": "data_field",
"updated_at": "2025-01-01T00:00:00Z"
}
]
}Retrieves a single relation by ID.
Permissions: Visibility is checked only on the source side of the relation; the target's permissions are not independently evaluated.
When the source is a business concept, the caller must hold at least one of the following on the concept's domains (own domain plus shared domains):
'View published business concepts'
'View draft business concepts'
'View deprecated business concepts'
'View versioned business concepts'
'View rejected business concepts'
'View business concepts pending approval' When the concept is confidential, the caller must additionally hold 'Manage confidential business concepts' on the concept's domains.
When the source is an ingest, the caller must hold at least one of the following:
'View published ingests'
'View draft ingests'
'View deprecated ingests'
'View versioned ingests'
'View rejected ingests'
'View ingests pending approval'
When the source is a data structure, no permission clause applies and the relation is filtered out (even when requested by ID).
Response: Object with id, source_id, source_type, target_id, target_type, context, status, origin, tag/tags, tag_id, tag_type, and timestamps.
Relation ID
OK
Unauthorized
Forbidden
Not Found
Internal Server Error
GET /api/relations/{id} HTTP/1.1
Accept: */*
{
"data": {
"context": {},
"deleted_at": null,
"disabled_at": null,
"disabled_reason": null,
"id": 1,
"inserted_at": "2025-01-01T00:00:00Z",
"origin": null,
"source_id": 123,
"source_type": "business_concept",
"status": null,
"tag": null,
"tag_id": null,
"tag_type": null,
"tags": [],
"target_id": 456,
"target_type": "data_field",
"updated_at": "2025-01-01T00:00:00Z"
}
}Soft-deletes a relation by setting deleted_at without removing the database row. The relation remains for audit/history but is excluded from default database and index searches (unless explicitly included via search with/document parameters). The operation is reversible only by a database restoration; there is no public API to restore a soft-deleted relation.
The source_type must be either 'business_concept' or 'ingest'; 'data_structure' is not permitted as a source but it may be the target.
Permissions Requires permission to manage links on the source resource of the relation:
If the source is a business concept:
Manage business concept linkspermission.If the source is an ingest:
Manage ingest relationspermission.
Relation ID
Relation deleted
No content
Unauthorized
Forbidden
Not Found
Internal Server Error
DELETE /api/relations/{id} HTTP/1.1
Accept: */*
No content
Last updated