Secoda Docs
Get Started
  • Getting Started with Secoda
    • Secoda as an Admin
      • Deployment options
      • Sign in options
      • Settings
      • Connect your data
        • Define Service Accounts
        • Choose which schemas to extract
      • Customize the workspace
      • Populate Questions with FAQs
      • Invite your teammates
        • Joining & Navigating between Multiple Workspaces
      • Onboard new users
        • Onboarding email templates
        • Onboarding Homepage template
        • Training session guide
      • User engagement and adoption
        • Tips & Tricks to share with new users
    • Secoda as an Editor
    • Secoda as a Viewer
      • Introduction guide
      • Requesting changes in Secoda
  • Best practices
    • Setting up your workspace
    • Integrating Secoda into existing workflows
    • Documentation best practices
    • Glossary best practices
    • Data governance
    • Data quality
    • Clean up your data
    • Tool migrations using Secoda
    • Slack <> Questions workflow
    • Defining resources workflow
    • Streamline data access: Private and public teams workflow
    • Exposing Secoda to external clients
  • Resource Management
    • Editing Properties
      • AI Description Editor
      • Bulk Editing
      • Propagation
      • Templates
    • Resource Sidesheet
    • Assigning Owners
    • Custom Properties
    • Tags
      • Custom Tags
      • PII Identifier
      • Verified Identifier
    • Import and Export Resources
    • Related Resources
  • User Management
    • Roles
    • Teams
    • Groups
  • Integrations
    • Integration Settings
    • Data Warehouses
      • BigQuery
        • BigQuery Metadata Extracted
      • Databricks
        • Databricks Metadata Extracted
      • Redshift
        • Redshift Metadata Extracted
      • Snowflake
        • Snowflake Metadata Extracted
        • Snowflake Costs
        • Snowflake Native App
      • Apache Hive
        • Apache Hive Metadata Extracted
      • Azure Synapse
        • Azure Synapse Metadata Extracted
      • MotherDuck
        • MotherDuck Metadata Extracted
      • ClickHouse
        • ClickHouse Metadata Extracted
    • Databases
      • Druid
        • Druid Metadata Extracted
      • MySQL
        • MySQL Metadata Extracted
      • Microsoft SQL Server
        • Page
        • Microsoft SQL Server Metadata Extracted
      • Oracle
        • Oracle Metadata Extracted
      • Salesforce
        • Salesforce Metadata Extracted
      • Postgres
        • Postgres Metadata Extracted
      • MongoDB
        • MongoDB Metadata Extracted
      • Azure Cosmos DB
        • Azure Cosmos DB Metadata Extracted
      • SingleStore
        • SingleStore Metadata Extracted
      • DynamoDB
        • DynamoDB Metadata Extracted
    • Data Visualization Tools
      • Amplitude
        • Amplitude Metadata Extracted
      • Looker
        • Looker Metadata Extracted
      • Looker Studio
        • Looker Studio Metadata Extracted
      • Metabase
        • Metabase Metadata Extracted
      • Mixpanel
        • Mixpanel Metadata Extracted
      • Mode
        • Mode Metadata Extracted
      • Power BI
        • Power BI Metadata Extracted
      • QuickSight
        • QuickSight Metadata Extracted
      • Retool
        • Retool Metadata Extracted
      • Redash
        • Redash Metadata Extracted
      • Sigma
        • Sigma Metadata Extracted
      • Tableau
        • Tableau Metadata Extracted
      • ThoughtSpot
        • ThoughtSpot Metadata Extracted
      • Cluvio
        • Cluvio Metadata Extracted
      • Hashboard
        • Hashboard Metadata Extracted
      • Lightdash
        • Lightdash Metadata Extracted
      • Preset
        • Preset Metadata Extracted
      • Superset
        • Superset Metadata Extracted
      • SQL Server Reporting Services
        • SQL Server Reporting Services Metadata Extracted
      • Hex
        • Hex Metadata Extracted
      • Omni
        • Omni Metadata Extracted
    • Data Pipeline Tools
      • Census
        • Census Metadata Extracted
      • Stitch
        • Stitch Metadata Extracted
      • Airflow
        • Airflow Metadata Extracted
      • Dagster
        • Dagster Metadata Extracted
      • Fivetran
        • Fivetran Metadata Extracted
      • Glue
        • Glue Metadata Extracted
      • Hightouch
        • Hightouch Metadata Extracted
      • Apache Kafka
        • Apache Kafka Metadata Extracted
      • Confluent Cloud
        • Confluent Cloud Metadata Extracted
      • Polytomic
        • Polytomic Metadata Extracted
      • Matillion
        • Matillion Metadata Extracted
      • Airbyte
        • Airbyte Extracted Metadata
      • Informatica
        • Informatica Metadata Extracted
      • Azure Data Factory
        • Azure Data Factory Metadata Extracted
    • Data Transformation Tools
      • dbt
        • dbt Cloud
          • dbt Cloud Metadata Extracted
        • dbt Core
          • dbt Core Metadata Extracted
      • Coalesce
        • Coalesce Metadata Extracted
    • Data Quality Tools
      • Cyera
      • Dataplex
        • Dataplex Metadata Extracted
      • Great Expectations
        • Great Expectations Metadata Extracted
      • Monte Carlo
        • Monte Carlo Metadata Extracted
      • Soda
        • Soda Metadata Extracted
    • Data Lakes
      • Google Cloud Storage
        • GCS Metadata Extracted
      • AWS S3
        • S3 Metadata Extracted
    • Query Engines
      • Trino
        • Trino Metadata Extracted
    • Custom Integrations
      • File Upload
        • CSV File Format
        • JSONL File Format
        • Maintain your Resources
      • Marketplace
        • Secoda SDK
        • Upload and Connect your Marketplace Integration
        • Publish the Integration
        • Example Integrations
      • Secoda Fields Explained
    • Security
      • Connecting via Reverse SSH Tunnel
      • Connecting via SSH Tunnel
      • Connecting via VPC Peering
      • Connecting via AWS Cross Account Role
      • Connecting via AWS PrivateLink
        • Snowflake via AWS PrivateLink
        • AWS Service via AWS PrivateLink
      • Recommendations to Improve SSH Tunnel Concurrency on SSH Bastion
    • Push Metadata to Source
  • Extensions
    • Chrome
    • Confluence
      • Confluence Metadata Extracted
      • Confluence best practices
    • Git
    • GitHub
    • Jira
      • Jira Metadata Extracted
    • Linear
    • Microsoft Teams
    • PagerDuty
    • Slack
      • Slack user guide
  • Features
    • Access Requests
    • Activity Log
    • Analytics
    • Announcements
    • Audit Log
    • Automations
      • Automations Use Cases
    • Archive
    • Bookmarks
    • Catalog
    • Collections
    • Column Profiling
    • Data Previews
    • Data Quality Score
    • Documents
      • Comments
      • Embeddings
    • Filters
    • Glossary
    • Homepage
    • Inbox
    • Lineage
      • Manual Lineage
    • Metrics
    • Monitors
      • Monitoring Use Cases
    • Notifications
    • Policies
    • Popularity
    • Publishing
    • Queries
      • Query Blocks
        • Chart Blocks
      • Extracted Queries
    • Questions
    • Search
    • Secoda AI
      • Secoda AI User Guide
      • Secoda AI Use Cases
      • Secoda AI Security FAQs
      • Prompts
    • Sharing
    • Views
  • Enterprise
    • SAML
      • Okta SAML
      • OneLogin SAML
      • Microsoft Azure AD SAML
      • Google SAML
      • SCIM
      • SAML Attributes
    • Self-Hosted
      • Additional Resources
        • Additional Environment Variables
          • PowerBI OAuth Application (on-premise)
          • Google OAuth Application (on-premise)
          • Github Application (on-premise)
          • OpenAI API Key Creation (on-premise)
          • AWS Bucket with Access Keys (on-premise)
        • TLS/SSL (Docker compose)
        • Automatic Updates (Docker compose)
        • Backups (Docker compose)
        • Outbound Connections
      • Self-Hosted Changelog
    • SIEM
      • Google Chronicle
  • API
    • Get Started
    • Authentication
    • Example Workflows
    • API Reference
      • Getting Started
      • Helpful Information
      • Audit Logs
      • Charts
      • Collections
      • Columns
      • Custom Properties
      • Dashboards
      • Databases
      • Documents
      • Events
      • Groups
      • Integrations
      • Lineage
      • Monitors
      • Resources
      • Schemas
      • Tables
      • Tags
      • Teams
      • Users
      • Questions
      • Queries
      • Getting Started
      • Helpful Information
      • Audit Logs
      • Charts
      • Collections
      • Columns
      • Custom Properties
      • Dashboards
      • Databases
      • Documents
      • Events
      • Groups
      • Integrations
      • Lineage
      • Monitors
      • Resources
      • Schemas
      • Tables
      • Tags
      • Teams
      • Users
      • Questions
      • Queries
  • FAQ
  • Policies
    • Terms of Use
    • Secoda AI Terms
    • Master Subscription Agreement
    • Privacy Policy
    • Security Policy
    • Accessibility Statement
    • Data Processing Agreement
    • Subprocessors
    • Service Level Agreement
    • Bug Bounty Program
  • System Status
  • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. API
  2. API Reference

Lineage

Was this helpful?

The dependencies between resources. Learn more about lineage .

here

Get Lineage

get

Get a lineage object by its ID.

Authorizations
Path parameters
lineage_idstringRequired

The ID of the lineage entry to retrieve.

Example: 34d983b3-bfe0-4b49-abea-0692c8be6693
Responses
200
OK
application/json
404
Not Found
500
Internal Server Error
get
GET /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 Lineage

delete

Delete a lineage object by its ID.

Authorizations
Path parameters
lineage_idstringRequired

The ID of the lineage entry to delete.

Example: 34d983b3-bfe0-4b49-abea-0692c8be6693
Responses
204
No Content
404
Not Found
500
Internal Server Error
delete
DELETE /lineage/manual/{lineage_id} HTTP/1.1
Host: api.secoda.co
Authorization: Bearer string
Accept: */*

No content

Preview Lineage from Query

get

Preview Lineage from a Query.

Authorizations
Query parameters
sqlstringRequired

The SQL query to analyze for lineage relationships

Example: SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
dialectstringRequired

SQL dialect of the query (e.g. postgresql, bigquery)

Example: postgresql
table_idstringOptional

ID of target table (optional)

Example: 550e8400-e29b-41d4-a716-446655440000
default_databasestringOptional

Default database name for resolving table references (optional)

Example: production
default_schemastringOptional

Default schema name for resolving table references (optional)

Example: public
Responses
200
OK
application/json
400
Bad Request
404
Provided table ID does not exist
500
Internal Server Error
get
GET /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"
  }
}
  • GETList Lineage
  • POSTCreate new Lineage
  • GETGet Lineage
  • DELETEDelete Lineage
  • GETPreview Lineage from Query
  • POSTCreate Lineage from Query
  • PATCHCreate Lineage from Query and Removes Existing Upstream Non-Manual Lineage from Target Table

List Lineage

get

Get lineage objects with optional filtering by source and destination entity.

Authorizations
Query parameters
from_entity__instringOptional

The source resource.

Example: 7879886b-9e0e-4d02-8b37-c7d3c496a587
to_entity__instringOptional

The destination resource.

Example: b500ef23-c9b4-4259-a87d-d77b8b588f06
Responses
200
List of lineage entries.
application/json
Responseall of
400
Bad Request
500
Internal Server Error
get
GET /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 new Lineage

post

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.

Authorizations
Body
from_entitystringOptional

Indicates the source of the resource data.

Example: 7879886b-9e0e-4d02-8b37-c7d3c496a587
to_entitystringOptional

Points to the final destination of the resouce data through various transformations and entities.

Example: b500ef23-c9b4-4259-a87d-d77b8b588f06
directionstringOptional

Represents the flow of the resource data. Values can be - Upstream Downstream

Example: DOWNSTREAM
Responses
201
Created
application/json
400
Bad Request
500
Internal Server Error
post
POST /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 Query

post

Create Lineage from a Query.

Authorizations
Body
sqlstringRequired

The SQL query to analyze for lineage relationships

Example: SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
dialectstringRequired

SQL dialect of the query (e.g. postgresql, bigquery)

Example: postgresql
table_idstringOptional

ID of target table (optional)

Example: 550e8400-e29b-41d4-a716-446655440000
default_databasestringOptional

Default database name for resolving table references (optional)

Example: production
default_schemastringOptional

Default schema name for resolving table references (optional)

Example: public
Responses
200
OK
application/json
400
Bad Request
404
Provided table ID does not exist
500
Internal Server Error
post
POST /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

patch

Create Lineage from Query and Removes Existing Upstream Non-Manual Lineage from Target Table.

Authorizations
Body
sqlstringRequired

The SQL query to analyze for lineage relationships

Example: SELECT a.customer_id, b.order_id FROM customers a JOIN orders b ON a.customer_id = b.customer_id
dialectstringRequired

SQL dialect of the query (e.g. postgresql, bigquery)

Example: postgresql
table_idstringOptional

ID of target table (optional)

Example: 550e8400-e29b-41d4-a716-446655440000
default_databasestringOptional

Default database name for resolving table references (optional)

Example: production
default_schemastringOptional

Default schema name for resolving table references (optional)

Example: public
Responses
200
OK
application/json
400
Bad Request
404
Provided table ID does not exist
500
Internal Server Error
patch
PATCH /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"
  }
}