Skip to main content

Audience

Overview

This domain has two tables. audience holds audience definitions built either from an uploaded CSV or from filter conditions, together with their auto-refresh settings. audience_member_log records every add/remove of a member so you can audit who entered or left a group, when, and why.

Table audience

ColumnTypeNullableDefaultDescription
idSERIAL (INTEGER)NOnextval(...)Primary key of the audience
titleTEXTNO-Audience name
descriptionTEXTYES''Audience description
data_source"AudiencesDataSource"NO-Source of the member list: csv (file upload) or filter (built from conditions)
detailsTEXTNO-Audience details, e.g. the source file name or a summary of the conditions
infoJSONBYES-Extra audience metadata such as statistics or processing information
slugTEXTYES-Human-readable slug for referencing the audience
filter_infoJSONBYES-Filter conditions used to select members (used when data_source = filter)
organization_idINTEGERNO-Owning organization
line_oa_idINTEGERNO-Owning LINE OA
api_client_idINTEGERYES-API client that created the audience (when created via API)
api_key_idINTEGERYES-API key used to create the audience
auto_refresh_enabledBOOLEANNOfalseWhether members are refreshed automatically
last_refresh_dateTIMESTAMPTZ(3)YES-Timestamp of the last member refresh
refresh_statusVARCHAR(20)NO'idle'Current refresh state, e.g. idle, processing
status"CommonStatus"NO-Audience status (active, inactive, processing, ...)
created_byINTEGERNO-User who created the record
updated_byINTEGERYES-User who last updated the record
created_dateTIMESTAMPTZ(3)NOnow()Creation timestamp
updated_dateTIMESTAMPTZ(3)YES-Last update timestamp (maintained automatically)
deleted_dateTIMESTAMPTZ(3)YES-Soft-delete timestamp (NULL means not deleted)

Table audience_member_log

ColumnTypeNullableDefaultDescription
idSERIAL (INTEGER)NOnextval(...)Primary key of the log entry
audience_idINTEGERNO-Audience the event belongs to (FK to audience.id)
line_user_idVARCHAR(255)NO-LINE user ID of the member added or removed
action"AudienceMemberAction"NO-Event type: add (joined) or remove (left)
trigger_type"AudienceMemberTriggerType"NO-What caused the change: auto_refresh, manual or api
created_dateTIMESTAMPTZ(3)NOnow()When the event occurred
organization_idINTEGERNO-Owning organization
line_oa_idINTEGERNO-Related LINE OA

Notes

  • audience_member_log.audience_id is an FK to audience.id.
  • audience is referenced by campaign.audience_id, rich_menu.audience_id and rich_menu_archive.audience_id to determine message recipients or rich menu visibility.
  • Indexes on audience: line_oa_id, deleted_date.
  • Indexes on audience_member_log: audience_id, created_date (descending), action, line_oa_id — tuned for querying a group's most recent history quickly.
  • audience_member_log has no soft-delete column because it is an append-only log.