API Clients & API Keys
Column-level detail for api_client, api_key
Overview
This domain has 2 tables in the public schema (managed by Prisma), covering external system
access to the platform API. api_client is the identity of the calling system (holding a client
id and secret); api_key is a key issued to that client, scoped to a specific LINE OA and
organization.
Table api_client
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | SERIAL | NO | auto increment | Primary key |
name | TEXT | NO | - | Name of the calling system or application |
description | TEXT | YES | - | Additional description of the client |
client_id | TEXT | NO | - | Client identifier used for authentication |
client_secret | TEXT | NO | - | Secret paired with client_id |
status | "CommonStatus" | NO | 'active' | Record status (shared system enum) |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
created_by | INTEGER | NO | 0 | Creator user id |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp (Prisma @updatedAt) |
updated_by | INTEGER | YES | 0 | Last updater user id |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp |
Table api_key
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | SERIAL | NO | auto increment | Primary key |
title | TEXT | NO | - | Human-readable label so admins can tell keys apart |
key | TEXT | NO | - | The key value presented on API calls |
api_client_id | INTEGER | NO | - | Client the key was issued to (references api_client.id) |
line_oa_id | INTEGER | NO | - | LINE OA this key may access |
organization_id | INTEGER | NO | - | Organization owning the key |
status | "CommonStatus" | NO | 'active' | Record status (shared system enum) |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
created_by | INTEGER | NO | 0 | Creator user id |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp (Prisma @updatedAt) |
updated_by | INTEGER | YES | 0 | Last updater user id |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp |
Notes
- Indexes:
api_clienton (client_id,client_secret,status) — matching the client authentication query;api_keyon (organization_id,line_oa_id,status) - Neither table declares database-level foreign keys —
api_key.api_client_idreferencesapi_client.idlogically, andline_oa_id/organization_idreferenceline_oa/organization statususes the shared PostgreSQL enum"CommonStatus", whose values areactive,inactive,processing,delete,completed,expired,draft,failed. Revoking a key means settingstatusto anything other thanactive- Both tables soft-delete via
deleted_daterather than removing rows, so API call history stays traceable back to the key that made it