Lineage

The dependencies between resources. Learn more about lineage here.

List Lineage

get
/api/v1/lineage/manual/

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

Authorizations
Query parameters
from_entityany ofOptional
stringOptional
or
nullOptional
from_entity_idany ofOptional
stringOptional
or
nullOptional
from_entity__inany ofOptional
stringOptional
or
nullOptional
to_entityany ofOptional
stringOptional
or
nullOptional
to_entity_idany ofOptional
stringOptional
or
nullOptional
to_entity__inany ofOptional
stringOptional
or
nullOptional
integration_typeany ofOptional
stringOptional
or
nullOptional
integration__typeany ofOptional
stringOptional
or
nullOptional
pageintegerOptionalDefault: 1
Responses
200

OK

application/json
get
/api/v1/lineage/manual/
GET /api/v1/lineage/manual/ HTTP/1.1
Host: api.secoda.co
Accept: */*
200

OK

{
  "links": {
    "next": "text",
    "previous": "text"
  },
  "meta": {
    "page": 1,
    "previous_page": 1,
    "next_page": 1,
    "count": 1,
    "total_pages": 1
  },
  "count": 1,
  "total_pages": 1,
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-11-26T00:17:16.067Z",
      "updated_at": "2025-11-26T00:17:16.067Z",
      "from_entity_id": "123e4567-e89b-12d3-a456-426614174000",
      "to_entity_id": "123e4567-e89b-12d3-a456-426614174000",
      "direction": "text",
      "workspace_id": "123e4567-e89b-12d3-a456-426614174000",
      "is_manual": false
    }
  ]
}

Get Lineage

get
/api/v1/lineage/manual/{lineage_id}/

Get a lineage object by its ID.

Authorizations
Path parameters
lineage_idstringRequired
Responses
200

OK

application/json
get
/api/v1/lineage/manual/{lineage_id}/
GET /api/v1/lineage/manual/{lineage_id}/ HTTP/1.1
Host: api.secoda.co
Accept: */*
200

OK

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-11-26T00:17:16.067Z",
  "updated_at": "2025-11-26T00:17:16.067Z",
  "from_entity_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_entity_id": "123e4567-e89b-12d3-a456-426614174000",
  "direction": "text",
  "workspace_id": "123e4567-e89b-12d3-a456-426614174000",
  "is_manual": false
}

Delete Lineage

delete
/api/v1/lineage/manual/{lineage_id}/

Delete a lineage object by its ID.

Authorizations
Path parameters
lineage_idstringRequired
Responses
delete
/api/v1/lineage/manual/{lineage_id}/
DELETE /api/v1/lineage/manual/{lineage_id}/ HTTP/1.1
Host: api.secoda.co
Accept: */*
204

No Content

No content

Preview Lineage from Query

get
/api/v1/lineage/lineage_from_query/

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
get
/api/v1/lineage/lineage_from_query/
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
Accept: */*
200

OK

{
  "sql": "text",
  "source_tables": [
    {
      "id": "text",
      "created_at": "2025-11-26T00:17:16.067Z",
      "updated_at": "2025-11-26T00:17:16.067Z",
      "title": "text",
      "schema_name": "text",
      "database_name": "text",
      "native_type": "text",
      "integration_id": "text",
      "integration_title": "text",
      "integration_type": "text"
    }
  ],
  "column_lineages": [
    {
      "from_column": {
        "id": "text",
        "created_at": "2025-11-26T00:17:16.067Z",
        "updated_at": "2025-11-26T00:17:16.067Z",
        "title": "text",
        "entity_type": "text",
        "type": "text",
        "schema_name": "text",
        "database_name": "text",
        "native_type": "text",
        "integration_id": "text",
        "integration_title": "text",
        "integration_type": "text"
      },
      "to_column": {
        "id": "text",
        "created_at": "2025-11-26T00:17:16.067Z",
        "updated_at": "2025-11-26T00:17:16.067Z",
        "title": "text",
        "entity_type": "text",
        "type": "text",
        "schema_name": "text",
        "database_name": "text",
        "native_type": "text",
        "integration_id": "text",
        "integration_title": "text",
        "integration_type": "text"
      }
    }
  ],
  "target_table": {
    "id": "text",
    "created_at": "2025-11-26T00:17:16.067Z",
    "updated_at": "2025-11-26T00:17:16.067Z",
    "title": "text",
    "schema_name": "text",
    "database_name": "text",
    "native_type": "text",
    "integration_id": "text",
    "integration_title": "text",
    "integration_type": "text"
  }
}

Create Lineage from Query

post
/api/v1/lineage/lineage_from_query/

Create Lineage from a Query.

Authorizations
Body
sqlstringRequired
dialectstringRequired
table_idany ofOptional
stringOptional
or
nullOptional
default_databaseany ofOptional
stringOptional
or
nullOptional
default_schemaany ofOptional
stringOptional
or
nullOptional
Responses
200

OK

No content

post
/api/v1/lineage/lineage_from_query/
POST /api/v1/lineage/lineage_from_query/ HTTP/1.1
Host: api.secoda.co
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "sql": "text",
  "dialect": "text",
  "table_id": "text",
  "default_database": "text",
  "default_schema": "text"
}

No content

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

patch
/api/v1/lineage/lineage_from_query/

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

Authorizations
Body
sqlstringRequired
dialectstringRequired
table_idany ofOptional
stringOptional
or
nullOptional
default_databaseany ofOptional
stringOptional
or
nullOptional
default_schemaany ofOptional
stringOptional
or
nullOptional
Responses
200

OK

No content

patch
/api/v1/lineage/lineage_from_query/
PATCH /api/v1/lineage/lineage_from_query/ HTTP/1.1
Host: api.secoda.co
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "sql": "text",
  "dialect": "text",
  "table_id": "text",
  "default_database": "text",
  "default_schema": "text"
}

No content

Create new Lineage

post
/api/v1/lineage/

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_entitystringRequired
to_entitystringRequired
directionall ofOptionalDefault: DOWNSTREAM
string · enumOptionalPossible values:
Responses
200

OK

application/json
post
/api/v1/lineage/
POST /api/v1/lineage/ HTTP/1.1
Host: api.secoda.co
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "from_entity": "text",
  "to_entity": "text",
  "direction": "DOWNSTREAM"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-11-26T00:17:16.067Z",
  "updated_at": "2025-11-26T00:17:16.067Z",
  "from_entity_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_entity_id": "123e4567-e89b-12d3-a456-426614174000",
  "direction": "text",
  "workspace_id": "123e4567-e89b-12d3-a456-426614174000",
  "is_manual": false
}

Last updated

Was this helpful?