Customer Attribute Definitions (Attribute Master)
Overview
Attribute Master is where custom LINE user attributes are defined, per LINE OA — things like membership tier, date of birth, or preferred branch. It acts as the schema that tells the system what each attribute is called, what type of data it holds, whether it can be used to filter audiences, and whether it can appear in reports.
Attributes defined here surface throughout the platform: as target fields for Import Mapping, as merge tags in Template Message, as conditions in Audience Filter, and as columns in the all-friends report.
The standout feature is JSON schema import — paste in a sample JSON document and the system parses it into a set of attributes at once, rather than defining each one by hand.
Business Flow
- List —
GET /api/attribute-masterreturns all attributes, paginated and filterable viaAttributeMasterQueryParamDto. - Filterable subset —
GET /api/attribute-master/filterablereturns only the attributes usable as audience filter conditions; the Audience Filter UI relies on this. - Reportable subset —
GET /api/attribute-master/reportablereturns only the attributes that can appear as report columns; the report UI relies on this. - Create —
POST /api/attribute-mastercreates a new attribute, always checking the plan'smaxAttributesquota first. - Parse JSON into attributes —
POST /api/attribute-master/parse-jsonaccepts a body containing ajsonfield and an optionalrootPath, and returns a preview of the attributes that would be produced without persisting anything. - Confirm import —
POST /api/attribute-master/import-jsoncreates the whole set of attributes from the previewed schema in one operation. - View and edit —
GET /api/attribute-master/:idandPUT /api/attribute-master/:id. - Check before deleting — always call
GET /api/attribute-master/:id/check-attribute-usage?attributeKey=...first. It reports everywhere the attribute is currently used — audiences, reports, forms and import mappings — so that deleting it does not silently break other features. - Delete —
DELETE /api/attribute-master/:id.
Key Files & Functions
The code lives in internal/modules/attributemaster/, comprising controller.go,
service.go, parser.go, ordered.go, time.go, dto.go and module.go.
parser.goconverts a JSON schema into a set of attributesordered.gopreserves key order so the JSON output matches the legacy system
All routes are registered on authed.Group("/attribute-master") and wrapped in
modulegate.ModuleGate(d, "attribute-master").
| Method | Route | Handler | Policy |
|---|---|---|---|
| GET | /api/attribute-master | svc.getListHandler | readAll attribute-master |
| GET | /api/attribute-master/filterable | svc.getFilterableHandler | read attribute-master |
| GET | /api/attribute-master/reportable | svc.getReportableHandler | read attribute-master |
| GET | /api/attribute-master/:id/check-attribute-usage | svc.checkAttributeUsageHandler | read attribute-master |
| GET | /api/attribute-master/:id | svc.getByIDHandler | read attribute-master |
| POST | /api/attribute-master | svc.createHandler | create attribute-master |
| POST | /api/attribute-master/import-json | svc.importJsonHandler | create attribute-master |
| POST | /api/attribute-master/parse-json | svc.parseJsonHandler | read attribute-master |
| PUT | /api/attribute-master/:id | svc.updateHandler | update attribute-master |
| DELETE | /api/attribute-master/:id | svc.deleteHandler | delete attribute-master |
Connections to Other Services
- Permissions — requires
ModuleGate("attribute-master")and carriesPolicyModuleAttributeMasteras metadata. - Tables —
attribute_master,line_user(its custom attribute payload),audience,form_builder,import_mapping_jobandtemplate_message. - Cross-module — calls Plan Limits to enforce the
maxAttributesquota. - Error handling —
throwInstanceofErrorpasses 401, 404, 400 and 409 responses through unchanged; anything else becomes a 500 with theAPP_000code. - Related modules — System Attribute (system-level attributes), LINE User Management, Audience Filter, Template Message, All Friend Listing and Import Mapping.