# API Examples

Here are some of the most common use cases of Select Star API. We recommend using the API for understanding multi-level downstream lineage of a table, table/dashboard usage and many such use cases.

Check out the examples below:

### BI/Dashboards

To learn more about Dashboard metadata, see [Dashboard](https://docs.selectstar.com/features/dashboard-page).

## Get a list of Frequent Users for a dashboard

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/v1/bi/dashboards/{guid}/frequent-dsusers/`

When you want to identify most frequent users of a given dashboard, you can use the [`frequent_dsusers`](https://api.production.selectstar.com/docs/#operation/bi_explores_frequent-dsusers_read) endpoint.

**frequent-dsusers** - This endpoint is only available for dashboards.

#### Path Parameters

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| guid<mark style="color:red;">\*</mark> | String | GUID of the dashboard |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "count": 1, #Number of users
    "next": null,
    "previous": null,
    "results": [
        {
            "guid": "du_kJEyvzXcGEkLGzCjWQ5DZp", #GUID of the user
            "name": "product@getselectstar.com",
            "display_name": "product@getselectstar.com", #The username field for the user used by the datasource
            "user": null,
            "query_count": 7, #Number of times user executed the dashboard
            "last_queried": "2022-10-28",
            "data_source": {
                "guid": "ds_HPqMxFcUsNmNmhQNPbiEEJ",
                "type": "tableau",
                "name": "Tableau",
                "last_ingested_on": "2022-11-22T20:00:59.761699Z"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="403: Forbidden Missing permission to perform this action" %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found The requested resource was not found on this server" %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

## Get a list of related dashboard used in a Looker Explore

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/v1/bi/explores/{guid}/related-dashboards/`

When you want to identify the list of [related dashboards](https://docs.selectstar.com/data-discovery/how-can-i-use-this-data#related-dashboards-and-tables) for a Looker Explore, you can use the [`related-dashboards`](https://api.production.selectstar.com/docs/#operation/bi_explores_related-dashboards_list) endpoint.

**related-dashboards** - All Looker Dashboards that were created from the Looker Explore are considered as related-dashboards.

`This endpoint is only available for Looker Explore.`

#### Path Parameters

| Name                                   | Type   | Description                |
| -------------------------------------- | ------ | -------------------------- |
| guid<mark style="color:red;">\*</mark> | String | GUID of the Looker Explore |

#### Query Parameters

| Name       | Type    | Description                           |
| ---------- | ------- | ------------------------------------- |
| page\_size | Integer | Number of results to return per page. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "count": 2, #Number of related dashboards
    "next": null,
    "previous": null,
    "results": [
        {
            "dashboard": {
                "guid": "da_TYR2MoHpGYVftsspXsXzR4", #GUID of the related Dashboard
                "name": "Brand Lookup",
                "data_type": "dashboard",
                "description": "",
                "dashboard_created_at": "2022-08-05T22:03:49Z",
                "dashboard_updated_at": "2022-08-05T22:03:49Z",
                "last_successful_run": "2022-11-15T18:15:03Z",
                "last_run_at": "2022-11-15T18:15:03Z",
                "dsuser_created_by": {
                    "guid": "du_kRtTNGNtQh23Cbbn6yWhpm",
                    "data_source": {
                        "guid": "ds_NTAQWUYKfUyQ5DwpevfK4G",
                        "type": "looker",
                        "name": "Looker",
                        "last_ingested_on": "2022-11-22T20:00:32.805990Z"
                    },
                    "user": null,
                    "name": "bsandell@looker.com",
                    "display_name": "Bruce Sandell",
                    "email": "bsandell@looker.com",
                    "is_active": true,
                    "is_service_account": false,
                    "is_mode_service_account": false,
                    "is_periscope_service_account": false,
                    "is_sigma_service_account": false
                },
                "top_dsuser": {
                    "guid": "du_BUkH62VCEbPKK4Z6kyavGs",
                    "data_source": {
                        "guid": "ds_NTAQWUYKfUyQ5DwpevfK4G",
                        "type": "looker",
                        "name": "Looker",
                        "last_ingested_on": "2022-11-22T20:00:32.805990Z"
                    },
                    "user": {
                        "guid": "us_WyVTwTHrBS3b6Tq8GsAPfF",
                        "first_name": "Chloe",
                        "last_name": "Kim",
                        "email": "chloe@getselectstar.com",
                        "avatar": "https://select-star-media-bucket.s3.amazonaws.com/production/us_WyVTwTHrBS3b6Tq8GsAPfF/avatar.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAZZIYXDRAF3BQM7DP%2F20221122%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20221122T212836Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKX%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMiJGMEQCIAkQlfjJKgC2otdEDKnWT1Um5%2BiULfTjiBbv2IG0OvGEAiAgsUgeAmn2gf2fcnkYZZtbi1lz3LFp8HADHslhd9iUlyqcBQiv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDY3Mjc1MTA5ODk0NCIMPZ1u2QMQlDd8c6D4KvAEZ7Oj7DOYCUBCDZ8GGHwHz%2FgWiPTzNdsfg7TNua7hUqabRTZchaG2zaVXqrXO2zh%2BS5m66RamHVQ%2BvmuT7%2B8YcKROqOY%2Fn50EKiO1MiDEyY4MpERAHRNAr%2F1XZyoPEcrZ7JKuZCXf3v7gBGyVOhw%2BsFnrSsaij6Tr5M8zFwURcsDv0EtLCxSbr4EZwYlXI%2FnUoPU53xhLPmL%2FR5wR7pBAA9C8LK4q9D%2FwT8hG9tE3IR7KmIq9xE7kX6%2BlExVyGrW%2F7nOwZ7a1Q0cAIPRvNV6xi0OlVts%2BSGzxDwoSsZQKVaWQn9w%2FzMWW%2FDk3FhfpWXvjUXNbVLNcaCgdk7K%2BgH4K78%2BUerIksgMSQxLU0pL6qGpnDTeH4EdkJobOmOnKnYXWN06ZKtNsgvLOEPPdL2XUaP5NdB3wr%2FJhqTW95av0kBgm%2Bxz10W4T%2FKgQpVOjYuyQcUYYI1IoBH4KydRe6OK5RcntcGA5qVHJCKjUWlQ2juDa8FvGTB89mIQDDU8M629W35xgLeDGlP7IcKNBeDOrB%2BUHVrXLR24a%2BcHYuGDNvaNLBp2%2BFTMut902XCSlxyZZ8UaYSOe14xFkAm5l1UkQyy4qwkdAqGbSfh8WVfaJac%2FESw1%2Bh9InVqWUKbhk5G8tMSIPprhZCJMbVPuhc2Et4M45a5RcHNa2JC6TAoLdOOE8XRPMy5CGMHUL64Us3%2BbhmWo7CwyhroSqBDwe4u7dhPsM%2BvJq6I3okQrixFB6FeJgTS4hnVZNtYPXPkul3etV5T6s5kjdZTw%2BtjpIdgFZ9bJ4Hh9tCbCNy6xzZyLXBayXKQKpPDvrKuNtHQtIK26nMIT%2B9JsGOpwBCOHPoCx6IYGmBJWGjMujH%2Bkn%2BgcIY1YSHRrg4zzKfJ2l8ohdCUXhXnNwhnSv%2B9TojxfLP2lzl4bIdwEH6tCbq4ObqM6q1eevqlpDutqU16BpClCs9Kpvi7%2FNSZ2HA4DFgel7kitH%2BseJDseNxhIjpPj%2BZNAViBoPGOJ6eog0jyd8KkLivsZSMg2Ko6ALNejQ56r%2BAb4jxPmRWKHq&X-Amz-Signature=1b3d1381149a15aab1a7846160123d6f8163ba8d5b4e89fbcf780678c450bdac",
                        "title": "",
                        "team": {
                            "guid": "te_FWt5jxgH8gkaCbajP4E3Lj",
                            "name": "Design"
                        },
                        "last_login": "2022-11-10T18:28:06.627246Z",
                        "last_activity": "2022-11-22T21:27:55.584456Z",
                        "has_usable_password": true,
                        "is_invitation_pending": false,
                        "is_active": true,
                        "is_verified": true,
                        "is_agreed_to_terms": true,
                        "settings": {
                            "enable_email_notifications": true,
                            "is_newsletter_subscribed": true
                        },
                        "created_on": "2021-07-19T14:35:19.717934Z"
                    },
                    "name": "chloe@getselectstar.com",
                    "display_name": "Chloe Kim",
                    "email": "chloe@getselectstar.com",
                    "is_active": true,
                    "is_service_account": false,
                    "is_mode_service_account": false,
                    "is_periscope_service_account": false,
                    "is_sigma_service_account": false
                },
                "url": "https://selectstar.cloud.looker.com/dashboards/34",
                "popularity": {
                    "timeframe": 90,
                    "user_count": 0,
                    "view_count": 8,
                    "service_query_count": 0,
                    "popularity": 25,
                    "ends_on": "2022-11-22"
                },
                "full_path": "Shared.Looker eCommerce.Brand Lookup"
            },
            "view_count": 8,
            "field_count": 14,
            "rank": 8
        },
        {
            "dashboard": {
                "guid": "da_oGJGhbwvKiPpZL2GCHKde9", #GUID of the related Dashboard
                "name": "Similar Audience Optimizer",
                "data_type": "dashboard",
                "description": "",
                "dashboard_created_at": "2022-08-05T22:03:56Z",
                "dashboard_updated_at": "2022-08-05T22:03:56Z",
                "last_successful_run": null,
                "last_run_at": null,
                "dsuser_created_by": {
                    "guid": "du_kRtTNGNtQh23Cbbn6yWhpm",
                    "data_source": {
                        "guid": "ds_NTAQWUYKfUyQ5DwpevfK4G",
                        "type": "looker",
                        "name": "Looker",
                        "last_ingested_on": "2022-11-22T20:00:32.805990Z"
                    },
                    "user": null,
                    "name": "bsandell@looker.com",
                    "display_name": "Bruce Sandell",
                    "email": "bsandell@looker.com",
                    "is_active": true,
                    "is_service_account": false,
                    "is_mode_service_account": false,
                    "is_periscope_service_account": false,
                    "is_sigma_service_account": false
                },
                "top_dsuser": null,
                "url": "https://selectstar.cloud.looker.com/dashboards/41",
                "popularity": {
                    "timeframe": 90,
                    "user_count": 0,
                    "view_count": 0,
                    "service_query_count": 0,
                    "popularity": 0,
                    "ends_on": "2022-11-22"
                },
                "full_path": "Shared.Looker eCommerce.Similar Audience Optimizer"
            },
            "view_count": 0,
            "field_count": 12,
            "rank": 0
        }
    ]
}
```

{% endtab %}

{% tab title="403: Forbidden Missing permission to perform this action" %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found The requested resource was not found on this server" %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

### Databases/Tables

## Get GUID for a table using full path of the object

<mark style="color:blue;">`GET`</mark> `GET https://api.production.getselectstar.com/v1/tables/?search_name=Snowflake.NewAdventureWorks.Person.Address&query={guid}`

When you want to get the GUID for a specific table, you can use the [`tables`](https://api.production.selectstar.com/docs/#tag/tables) API command.

If you want to get the GUID of a specific column, use the `columns` API command with the **search\_name** parameter and provide the full path of the object, including the column name.

**search\_name** - Please specify a search term i.e. full path of the object.

#### Query Parameters

| Name                                           | Type   | Description                                                                                     |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------- |
| search\_name<mark style="color:red;">\*</mark> | String | Enter the full path of the object. *{Select Star Data Source Name}.{Database}.{Schema}.{Table}* |
| query<mark style="color:red;">\*</mark>        | String | Values: \['guid']                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "count": 1,
    "schema_count": 1,
    "model_count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "guid": "ta_BKXKKCBg6ZN3Y73Lvw3XUT"
        }
    ]
}
```

{% endtab %}

{% tab title="403: Forbidden " %}

```json
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

## Get GUIDs for the tables with popularity over 90% (Top 10 percent of most used tables)

<mark style="color:blue;">`GET`</mark> `https://api.production.getselectstar.com/v1/tables/?popularity=90-100&order=-popularity&search_name={tablename}&last_queried_on__gte=2022-11-04T0:00:00`

When you want to get the GUID for a list of tables with popularity over 90%, you can use the [`tables`](https://api.production.selectstar.com/docs/#tag/tables) API command with `popularity` parameter.

To learn about popularity, see [Popularity](https://docs.selectstar.com/data-discovery/how-can-i-use-this-data#popularity).

**popularity** - If you want to search for tables based on popularity, include this parameter. You will need to provide a comma separated list of popularity ranges (inclusive), which can include integers from 1-100, like `1-10,90-100` , which in this case would be the bottom 10 percent and the top 10 percent, respectively. In the example above, `popularity=90-100` will search for tables with popularity 90% or higher, i.e. in the top 10 percent.

**order** - If you want to specify the ordering for the results, include this parameter. Provide a comma separated list for ordering by multiple fields and a preceding `-` indicates reverse order. Supported fields: \['description', 'name', 'popularity']. In the example above, `-popularity` will sort results in desc order by popularity.

**search\_name** - If you want to specify a search term i.e. table name, include this parameter.

If you want to filter objects by last\_queried\_on, use these parameters -

**last\_queried\_on\_\_gte** - `gte` stands for **greater than or equal.** You can also use `gt`, which is greater than.

**last\_queried\_on\_\_lte** - `lte` stands for **less than or equal.** You can also use `lt`, which is less than.

#### Query Parameters

| Name                     | Type   | Description                                                                              |
| ------------------------ | ------ | ---------------------------------------------------------------------------------------- |
| popularity               | String | A comma separated list of popularity ranges (inclusive) can include integers from 1-100. |
| order                    | String | Values: \['description', 'name', 'popularity'].                                          |
| search\_name             | String | Enter the table name                                                                     |
| last\_queried\_on\_\_gte | String | Enter upper bound Date/Datetime (in UTC)                                                 |
| last\_queried\_on\_\_lte | String | Enter lower bound Date/Datetime (in UTC)                                                 |
| page\_size               | String | Number of results to return per page.                                                    |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "count": 1,
    "schema_count": 1,
    "model_count": 0,
    "next": null,
    "previous": null,
    "results": [
        {
            "guid": "ta_kfxXdgsDoihByBFJ6g3XCY", #GUID for Table
            "database": {
                "guid": "db_GpL8TFT7Fij78t5CkDkr4x",
                "data_source": {
                    "guid": "ds_8dwHHgh72GXApBmdWTjmYQ",
                    "type": "snowflake",
                    "name": "Snowflake",
                    "last_ingested_on": "2022-12-02T15:17:43.892332Z",
                    "last_fully_ingested_on": "2022-12-02T15:13:47.673400Z",
                    "is_ingesting": false,
                    "connection_status": "OK",
                    "connection_error_message": "",
                    "is_mode_discovery_db_added": null,
                    "external_uuid": null,
                    "iam_principal": null,
                    "cloudformation_url": "",
                    "is_credentials_setup_incomplete": false,
                    "processed_through": {
                        "start_time": [
                            {
                                "key": "start_time",
                                "date": "2022-12-02T06:52:29.870000-08:00"
                            }
                        ]
                    }
                },
                "name": "OLIST",
                "description": "This is a Brazilian ecommerce public dataset of orders made at Olist Store.",
                "richtext_description": "{...}",
                "schemata_count": 6,
                "breadcrumbs": [
                    {
                        "guid": "br_ZzK9mJPiBAXtxNWccWdgN7",
                        "target_guid": "ds_8dwHHgh72GXApBmdWTjmYQ",
                        "target_name": "Snowflake",
                        "target_object_type": "datasource",
                        "target_data_type": "snowflake",
                        "target_data_source_guid": "ds_8dwHHgh72GXApBmdWTjmYQ",
                        "target_data_source_type": "snowflake",
                        "ordinal": 0
                    }
                ],
                "search_name": "OLIST"
            },
            "schema": {...
            },
            "technical_owner": {
                "object_type": "team",
                "obj": {
                    "guid": "te_W5LEtHQyu9Y8yzh85JazSD",
                    "name": "Engineering",
                    "members_count": 14
                }
            },
            "updates_on": null,
            "last_updated_on": "2022-04-17T12:33:24.511000Z",
            "last_queried_on": "2022-12-02T10:03:07.446000Z", #Table last queried on Datetime
            "last_refreshed_on": null,
            "db_created_on": "2020-09-10T02:42:42.719000Z",
            "popularity": {
                "timeframe": 90,
                "user_count": 4,
                "query_count": 170,
                "service_query_count": 517,
                "popularity": 100,
                "ends_on": "2022-12-02"
            },
            "tags": [....]
            "updated_on": "2022-09-30T13:23:57.507452Z",
            "created_on": "2021-07-22T16:08:10.654995Z",
            "table_type": "table",
            "data_type": "table",
            "bytes": 9049088,
            "row_count": 99442,
            "is_hidden": false,
            "downstream_objects_counts": {...
            },
            "upstream_objects_counts": {...
            },
            "extra": null,
            "breadcrumbs": [
                {...
                }
            ],
            "suggested_description_source": "unknown",
            "suggested_description_source_object": null
        }
    ]
}
```

{% endtab %}

{% tab title="403: Forbidden Missing permission to perform this action" %}

```json
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found The requested resource was not found on this server" %}

```json
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

## Get GUIDs for the tables with no usage

<mark style="color:blue;">`GET`</mark> `https://api.production.getselectstar.com/v1/tables/?no_popularity&search_name={tablename}&updated_on__gte=2022-07-06T0:00:00`

When you want to get the GUID for a list of tables with no usage, you can use the [`tables`](https://api.production.selectstar.com/docs/#tag/tables) API command with `no_popularity` parameter.

**no\_popularity** - If you want to search for tables with no usage, include this parameter. No popularity (popularity: null) means the table was not queried in the last 90 days or since the day Select Star started ingesting usage data.

**search\_name** - If you want to specify a search term i.e. table name, include this parameter.

If you want to filter objects by updated\_on, use these parameters -

**updated\_on\_\_gte** - `gte` stands for **greater than or equal.** You can also use `gt`, which is greater than.

**updated\_on\_\_lte** - `lte` stands for **less than or equal.** You can also use `lt`, which is less than.

#### Query Parameters

| Name               | Type    | Description                              |
| ------------------ | ------- | ---------------------------------------- |
| no\_popularity     | Boolean | No value needed                          |
| search\_name       | String  | Enter the table name                     |
| updated\_on\_\_gte | String  | Enter upper bound Date/Datetime (in UTC) |
| updated\_on\_\_lte | String  | Enter lower bound Date/Datetime (in UTC) |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "count":1,
   "schema_count":1,
   "model_count":0,
   "next":null,
   "previous":null,
   "results":[
      {
         "guid":"ta_oAUa3ddfXwMQQ5hEXc5uue", #GUID of the Table
         "database":{
            "guid":"db_HdpA4kRmvVRzk5dNgXJF4b",
            "data_source":{
               "guid":"ds_FR4y4JxHHhSpfHhkGMMDNN",
               "type":"postgres",
               "name":"Postgres",
               "last_ingested_on":"2022-12-06T09:49:29.372114Z",
               "last_fully_ingested_on":"2022-12-06T10:36:18.608792Z",
               "is_ingesting":false,
               "connection_status":"OK",
               "connection_error_message":"",
               "is_mode_discovery_db_added":null,
               "external_uuid":null,
               "iam_principal":null,
               "cloudformation_url":"",
               "is_credentials_setup_incomplete":false,
               "processed_through":{
                  "start_time":[
                     {
                        "key":"start_time",
                        "date":"2022-12-06T08:07:14+00:00"
                     }
                  ]
               }
            },
            "name":"olist",
            "description":"...",
            "richtext_description":"{...}",
            "schemata_count":3,
            "breadcrumbs":[
               {...
               }
            ],
            "search_name":"olist"
         },
         "schema":{...
               },
              ....
         },
         "name":"city_fields",
         "search_name":"olist.analytics.city_fields",
         "description":"Mention test Jakub Pyszka",
         "richtext_description":"{...}",
         "suggested_description":null,
         "created_by":null,
         "dsuser_created_by":{
            "guid":"du_LYsq6MoMjN2ux54yyaJVdR",
            "display_name":null,
            "name":"postgres",
            "data_source":{
               "guid":"ds_FR4y4JxHHhSpfHhkGMMDNN",
               "type":"postgres",
               "name":"Postgres",
               "last_ingested_on":"2022-12-06T09:49:29.372114Z"
            }
         },
         },
         "updates_on":null,
         "last_updated_on":null,
         "last_queried_on":"2022-07-07T01:16:53Z", #Table last queried on datetime
         "last_refreshed_on":null,
         "db_created_on":null,
         "columns":[
            { ...
            }
         ],
         "popularity":null, #Popularity of the Table
         "tags":[
            
         ],
         "tagged_items":[...
         ],
         "updated_on":"2022-06-07T13:46:59.740062Z", #Table updated on datetime
         "created_on":"2022-06-02T14:31:47.040289Z",
         "table_type":"table",
         "data_type":"table",
         "bytes":null,
         "row_count":0,
         "is_hidden":false,
         "downstream_objects_counts":{
            "chart":0,
            "column":0,
            "dashboard":0,
            "dashboardelement":0,
            "explore":0,
            "explorefield":0,
            "lookmlfield":0,
            "lookmlview":0,
            "metabasecolumn":0,
            "metabasetable":0,
            "powerbicolumn":0,
            "powerbitable":0,
            "reportquery":0,
            "table":0,
            "tableaucolumn":0,
            "tableaudatasource":0,
            "tableaufield":0,
            "tableautable":0,
            "tableauview":0,
            "source_table":0,
            "total":0
         },
         "upstream_objects_counts":{
            "chart":0,
            "column":0,
            "dashboard":0,
            "dashboardelement":0,
            "explore":0,
            "explorefield":0,
            "lookmlfield":0,
            "lookmlview":0,
            "metabasecolumn":0,
            "metabasetable":0,
            "powerbicolumn":0,
            "powerbitable":0,
            "reportquery":0,
            "table":0,
            "tableaucolumn":0,
            "tableaudatasource":0,
            "tableaufield":0,
            "tableautable":0,
            "tableauview":0,
            "source_table":0,
            "total":0
         },
         "extra":null,
         "breadcrumbs":[...
         ],
         "suggested_description_source":"unknown",
         "suggested_description_source_object":null
      }
}
```

{% endtab %}

{% tab title="403: Forbidden " %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

### Lineage

To learn more about data lineage, see [Data Lineage](https://docs.selectstar.com/features/lineage).

## Get lineage for a table

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/v1/lineage/{guid}/?max_depth=20&direction=right&mode=table`

When you want to run an impact analysis for all the downstream tables and dashboards, prior to a code change in your ETL job, you can use the [`lineage`](https://api.production.selectstar.com/docs/#tag/lineage) API command.

**max\_depth** - If you want to specify depth of lineage to load, use this parameter. Range includes 1 to 20 or you can specify the value as `max`. `max` is a special value that is used as alias for 20.

**direction** - If you want to specify which direction of lineage to load, use this parameter. If this field is skipped, source & downstream lineage will be calculated. In the example above, `direction=right` will display all the downstream lineage for the given table.

**mode** - If you want to limit lineage calculation to table or column only, use this parameter. This should reduce payload size as well as computation time but is not fully supported in all Lineage objects (e.g. Looker Lineage doesn't support it fully).

#### Path Parameters

| Name                                   | Type   | Description                    |
| -------------------------------------- | ------ | ------------------------------ |
| guid<mark style="color:red;">\*</mark> | String | GUID of a table or a dashboard |

#### Query Parameters

| Name       | Type   | Description                                        |
| ---------- | ------ | -------------------------------------------------- |
| max\_depth | String | Values: \[1 - 20 or max]. Default = 1              |
| direction  | String | Values: \['all', 'left', 'right']. Default = all   |
| mode       | String | Values: \['all', 'table', 'column']. Default = all |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "table_lineage": [
        {
            "key": "da_MdXgDCRr3QV2kNk4WpQhHW",
            "object_type": "dashboard",
            "guid": "da_MdXgDCRr3QV2kNk4WpQhHW",
            "name": "Olist Dashboards - Databricks",
            "component_identifier": 0,
            "full_name": "Databricks.Dashboards.Olist Dashboards - Databricks",
            "description": null,
            "rank": 57,
            "data_type": "workbook",
            "data_source_type": "tableau",
            "columns": [],
            "source_table_guids": [
                "ts_73ubh4o4oFMGL4JcaTe8d3",
                "ts_6iXqjDCk2moBZk4yGZxXti"
            ],
            "target_table_guids": [],
            "popularity": {
                "timeframe": 90,
                "user_count": 2,
                "service_query_count": 0,
                "popularity": 57,
                "ends_on": "2022-12-06"
            },
            "tag_guids": [],
            "query": null,
            "breadcrumbs": []
        },
        {
            "key": "ta_CsXD3ygBX3atGR5jw9CUVz",
            "object_type": "table",
            "guid": "ta_CsXD3ygBX3atGR5jw9CUVz",
            "name": "city_fields",
            "component_identifier": 0,
            "full_name": "olist.analytics.city_fields",
            "description": null,
            "rank": 49,
            "data_type": "view",
            "data_source_type": "databricks",
            "columns": [],
            "source_table_guids": [
                "ta_2tfiRYGkoZjaYhpBaBma5Y"
            ],
            "target_table_guids": [
                "tt_EST5sAz9bgPgmzFRiEjDfp"
            ],
            "popularity": {
                "timeframe": 90,
                "user_count": 3,
                "query_count": 7,
                "service_query_count": 0,
                "popularity": 49,
                "ends_on": "2022-12-06"
            },
            "tag_guids": [],
            "query": null,
            "breadcrumbs": []
        },
        {
            "key": "ta_2tfiRYGkoZjaYhpBaBma5Y",
            "object_type": "table",
            "guid": "ta_2tfiRYGkoZjaYhpBaBma5Y",
            "name": "customers",
            "component_identifier": 0,
            "full_name": "olist.datasets.customers",
            "description": null,
            "rank": 49,
            "data_type": "table",
            "data_source_type": "databricks",
            "columns": [],
            "source_table_guids": [],
            "target_table_guids": [
                "ta_CsXD3ygBX3atGR5jw9CUVz",
                "tt_ZSkEhMrRLs6Tjsyf3cN6tc",
                "ta_kX6m6pgpE5pJJKY6GPgu2V",
                "ta_32cuxLwnK8MumTdRTWRQNF"
            ],
            "popularity": {
                "timeframe": 90,
                "user_count": 2,
                "query_count": 17,
                "service_query_count": 0,
                "popularity": 49,
                "ends_on": "2022-12-06"
            },
            "tag_guids": [],
            "query": null,
            "breadcrumbs": []
        },
        {
            "key": "ts_73ubh4o4oFMGL4JcaTe8d3",
            "object_type": "tableaudatasource",
            "guid": "ts_73ubh4o4oFMGL4JcaTe8d3",
            "name": "olist.datasets.city_fields",
            "component_identifier": 0,
            "full_name": "olist.datasets.city_fields",
            "description": null,
            "rank": 32,
            "data_type": "embedded",
            "data_source_type": "tableau",
            "columns": [],
            "source_table_guids": [
                "tt_EST5sAz9bgPgmzFRiEjDfp"
            ],
            "target_table_guids": [
                "da_MdXgDCRr3QV2kNk4WpQhHW"
            ],
            "popularity": {
                "timeframe": 90,
                "user_count": 1,
                "service_query_count": 0,
                "popularity": 32,
                "ends_on": "2022-12-06"
            },
            "tag_guids": [],
            "query": null,
            "breadcrumbs": []
        },
    ],
    "column_lineage": []
}
```

{% endtab %}

{% tab title="403: Forbidden Missing permission to perform this action" %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found The requested resource was not found on this server" %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

### User Management

To learn more about managing users, see [User Management](https://docs.selectstar.com/user-management).

To learn more about teams, see [Teams](https://docs.selectstar.com/features/teams).

## Get user information by user email

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/scim/v2/Users ?username={username}`

#### Path Parameters

| Name                                       | Type   | Description        |
| ------------------------------------------ | ------ | ------------------ |
| username<mark style="color:red;">\*</mark> | String | user's login email |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
    "totalResults": 1,
    "startIndex": 1,
    "itemsPerPage": 1,
    "Resources": [
      {
        "schemas": [
          "urn:ietf:params:scim:schemas:core:2.0:User"
        ],
        "id": "123456789abcd",
        "userName": "user@domain.com",
        "name": {
          "givenName": "Userfirstname",
          "familyName": "Userlastname"
        },
        "emails": [
          {
            "value": "user@domain.com",
            "primary": true
          }
        ],
        "lastLogin": "2023-07-13T10:40:00Z",
        "role": "user",
        "meta": {
          "resourceType": "User",
          "created": "2023-06-26T10:40:00Z",
          "lastModified": "2023-06-26T13:40:00Z",
          "location":
           "<https://api.production.selectstar.com/api/v1/Users/123456789abcd>"
        }
      }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Requested resource not found" %}

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "detail": "Resource {guid} not found",
  "status": 404,
  "scimType": "invalidValue"
}
```

{% endtab %}

{% tab title="401: Unauthorized Authentication is invalid" %}

```json
{
    "detail": "Authentication credentials were not provided."
}
```

{% endtab %}

{% tab title="403: Forbidden User does not have sufficient permission " %}

```json
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}
{% endtabs %}

## Create a user using the user API

<mark style="color:green;">`POST`</mark> `https://api.production.selectstar.com/scim/v2/Users`

To create a user using the API, you must include userName, password, name and active. There are a number of optional parameters that can be set as well.

#### Query Parameters

| Name                                       | Type    | Description                                                                                                        |
| ------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------ |
| userName<mark style="color:red;">\*</mark> | String  | User's unique login identifier (email)                                                                             |
| password<mark style="color:red;">\*</mark> | String  | Human readable password given by the customer and after being hashed by our system is stored as the user password. |
| name<mark style="color:red;">\*</mark>     | Object  | contains a users's givenName and familyName                                                                        |
| role                                       | String  | The role of the user, can be user, data\_manager or admin                                                          |
| active<mark style="color:red;">\*</mark>   | Boolean | This should generally be set to true. If false, the user will not be able to login.                                |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "123456789abcd",
  "userName": "user@getselectstar.com",
  "name": {
    "givenName": "Userfirstname",
    "familyName": "Userlastname"
  },
  "emails": [
    {
      "value": "user@getselectstar.com",
      "primary": true
    }
  ],
  "lastLogin": null,
  "role": "user",
  "active": true,
  "meta": {
    "resourceType": "User",
    "created": "2023-06-26T10:40:00Z",
    "lastModified": null,
    "location":
     "<https://api.production.selectstar.com/api/v1/Users/123456789abcd>"
  }
}
```

{% endtab %}

{% tab title="401: Unauthorized Authentication is invalid" %}

```json
{
    "detail": "Authentication credentials were not provided."
}
```

{% endtab %}

{% tab title="403: Forbidden User does not have sufficient permission " %}

```json
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="400: Bad Request If a user with that email already exists" %}

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "detail": "userName": ["User with this email address already exists."],
  "status": 400
}
```

{% endtab %}
{% endtabs %}

### Tags

To learn more about Tags, see [Tag Management](https://docs.selectstar.com/data-management/tag-management).

To learn about PII tags, see [Sensitive PII Data](https://docs.selectstar.com/data-management/sensitive-pii-data).

The easiest way to get the guid for one specific tag is from the URL:

<div align="right"><figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-6a8a91c54829e0dd06ebe3fca5cb0472fb78dc5b%2F2022-12-08%2015.01.36.gif?alt=media" alt=""><figcaption><p>Get GUID for a tag in the UI</p></figcaption></figure></div>

## Get GUIDs for all dbt tags

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/v1/tags/?types=dbt&updated_on__gte=2022-12-02T0:00:00`

When you want to get GUIDs for all dbt tags, use [`tags_list`](https://api.production.selectstar.com/docs/#operation/tags_list) API command.

**types -** If you want to filter the list of tags based on the type of the tag, use this parameter.

All **dbt** tags are automatically ingested into Select Star, as part of the ingestion. To learn more, see [dbt tags](https://docs.selectstar.com/integrations/dbt/dbt-tags-new).

**updated\_on\_\_gte** - `gte` stands for **greater than or equal.** You can also use `gt`, which is greater than.

#### Query Parameters

| Name               | Type   | Description                              |
| ------------------ | ------ | ---------------------------------------- |
| types              | String | Values: \['category', 'dbt', 'status']   |
| updated\_on\_\_gte | String | Enter upper bound Date/Datetime (in UTC) |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "guid": "tg_LU3SJigKVTXfksNTayya72", #GUID of tag
            "type": "dbt",
            "data_source_guid": "ds_GeypMekj2qMizMRT4gMqBs",
            "name": "contains_pii",
            "description": null,
            "richtext_description": null,
            "icon": "dbt",
            "color": "",
            "ordinal": 0,
            "updated_on": "2022-12-02T17:26:17.052023Z",
            "owner": null,
            "items": [
                {
                    "suggested_description": null,
                    "object_type": "taggeditems",
                    "guid": "ti_5VXZWTbo2m63jREvnbfV4x",
                    "name": "ALIASED_ID",
                    "description": null,
                    "richtext_description": "",
                    "search_name": "selectstar_dbt.datasets.spiked.ALIASED_ID",
                    "data_type": "",
                    "data_source_type": null,
                    "parent_guid": null
                }
            ],
            "count": 1,
            "breadcrumbs": [
                {
                    "guid": "br_X8VLKfVsFudx8eVK8bfpUx",
                    "target_guid": "dbt_tags_container",
                    "target_name": "dbt Tags",
                    "target_object_type": "dbt_tags_container",
                    "target_data_type": "dbt",
                    "target_data_source_guid": "ds_GeypMekj2qMizMRT4gMqBs",
                    "target_data_source_type": "dbt",
                    "ordinal": 0
                }
            ],
            "visible": true,
            "links_to": "tg_bAkddSBoaYpnvUBQym5Fxv"
        }
    ]
}
```

{% endtab %}

{% tab title="403: Forbidden " %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}

## Get a list of all assets tagged as PII

<mark style="color:blue;">`GET`</mark> `https://api.production.selectstar.com/v1/tags/items/{guid}/?kind=user/`

When you want to get the list of all the items tagged as PII, you can use the [`tags_items_list`](https://api.production.selectstar.com/docs/#operation/tags_items_list) API command.

**kind** - If you want to see tagged items either defined by `user` or `suggested`, use this parameter. Items that are tagged by Select Stars users, are considered `user`(Response displays as `user-defined`) tagged items, while items that are automatically tagged by Select Star, are considered `suggested` tagged items.

To learn more about suggested tags, see [Automatic Documentation](https://docs.selectstar.com/features/auto-documentation#suggested-tags).

#### Path Parameters

| Name                                   | Type   | Description     |
| -------------------------------------- | ------ | --------------- |
| guid<mark style="color:red;">\*</mark> | String | GUID of the Tag |

#### Query Parameters

| Name | Type   | Description                       |
| ---- | ------ | --------------------------------- |
| kind | String | Values: \['user' or 'suggestion'] |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
   "count":1,
   "next":null,
   "previous":null,
   "results":[
      {
         "tag":{
            "guid":"tg_mkncj9iar9NWKbYeL64TvR", #GUID of the tag
            "type":"dbt",
            "name":"pii",
            "icon":"dbt",
            "color":"",
            "visible":true,
            "links_to":null,
            "breadcrumbs":[...]
         },
         "kind":"user-defined", 
         "suggested_source_kind":"unknown",
         "suggestion_source":null,
         "item":{
            "object_type":"column",
            "obj":{
               "suggested_description":null,
               "object_type":"column",
               "guid":"co_HVMK94dHVZT7RFj2S6jvUY", #GUID of the tagged Column
               "name":"ALIASED_ID",
               "breadcrumbs":[...]
               "description":"The primary key for this table",
               "richtext_description":null,
               "search_name":"selectstar_dbt.datasets.spiked.ALIASED_ID",
               "data_type":"string",
               "data_source_type":"dbt",
               "parent_guid":"ta_h3YvNkhiUYvbox6ALyU3Eo", #GUID of the table for the column
               "popularity":null,
               "raw_popularity":null,
               "downstream_objects_counts":{...}
               "upstream_objects_counts":{...}
               "tags":{...}
                "tagged_items":[...]
            }
         }
      }
   ]
}
```

{% endtab %}

{% tab title="403: Forbidden Missing permission to perform this action" %}

```javascript
{
    "detail": "You do not have permission to perform this action."
}
```

{% endtab %}

{% tab title="404: Not Found The requested resource was not found on this server" %}

```javascript
<!doctype html>
<html lang="en">

<head>
	<title>Not Found</title>
</head>

<body>
	<h1>Not Found</h1>
	<p>The requested resource was not found on this server.</p>
</body>

</html>
```

{% endtab %}
{% endtabs %}
