fritzbox-calls.contacts.list
List all call contacts for this tenant, ordered by display name. Contacts enrich the call log (display name + category shown on each call row). Returns { contacts: Contact[] }. DRY: delegates to the shared listContacts() query (same as the tRPC router).
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
contacts | array of object | yes | |
contacts.id | string | yes | |
contacts.phoneNumber | string | yes | |
contacts.displayName | string | yes | |
contacts.category | string | yes | |
contacts.updatedAt | string | yes |
fritzbox-calls.contacts.upsert
Create or update a call contact for this tenant. Conflict key: (tenantId, phoneNumber) — unique per tenant, so calling with an existing phone number updates the display name and category. Returns the upserted contact.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
phoneNumber | string | yes | |
displayName | string | yes | |
category | string | no | Default: "sonstig" |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
contact | object | yes | |
contact.id | string | yes | |
contact.phoneNumber | string | yes | |
contact.displayName | string | yes | |
contact.category | string | yes | |
contact.updatedAt | string | yes |
fritzbox-calls.list
List paginated FritzBox calls for this tenant. Supports filter (all/incoming/outgoing/missed), period (all/today/week/month), free-text search across phone number, guest name, FritzBox device name, and contact display name. Newest-first. DRY: delegates to the shared listCalls() query (same as the tRPC router).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
page | integer | no | Default: 1 |
limit | integer | no | Default: 25 |
filter | enum | no | One of: all, incoming, outgoing, missed — Default: "all" |
period | enum | no | One of: all, today, week, month — Default: "all" |
search | string | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
items | array of object | yes | |
items.id | string | yes | |
items.callType | number | yes | |
items.date | string | yes | |
items.phoneNumber | string | yes | |
items.phoneExtension | string · nullable | yes | |
items.ownNumber | string · nullable | yes | |
items.durationDisplay | string | yes | |
items.durationSeconds | number | yes | |
items.fritzboxName | string · nullable | yes | |
items.guestId | string · nullable | yes | |
items.guestName | string · nullable | yes | |
items.callbackStatus | string · nullable | yes | |
items.callbackUpdatedAt | string · nullable | yes | |
items.notes | string · nullable | yes | |
items.notesUpdatedAt | string · nullable | yes | |
items.contactName | string · nullable | yes | |
items.contactCategory | string · nullable | yes | |
pagination | object | yes | |
pagination.page | number | yes | |
pagination.limit | number | yes | |
pagination.total | number | yes | |
pagination.totalPages | number | yes |
fritzbox-calls.refresh
Trigger a FritzBox call import for this tenant. Fetches the current call list from the FritzBox device and upserts any new calls into the database. Returns { imported, duplicates }.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
imported | number | yes | |
duplicates | number | yes |
fritzbox-calls.set-callback
Set or clear the callback status on a FritzBox call. 4 states: null=Offen (open), 'in_progress'=In Bearbeitung (in progress), 'called_back'=Zurückgerufen (returned), 'no_answer'=Kein Anschluss (no answer). Pass null to reset to open. Returns the updated row. 404 error if call not found (RLS-isolated).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
status | enum · nullable | yes | One of: in_progress, called_back, no_answer |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
callbackStatus | string · nullable | yes | |
callbackUpdatedAt | string · nullable | yes |
fritzbox-calls.set-note
Set or clear the note on a FritzBox call. Empty / whitespace-only input clears the note (stored as null). Text is sanitized (NUL bytes removed) and truncated to 2000 characters. Returns the updated row. 404 error if call not found (RLS-isolated).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
notes | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
notes | string · nullable | yes | |
notesUpdatedAt | string · nullable | yes |
fritzbox-calls.stats
Aggregated call statistics for this tenant: today's total and missed calls, average call duration (seconds), and total call count across all time. DRY: delegates to the shared callStats() query (same as the tRPC router).
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
todayTotal | number | yes | |
todayMissed | number | yes | |
avgDuration | number | yes | |
total | number | yes |
fritzbox-calls.status
Check the FritzBox connection status for this tenant. Returns { online: boolean; reason?: string }. reason is present when online=false (e.g. 'FRITZBOX_URL not configured').
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
online | boolean | yes | |
reason | string | no |