Omnix

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
    subscriptionId String Yes The subscription this contact belongs to.
    firstName String No The contact's first name.
    lastName String No The contact's last name.
    email String No The contact's email address.
    company String No The contact's company.
    jobTitle String No The contact's job title.
    channels Array No A list of communication channels for the contact. Defaults to an empty array in the schema.
    createdBy String Yes The userId of the user who created this contact. This field is set by the service from the request context.
    visibility String No Contact visibility. Defaults to private.
    tags Array<String> No Contact tags.
    notes String No Free-form notes.
    timezone String No 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
    _id String Yes The contact ID to update.
    subscriptionId String No Present in the schema, but the service removes tenancy changes before updating.
    firstName String No The contact's first name.
    lastName String No The contact's last name.
    email String No The contact's email address.
    company String No The contact's company.
    jobTitle String No The contact's job title.
    channels Array No The contact's channels.
    createdBy String No Present in the schema, but the service removes ownership changes before updating.
    visibility String No Contact visibility.
    tags Array<String> No Contact tags.
    notes String No Free-form notes.
    timezone String No Timezone value for the contact.
    createdAt Date No Present in the schema for completeness; not intended to be sent on update.
    updatedAt Date No 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
    _id String Yes 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
    targetContactId String Yes The _id of the contact to merge into.
    sourceContactIds Array<String> Yes An array of contact _id values 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