Skip to main content

API Clients & API Keys

Overview

This domain opens a channel for a customer's external systems to call the LINE Management API without signing in as a user. It is structured in two layers.

  • api_client — the calling application at the platform level, holding a client id and client secret
  • api_key — a key that binds that application to one specific LINE OA and organization

Anything done through this channel is tagged, for example audience.api_client_id and audience.api_key_id, along with audience_member_log.trigger_type set to api. That makes it possible to trace after the fact which records came from an external system.

Core Data Structure

api_client

  • name, description, client_id, client_secret
  • status of type CommonStatus (defaults to active), with soft deletes via deleted_date
  • The (client_id, client_secret, status) index is shaped for the authentication lookup itself

api_key

  • title and key
  • Scope columns: api_client_id, line_oa_id and organization_id. All three are plain columns; they are not declared as foreign keys in Prisma.
  • The (organization_id, line_oa_id, status) index backs the lookup of active keys per channel
  • prisma/schema.prisma:819 — the ApiClient model
  • prisma/schema.prisma:837 — the ApiKey model
  • prisma/schema.prisma:438 — the audience.api_client_id and audience.api_key_id columns
  • seed-data/13.api_client.sql, seed-data/14.api_key.sql — a mock pair seeded for testing
  • schema-dumps/2026-07-24/schema.sql:864, :903

Connections to Other Services

  • cms-api-go exposes the api-key module for issuing and revoking keys per customer.
  • client-api-go and cms-api-go both run middleware that validates the API key before allowing a call to a public endpoint. A common real-world case is an external CRM pushing records in to add members to an audience.
  • Connects to Audience and LINE OA Channels.