Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
CRM Submodule
contact-types
Catalog of person contact type codes (e.g. phone, email, WhatsApp) with localized names, used to classify contact entries on person records.
Source path: libraries/crm/src/contact-type
Module file: contact-type.module.ts
Introduction
The Contact Types submodule manages the small reference catalog that every person's contact entries point to via contact_type_id. Each entry pairs a stable code (e.g. "mobile", "email") with a locale-translated display name, so the admin panel can render a friendly label in the user's language while application logic and CSV import mapping match against the stable code rather than the translation. This separation means a contact type's display name can be retranslated or relabeled at any time without breaking references on existing person contact records.
Unlike Relation Types, contact types are a fully mutable catalog — administrators can create, update and delete entries through this submodule's standard CRUD endpoints, making it straightforward to add a new channel (e.g. "Telegram" or "Signal") as the organization's communication needs evolve.
HTTP Endpoints
5 endpoints
Paginated list of person contact types.
- Query
- page, pageSize, search
Get a single contact type by ID.
- Params
- id (int)
Create a new contact type.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| code | string | yes | — |
| locale | Record<string, { name: string }> | yes | e.g. { "en": { "name": "..." } } |
Update a contact type (same fields as create, all optional).
- Params
- id (int)
Delete one or more contact types.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| ids | number[] | yes | IDs to delete |
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
crm.contact-types.listLists person contact types (e.g. mobile, email, WhatsApp) with pagination
crm.contact-types.getReturns a single contact type by ID
crm.contact-types.createCreates a new contact type with multi-locale name
crm.contact-types.updateUpdates an existing contact type by ID
crm.contact-types.deleteDeletes one or more contact types by their IDs