Reference Tables
List reference tables
https://api.lytics.io/v2/reftableLists the account's reference tables with their health and live row count.
{
"_meta": {},
"data": [
{
"author_id": "string",
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"created": "string",
"description": "string",
"generation": 0,
"health": "pending",
"id": "string",
"last_sync": {
"at": "string",
"bytes": 0,
"error": "string",
"generation": 0,
"rows": 0,
"scanned": 0,
"skipped_duplicate_key": 0,
"skipped_missing_key": 0
},
"lookup_key": "string",
"name": "string",
"row_count": 0,
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true,
"updated": "string",
"used_by": 0,
"work_id": "string"
}
],
"request_id": "string",
"status": 0
}Create reference table
https://api.lytics.io/v2/reftableCreates a reference table from a connection and SQL query. The slug defaults from the name and is immutable; when sync_enabled is true the sync work is scheduled right away.
{
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"description": "string",
"lookup_key": "string",
"name": "string",
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true
}{
"_meta": {},
"data": {
"author_id": "string",
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"created": "string",
"description": "string",
"generation": 0,
"health": "pending",
"id": "string",
"last_sync": {
"at": "string",
"bytes": 0,
"error": "string",
"generation": 0,
"rows": 0,
"scanned": 0,
"skipped_duplicate_key": 0,
"skipped_missing_key": 0
},
"lookup_key": "string",
"name": "string",
"row_count": 0,
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true,
"updated": "string",
"used_by": 0,
"work_id": "string"
},
"request_id": "string",
"status": 0
}Get reference table
https://api.lytics.io/v2/reftable/{id}undefined
{
"_meta": {},
"data": {
"author_id": "string",
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"created": "string",
"description": "string",
"generation": 0,
"health": "pending",
"id": "string",
"last_sync": {
"at": "string",
"bytes": 0,
"error": "string",
"generation": 0,
"rows": 0,
"scanned": 0,
"skipped_duplicate_key": 0,
"skipped_missing_key": 0
},
"lookup_key": "string",
"name": "string",
"row_count": 0,
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true,
"updated": "string",
"used_by": 0,
"work_id": "string"
},
"request_id": "string",
"status": 0
}Update reference table
https://api.lytics.io/v2/reftable/{id}Updates a reference table. A field left out keeps its stored value. The slug is immutable; a changed query, key or column set takes effect on the next sync.
{
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"description": "string",
"lookup_key": "string",
"name": "string",
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true
}{
"_meta": {},
"data": {
"author_id": "string",
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"created": "string",
"description": "string",
"generation": 0,
"health": "pending",
"id": "string",
"last_sync": {
"at": "string",
"bytes": 0,
"error": "string",
"generation": 0,
"rows": 0,
"scanned": 0,
"skipped_duplicate_key": 0,
"skipped_missing_key": 0
},
"lookup_key": "string",
"name": "string",
"row_count": 0,
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true,
"updated": "string",
"used_by": 0,
"work_id": "string"
},
"request_id": "string",
"status": 0
}Delete reference table
https://api.lytics.io/v2/reftable/{id}Deletes a reference table, its rows and its sync work.
{
"_meta": {},
"data": {},
"request_id": "string",
"status": 0
}Look up a reference table row
https://api.lytics.io/v2/reftable/{id}/row/{key}Returns the live row for one lookup key.
{
"_meta": {},
"data": {
"data": {},
"key": "string"
},
"request_id": "string",
"status": 0
}Browse reference table rows
https://api.lytics.io/v2/reftable/{id}/rowsPages through the live rows in key order.
{
"_meta": {},
"data": {
"limit": 0,
"offset": 0,
"rows": [
{
"data": {},
"key": "string"
}
],
"total": 0
},
"request_id": "string",
"status": 0
}Sync reference table now
https://api.lytics.io/v2/reftable/{id}/syncRuns one sync immediately, creating the sync work if the table has none.
{
"_meta": {},
"data": {
"author_id": "string",
"columns": [
{
"name": "string",
"type": "string"
}
],
"connection_id": "string",
"created": "string",
"description": "string",
"generation": 0,
"health": "pending",
"id": "string",
"last_sync": {
"at": "string",
"bytes": 0,
"error": "string",
"generation": 0,
"rows": 0,
"scanned": 0,
"skipped_duplicate_key": 0,
"skipped_missing_key": 0
},
"lookup_key": "string",
"name": "string",
"row_count": 0,
"schedule": {
"day_of_week": "string",
"run_frequency": "Hourly",
"time_of_day": "string",
"timezone": "string"
},
"slug": "string",
"sql": "string",
"sql_dialect": "string",
"sync_enabled": true,
"updated": "string",
"used_by": 0,
"work_id": "string"
},
"request_id": "string",
"status": 0
}Templates using a reference table
https://api.lytics.io/v2/reftable/{id}/usedbyLists the templates that declare the table in reference_tables.
{
"_meta": {},
"data": [
{
"author_id": "string",
"created": "string",
"description": "string",
"desired_format": "string",
"field_filter": [
"string"
],
"id": "string",
"lytics_managed": true,
"name": "string",
"reference_tables": [
"string"
],
"target": "string",
"type": "string",
"updated": "string"
}
],
"request_id": "string",
"status": 0
}