PhoneNumberManagerRpc
The PhoneNumberManagerRpc endpoint group exposes RPC methods for listing, creating, updating, and deleting phone numbers, plus a helper for resolving form reference values. The public contract shown here is limited to the methods declared in src/server/rpc/PhoneNumberManagerRpc.js; any deeper behavior comes from the telephony service it delegates to and is not documented here unless explicitly visible in the source.
Endpoints
POST /api/rpc (Method: PhoneNumberManagerRpc.getData)
This method lists phone numbers. It accepts optional filtering, sorting, and pagination parameters and forwards them to the telephony service.
Description: Lists phone numbers through TelephonyManager.
Request Body:
{ "method": "PhoneNumberManagerRpc.getData", "params": { "filter": {}, "sort": {}, "page": 1, "pageSize": 25 } }Parameters:
Name Type Required Description filterObjectNo Optional filter object. The schema allows any object shape and passes additional keys through. sortObjectNo Optional sort object. The schema allows any object shape and passes additional keys through. pageNumberNo Page number. Defaults to 1when omitted.pageSizeNumberNo Number of items per page. Defaults to 25when omitted.Response:
{ "success": true, "data": "Telephony service list response" }The exact response shape is determined by
TelephonyConnectorService.listPhoneNumbers(...), which is not inspected here.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.getData", "params": { "page": 1, "pageSize": 25 } }'
POST /api/rpc (Method: PhoneNumberManagerRpc.create)
This method creates a phone number record by forwarding the request payload to the telephony service.
Description: Creates a phone number through TelephonyManager.
Request Body:
{ "method": "PhoneNumberManagerRpc.create", "params": { "phoneNumber": "+15551234567", "provider": "example-provider" } }Parameters:
Name Type Required Description phoneNumberStringYes Phone number value to create. providerStringYes Provider identifier to associate with the phone number. The schema also uses
.passthrough(), so additional properties are accepted and forwarded.Response:
{ "success": true, "data": "Telephony service create response" }The exact response shape is determined by
TelephonyConnectorService.createPhoneNumber(...), which is not inspected here.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.create", "params": { "phoneNumber": "+15551234567", "provider": "example-provider" } }'
POST /api/rpc (Method: PhoneNumberManagerRpc.update)
This method updates an existing phone number by forwarding the request payload to the telephony service.
Description: Updates a phone number through TelephonyManager.
Request Body:
{ "method": "PhoneNumberManagerRpc.update", "params": { "_id": "phone-number-id" } }Parameters:
Name Type Required Description _idStringYes Identifier of the phone number record to update. The schema also uses
.passthrough(), so additional properties are accepted and forwarded.Response:
{ "success": true, "data": "Telephony service update response" }The exact response shape is determined by
TelephonyConnectorService.updatePhoneNumber(...), which is not inspected here.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.update", "params": { "_id": "phone-number-id" } }'
POST /api/rpc (Method: PhoneNumberManagerRpc.getFieldValues)
This method returns reference values for phone number form fields. The source only implements the workflows collection branch; all other collections return an empty array and generate a warning.
Description: Gets reference field values for phone number forms.
Request Body:
{ "method": "PhoneNumberManagerRpc.getFieldValues", "params": { "fieldName": "workflowId", "reference": { "collection": "workflows", "valueField": "_id", "displayField": "name", "filter": {}, "sort": {} } } }Parameters:
Name Type Required Description fieldNameStringYes Name of the field requesting reference values. referenceObjectYes Reference definition used to resolve the options. reference.collectionStringYes Collection name to resolve. Only workflowsis handled in the current source.reference.valueFieldStringYes Field to use as the returned option value. reference.displayFieldStringYes Field to use as the returned option label. reference.filterRecord<String, any>No Optional filter object passed to the workflow lookup. reference.sortRecord<String, any>No Optional sort object declared by the schema. Response:
{ "success": true, "data": [ { "value": "workflow-value", "label": "Workflow Name" } ] }When
reference.collectionisworkflows, the method callsWorkflowRpc.getDatawithpageSize: 1000and the provided filter, then maps each result to{ value, label }usingreference.valueFieldandreference.displayField. If that lookup fails, the method logs an error and returns an empty array. For any other collection, it logs a warning and returns an empty array.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.getFieldValues", "params": { "fieldName": "workflowId", "reference": { "collection": "workflows", "valueField": "_id", "displayField": "name" } } }'
POST /api/rpc (Method: PhoneNumberManagerRpc.delete)
This method deletes a phone number by identifier and forwards the call to the telephony service.
Description: Deletes a phone number through TelephonyManager.
Request Body:
{ "method": "PhoneNumberManagerRpc.delete", "params": { "_id": "phone-number-id" } }Parameters:
Name Type Required Description _idStringYes Identifier of the phone number record to delete. Response:
{ "success": true, "data": "Telephony service delete response" }The exact response shape is determined by
TelephonyConnectorService.deletePhoneNumber(...), which is not inspected here.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.delete", "params": { "_id": "phone-number-id" } }'
POST /api/rpc (Method: PhoneNumberManagerRpc.deleteByNumber)
This method deletes a phone number using its E.164 number and forwards the request to the telephony service.
Description: Deletes a phone number by E.164 number through TelephonyManager.
Request Body:
{ "method": "PhoneNumberManagerRpc.deleteByNumber", "params": { "phoneNumber": "+15551234567" } }Parameters:
Name Type Required Description phoneNumberStringYes Phone number to delete. Response:
{ "success": true, "data": "Telephony service delete-by-number response" }The exact response shape is determined by
TelephonyConnectorService.deletePhoneNumberByNumber(...), which is not inspected here.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PhoneNumberManagerRpc.deleteByNumber", "params": { "phoneNumber": "+15551234567" } }'
Request Flow
Notes
The source does not show any explicit authentication, role guard, or session guard on these methods. It also does not expose the underlying telephony service response schemas, so consumers should treat those response payloads as implementation-defined unless they inspect TelephonyConnectorService directly.