Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Agents Start Here
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Glossary
  • Content generative library
  • Community

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. Reference Tables

Reference Tables

markdownView as Markdown

Create, sync, and look up rows in reference tables built from a connection and SQL query.

List reference tables

GEThttps://api.lytics.io/v2/reftable

Lists the account's reference tables with their health and live row count.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
{
  "_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

POSThttps://api.lytics.io/v2/reftable

Creates 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.

Sample Request
12345678910111213141516171819202122
{
  "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
}
Sample Response
Status|201 Created
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
{
  "_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

GEThttps://api.lytics.io/v2/reftable/{id}

undefined

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
{
  "_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

PUThttps://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.

Sample Request
12345678910111213141516171819202122
{
  "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
}
Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
{
  "_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

DELETEhttps://api.lytics.io/v2/reftable/{id}

Deletes a reference table, its rows and its sync work.

Sample Response
Status|200 OK
123456
{
  "_meta": {},
  "data": {},
  "request_id": "string",
  "status": 0
}

Look up a reference table row

GEThttps://api.lytics.io/v2/reftable/{id}/row/{key}

Returns the live row for one lookup key.

Sample Response
Status|200 OK
123456789
{
  "_meta": {},
  "data": {
    "data": {},
    "key": "string"
  },
  "request_id": "string",
  "status": 0
}

Browse reference table rows

GEThttps://api.lytics.io/v2/reftable/{id}/rows

Pages through the live rows in key order.

Sample Response
Status|200 OK
12345678910111213141516
{
  "_meta": {},
  "data": {
    "limit": 0,
    "offset": 0,
    "rows": [
      {
        "data": {},
        "key": "string"
      }
    ],
    "total": 0
  },
  "request_id": "string",
  "status": 0
}

Sync reference table now

POSThttps://api.lytics.io/v2/reftable/{id}/sync

Runs one sync immediately, creating the sync work if the table has none.

Sample Response
Status|202
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
{
  "_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

GEThttps://api.lytics.io/v2/reftable/{id}/usedby

Lists the templates that declare the table in reference_tables.

Sample Response
Status|200 OK
12345678910111213141516171819202122232425
{
  "_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
}
Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

columnsoptionalobject[]
columns[].nameoptionalstring
columns[].typeoptionalstring

One of: string, int, number, bool, date, json

connection_idoptionalstring
descriptionoptionalstring
lookup_keyoptionalstring
nameoptionalstring
scheduleoptionalobject
schedule.day_of_weekoptionalstring
schedule.run_frequencyoptionalstring

One of: Hourly, Daily, Weekly

schedule.time_of_dayoptionalstring
schedule.timezoneoptionalstring
slugoptionalstring

defaults from name on create; immutable after

sqloptionalstring
sql_dialectoptionalstring
sync_enabledoptionalboolean
Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

columnsoptionalobject[]
columns[].nameoptionalstring
columns[].typeoptionalstring

One of: string, int, number, bool, date, json

connection_idoptionalstring
descriptionoptionalstring
lookup_keyoptionalstring
nameoptionalstring
scheduleoptionalobject
schedule.day_of_weekoptionalstring
schedule.run_frequencyoptionalstring

One of: Hourly, Daily, Weekly

schedule.time_of_dayoptionalstring
schedule.timezoneoptionalstring
slugoptionalstring

defaults from name on create; immutable after

sqloptionalstring
sql_dialectoptionalstring
sync_enabledoptionalboolean
Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

keyrequiredstring

Lookup key value

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

limitoptionalstring

Rows per page, at most 500

offsetoptionalstring

Rows to skip

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

Reference table ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring