Skip to main content

LINE Official Account (Channel)

Overview

This domain has two tables: line_oa stores the connection details of each LINE Official Account channel (credentials, webhook, follower-sync settings, GA tracking, message-handling priority), and line_oa_app stores the on/off state and configuration of add-on apps per organization.

Table line_oa

ColumnTypeNullableDefaultDescription
idINTEGERNOT NULLnextval (serial)Primary key of the LINE OA channel
organization_idINTEGERNOT NULLOrganization owning the channel (FK to organization.id)
line_oa_nameTEXTNOT NULLDisplay name of the LINE OA inside the CMS
line_oa_hashTEXTNULLHash used to reference the OA publicly (appears in public URLs)
channel_access_tokenTEXTNOT NULLChannel access token for calling the LINE Messaging API
channel_idTEXTNOT NULLChannel ID from LINE Developers
channel_secret_idTEXTNOT NULLChannel secret, used to verify webhook signatures
channel_nameTEXTNOT NULLChannel name as configured in LINE Developers
bot_basic_idTEXTNOT NULLBot basic ID (format @xxxxxxx)
premium_idTEXTNULLPremium ID of the OA, if one was purchased
sync_follower_statusSyncFollowerStatus (enum)NOT NULLno_actionFollower-sync state: no_action, active, processing, completed, failed
sync_follower_logsTEXTNULLLog/result message from the most recent follower sync
last_sync_followers_dateTIMESTAMPTZ(3)NULLTimestamp of the last successful follower sync
webhook_idTEXTNOT NULLSystem-generated webhook identifier, used as the webhook URL path
forward_webhook_urlTEXTNULL''Destination URL for forwarding events to an external system (empty = no forwarding)
coverTEXTNOT NULL''URL/path of the OA cover image
line_login_infoJSONBNULLLINE Login channel details linked to this OA
audience_refresh_enabledBOOLEANNOT NULLfalseWhether automatic audience-membership refresh is enabled
audience_refresh_intervalINTEGERNOT NULL60Audience refresh interval in minutes
ga_tracking_enabledBOOLEANNOT NULLfalseWhether tracking parameters are appended for Google Analytics
ga_identity_paramVARCHAR(50)NOT NULL'lid'Query-parameter name used to pass identity to GA
message_handling_configJSONBNOT NULL{"priority": "auto_response_only"}Priority configuration for handling inbound messages
statusCommonStatus (enum)NOT NULLChannel status (active, inactive, delete, etc.)
created_dateTIMESTAMPTZ(3)NOT NULLCURRENT_TIMESTAMPCreation timestamp
created_byINTEGERNOT NULL0User id of the creator
updated_dateTIMESTAMPTZ(3)NULLLast update timestamp (Prisma @updatedAt)
updated_byINTEGERNULL0User id of the last editor
deleted_dateTIMESTAMPTZ(3)NULLSoft-delete timestamp

Table line_oa_app

ColumnTypeNullableDefaultDescription
idINTEGERNOT NULLnextval (serial)Primary key
organization_idINTEGERNOT NULLOrganization that enabled this app
app_idVARCHAR(50)NOT NULLAdd-on app identifier (string key)
enabledBOOLEANNOT NULLfalseWhether the app is enabled
configJSONBNULLApp-specific configuration
created_byINTEGERNULLUser id of the creator
created_dateTIMESTAMPTZ(3)NOT NULLCURRENT_TIMESTAMPCreation timestamp
updated_dateTIMESTAMPTZ(3)NULLLast update timestamp

Notes

  • Foreign key: line_oa.organization_id -> organization.id. line_oa is in turn referenced via line_oa_id by many tables, including line_user, campaign, rich_message, rich_menu, tracking_log, template_message, tracking_token, form_builder, menu_builder, attribute_master, content_page, content_category, content_link and friend_track_campaign.
  • Indexes on line_oa: (webhook_id, status, organization_id), (line_oa_hash, status, organization_id) and deleted_date. The first two support channel lookup on inbound webhooks and on public URL resolution.
  • line_oa_app is scoped to the organization, not to a channel — it has no line_oa_id column despite the table name prefix. It carries a unique constraint on (organization_id, app_id) and an index on organization_id.
  • message_handling_config is a JSON object with a priority key; the default value is auto_response_only.
  • channel_access_token and channel_secret_id are secrets — they must not be logged or exposed through public APIs.
  • There is no separate mbox table in this domain. The previous placeholder for this page mentioned mbox, but the real schema contains only line_oa and line_oa_app.