OmniContactsRpc
The OmniContactsRpc API group provides contact-management endpoints for creating, updating, deleting, merging, and querying Omnix contacts, along with two read helpers for SIP credentials and contact tags. The methods delegate to OmniContactsService for contact persistence and business rules, and one method delegates to TelephonyConnectorService for softphone credentials.
Endpoints
POST /api/rpc (Method: OmniContactsRpc.create)
Creates a new Omnix contact.
Description: Creates a new Omnix contact.
Request Body:
{ "method": "OmniContactsRpc.create", "params": { "subscriptionId": "string", "firstName": "string | null", "lastName": "string | null", "email": "string | null", "company": "string | null", "jobTitle": "string | null", "channels": [ { "channelId": "string", "type": "email | voice | sms | whatsapp | web_chat | facebook_messenger | instagram | telegram", "value": "string", "label": "string | null", "isPreferred": false } ], "createdBy": "string", "visibility": "public | private", "tags": ["string"], "notes": "string | null", "timezone": "string | null" } }Parameters:
Name Type Required Description subscriptionIdStringYes The subscription this contact belongs to. firstNameStringNo The contact's first name. lastNameStringNo The contact's last name. emailStringNo The contact's email address. companyStringNo The contact's company. jobTitleStringNo The contact's job title. channelsArrayNo A list of communication channels for the contact. Defaults to an empty array in the schema. createdByStringYes The userId of the user who created this contact. This field is set by the service from the request context. visibilityStringNo Contact visibility. Defaults to private.tagsArray<String>No Contact tags. notesStringNo Free-form notes. timezoneStringNo Timezone value for the contact. Response:
{ "success": true, "data": { "_id": "string", "subscriptionId": "string", "firstName": "string | null", "lastName": "string | null", "email": "string | null", "company": "string | null", "jobTitle": "string | null", "channels": [], "createdBy": "string", "visibility": "public | private", "tags": [], "notes": "string | null", "timezone": "string | null", "createdAt": "date", "updatedAt": "date" } }The RPC returns the created contact record produced by
OmniContactsService.createContact(...).Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "OmniContactsRpc.create", "params": { "firstName": "Asha", "lastName": "Patel", "email": "[email protected]", "visibility": "private" } }'
POST /api/rpc (Method: OmniContactsRpc.update)
Updates an existing Omnix contact.
Description: Updates an existing Omnix contact.
Request Body:
{ "method": "OmniContactsRpc.update", "params": { "_id": "string", "subscriptionId": "string", "firstName": "string | null", "lastName": "string | null", "email": "string | null", "company": "string | null", "jobTitle": "string | null", "channels": [ { "channelId": "string", "type": "email | voice | sms | whatsapp | web_chat | facebook_messenger | instagram | telegram", "value": "string", "label": "string | null", "isPreferred": false } ], "createdBy": "string", "visibility": "public | private", "tags": ["string"], "notes": "string | null", "timezone": "string | null", "createdAt": "date", "updatedAt": "date" } }Parameters:
Name Type Required Description _idStringYes The contact ID to update. subscriptionIdStringNo Present in the schema, but the service removes tenancy changes before updating. firstNameStringNo The contact's first name. lastNameStringNo The contact's last name. emailStringNo The contact's email address. companyStringNo The contact's company. jobTitleStringNo The contact's job title. channelsArrayNo The contact's channels. createdByStringNo Present in the schema, but the service removes ownership changes before updating. visibilityStringNo Contact visibility. tagsArray<String>No Contact tags. notesStringNo Free-form notes. timezoneStringNo Timezone value for the contact. createdAtDateNo Present in the schema for completeness; not intended to be sent on update. updatedAtDateNo Present in the schema for completeness; not intended to be sent on update. Response:
{ "success": true, "data": { "_id": "string", "subscriptionId": "string", "firstName": "string | null", "lastName": "string | null", "email": "string | null", "company": "string | null", "jobTitle": "string | null", "channels": [], "createdBy": "string", "visibility": "public | private", "tags": [], "notes": "string | null", "timezone": "string | null", "createdAt": "date", "updatedAt": "date" } }The RPC returns the updated contact record produced by
OmniContactsService.updateContact(...).Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "OmniContactsRpc.update", "params": { "_id": "66b5f7b2f1d4c5a8e1b2c3d4", "firstName": "Asha", "company": "Omnix" } }'
POST /api/rpc (Method: OmniContactsRpc.delete)
Deletes an Omnix contact.
Description: Deletes an Omnix contact.
Request Body:
{ "method": "OmniContactsRpc.delete", "params": { "_id": "string" } }Parameters:
Name Type Required Description _idStringYes The contact ID to delete. Response:
{ "success": true, "data": { "success": true } }The RPC returns the result from
OmniContactsService.deleteContact(...), which reports whether a record was deleted.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "OmniContactsRpc.delete", "params": { "_id": "66b5f7b2f1d4c5a8e1b2c3d4" } }'
POST /api/rpc (Method: OmniContactsRpc.merge)
Merges multiple source contacts into a single target contact.
Description: Merges multiple source contacts into a single target contact.
Request Body:
{ "method": "OmniContactsRpc.merge", "params": { "targetContactId": "string", "sourceContactIds": ["string"] } }Parameters:
Name Type Required Description targetContactIdStringYes The _idof the contact to merge into.sourceContactIdsArray<String>Yes An array of contact _idvalues to merge from. Must contain at least one item.Response:
{ "success": true, "data": { "success": true, "mergedContact": { "_id": "string", "subscriptionId": "string", "firstName": "string | null", "lastName": "string | null", "email": "string | null", "company": "string | null", "jobTitle": "string | null", "channels": [], "createdBy": "string", "visibility": "public | private", "tags": [], "notes": "string | null", "timezone": "string | null", "createdAt": "date", "updatedAt": "date" } } }The RPC returns a success flag and the merged target contact after the merge completes.
Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "OmniContactsRpc.merge