Lineage
Was this helpful?
Was this helpful?
Get a lineage object by its ID.
The ID of the lineage entry to retrieve.
34d983b3-bfe0-4b49-abea-0692c8be6693
GET /api/v1/lineage/manual/{lineage_id} HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Accept: */*
{
"id": "d935a76c-2125-4c30-9389-ef42fa7e23bb",
"created_at": "2023-08-16T23:12:53.245493Z",
"updated_at": "2023-08-16T23:12:53.245507Z",
"from_entity": "7879886b-9e0e-4d02-8b37-c7d3c496a587",
"to_entity": "b500ef23-c9b4-4259-a87d-d77b8b588f06",
"direction": "DOWNSTREAM",
"is_manual": true
}
Delete a lineage object by its ID.
The ID of the lineage entry to delete.
34d983b3-bfe0-4b49-abea-0692c8be6693
DELETE /api/v1/lineage/manual/{lineage_id} HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Accept: */*
No content
Preview Lineage from a Query.
The SQL query to analyze for lineage relationships
SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
SQL dialect of the query (e.g. postgresql, bigquery)
postgresql
ID of target table (optional)
550e8400-e29b-41d4-a716-446655440000
Default database name for resolving table references (optional)
production
Default schema name for resolving table references (optional)
public
GET /api/v1/lineage/lineage_from_query HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Accept: */*
{
"sql": "SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id",
"source_tables": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
],
"column_lineages": [
{
"from_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
},
"to_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}
],
"target_table": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}
Get lineage objects with optional filtering by source and destination entity.
The source resource.
7879886b-9e0e-4d02-8b37-c7d3c496a587
The destination resource.
b500ef23-c9b4-4259-a87d-d77b8b588f06
GET /api/v1/lineage/manual HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Accept: */*
{
"links": {
"next": "https://api.secoda.co/resource/all/?page=2",
"previous": "None"
},
"meta": {
"page": 1,
"previous_page": "None",
"next_page": 2
},
"count": 315,
"total_pages": 7,
"results": [
{
"id": "d935a76c-2125-4c30-9389-ef42fa7e23bb",
"created_at": "2023-08-16T23:12:53.245493Z",
"updated_at": "2023-08-16T23:12:53.245507Z",
"from_entity": "7879886b-9e0e-4d02-8b37-c7d3c496a587",
"to_entity": "b500ef23-c9b4-4259-a87d-d77b8b588f06",
"direction": "DOWNSTREAM",
"is_manual": true
}
]
}
Create a new lineage object manually. Only one direction of the relationship needs to be created. The opposite direction of the lineage is automatically generated.
Indicates the source of the resource data.
7879886b-9e0e-4d02-8b37-c7d3c496a587
Points to the final destination of the resouce data through various transformations and entities.
b500ef23-c9b4-4259-a87d-d77b8b588f06
Represents the flow of the resource data. Values can be - Upstream Downstream
DOWNSTREAM
POST /api/v1/lineage/manual HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Content-Type: application/json
Accept: */*
Content-Length: 130
{
"from_entity": "7879886b-9e0e-4d02-8b37-c7d3c496a587",
"to_entity": "b500ef23-c9b4-4259-a87d-d77b8b588f06",
"direction": "DOWNSTREAM"
}
{
"id": "d935a76c-2125-4c30-9389-ef42fa7e23bb",
"created_at": "2023-08-16T23:12:53.245493Z",
"updated_at": "2023-08-16T23:12:53.245507Z",
"from_entity": "7879886b-9e0e-4d02-8b37-c7d3c496a587",
"to_entity": "b500ef23-c9b4-4259-a87d-d77b8b588f06",
"direction": "DOWNSTREAM",
"is_manual": true
}
Create Lineage from a Query.
The SQL query to analyze for lineage relationships
SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
SQL dialect of the query (e.g. postgresql, bigquery)
postgresql
ID of target table (optional)
550e8400-e29b-41d4-a716-446655440000
Default database name for resolving table references (optional)
production
Default schema name for resolving table references (optional)
public
POST /api/v1/lineage/lineage_from_query HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Content-Type: application/json
Accept: */*
Content-Length: 237
{
"sql": "SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id",
"dialect": "postgresql",
"table_id": "550e8400-e29b-41d4-a716-446655440000",
"default_database": "production",
"default_schema": "public"
}
{
"sql": "SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id",
"source_tables": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
],
"column_lineages": [
{
"from_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
},
"to_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}
],
"target_table": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}
Create Lineage from Query and Removes Existing Upstream Non-Manual Lineage from Target Table.
The SQL query to analyze for lineage relationships
SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
SQL dialect of the query (e.g. postgresql, bigquery)
postgresql
ID of target table (optional)
550e8400-e29b-41d4-a716-446655440000
Default database name for resolving table references (optional)
production
Default schema name for resolving table references (optional)
public
PATCH /api/v1/lineage/lineage_from_query HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Content-Type: application/json
Accept: */*
Content-Length: 237
{
"sql": "SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id",
"dialect": "postgresql",
"table_id": "550e8400-e29b-41d4-a716-446655440000",
"default_database": "production",
"default_schema": "public"
}
{
"sql": "SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id",
"source_tables": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
],
"column_lineages": [
{
"from_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
},
"to_column": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customer_id",
"entity_type": "column",
"type": "varchar",
"schema_name": "public",
"database_name": "production",
"native_type": "varchar(255)",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}
],
"target_table": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2023-10-12T14:59:58.781935Z",
"updated_at": "2023-10-12T15:06:19.251573Z",
"title": "customers",
"schema_name": "public",
"database_name": "production",
"native_type": "table",
"integration_id": "337c5803-b484-4128-a24d-dcc55dee2ea2",
"integration_title": "Production Snowflake",
"integration_type": "snowflake"
}
}