Lineage
The dependencies between resources. Learn more about lineage here.
Get lineage objects with optional filtering by source and destination entity.
The source resource.
7879886b-9e0e-4d02-8b37-c7d3c496a587The destination resource.
b500ef23-c9b4-4259-a87d-d77b8b588f06List of lineage entries.
Bad Request
Internal Server Error
GET /api/v1/lineage/manual HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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-c7d3c496a587Points to the final destination of the resouce data through various transformations and entities.
b500ef23-c9b4-4259-a87d-d77b8b588f06Represents the flow of the resource data. Values can be - Upstream Downstream
DOWNSTREAMCreated
Bad Request
Internal Server Error
POST /api/v1/lineage/manual HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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
}Get a lineage object by its ID.
The ID of the lineage entry to retrieve.
34d983b3-bfe0-4b49-abea-0692c8be6693OK
Not Found
Internal Server Error
GET /api/v1/lineage/manual/{lineage_id} HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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-0692c8be6693No Content
No content
Not Found
Internal Server Error
DELETE /api/v1/lineage/manual/{lineage_id} HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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_idSQL dialect of the query (e.g. postgresql, bigquery)
postgresqlID of target table (optional)
550e8400-e29b-41d4-a716-446655440000Default database name for resolving table references (optional)
productionDefault schema name for resolving table references (optional)
publicOK
Bad Request
Provided table ID does not exist
Internal Server Error
GET /api/v1/lineage/lineage_from_query?sql=SELECT+a.customer_id%2C+b.order_id+FROM+customers+a+JOIN+orders+b+ON+a.customer_id+%3D+b.customer_id&dialect=postgresql HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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"
}
}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_idSQL dialect of the query (e.g. postgresql, bigquery)
postgresqlID of target table (optional)
550e8400-e29b-41d4-a716-446655440000Default database name for resolving table references (optional)
productionDefault schema name for resolving table references (optional)
publicOK
Bad Request
Provided table ID does not exist
Internal Server Error
POST /api/v1/lineage/lineage_from_query HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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
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_idSQL dialect of the query (e.g. postgresql, bigquery)
postgresqlID of target table (optional)
550e8400-e29b-41d4-a716-446655440000Default database name for resolving table references (optional)
productionDefault schema name for resolving table references (optional)
publicOK
Bad Request
Provided table ID does not exist
Internal Server Error
PATCH /api/v1/lineage/lineage_from_query HTTP/1.1
Host: api.secoda.co
Authorization: Bearer YOUR_SECRET_TOKEN
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"
}
}Last updated
Was this helpful?