Skip to content

Data Dictionary ​

This guide contains the data dictionary for the main tables used in the uContact databases. It will help you understand the structure, data types, and purpose of each column, making it easier to integrate custom developments or query relevant system information.

ccrepo.whatsapp_messages ​

This table stores all WhatsApp messages managed through uContact, whether incoming or outgoing, manually sent or delivered via Outbound Hubs.

Field NameData TypeDescription
idbigintUnique and auto-incremental identifier for each record in the table. It is the primary key.
id_whatsappvarchar(200)Unique ID of the message provided by the WhatsApp provider (e.g., Gupshup, Meta). This ID is essential for tracking. It may be empty for some initial outbound records.
timedatetimeDate and time when the message was processed by uContact. Always stored in UTC-0 timezone. Example: 2025-05-28 15:25:59
directionvarchar(8)Indicates the direction of the message. Possible Values:
- outbound: Message sent from uContact to the client.
- inbound: Message received from the client.
calleridvarchar(100)WhatsApp contact's phone number in international format, without the "+" character.
messagetextThe content of the message. For template messages (HSM), it may contain a special format: the unique HSM ID followed by the parameters, separated by “:”.
Examples: Hi! How are you?, hsm:1234:param1:param2
campaignvarchar(200)Name of the uContact campaign from which the message was received or sent.
agentvarchar(45)Username of the agent who sent the message in case of outbound messages; for inbound messages, it is the agent assigned to the interaction at the time of receipt. For messages sent from Outbound Hubs, this field is empty.
resultvarchar(900)Delivery status or message processing result. Possible Values:
- sent: Sent.
- delivered: Delivered to recipient.
- error: Failed to deliver.
- read: Message read by the client.
guidvarchar(64)GUID of the uContact interaction associated with the message.
attachmentsjsonContains information about attachments (images, documents, etc.) in JSON format. Each file represents the storage path in the instance. Example: ["20250606/image.jpg"]
quotedidvarchar(200)If the message is a reply, this field contains the id_whatsapp of the original quoted message. It is empty if the message is not a reply.

ccrepo.interactions ​

This table stores statistical and contextual information for every interaction handled by uContact (calls, messages, emails, etc.), across all channels. Each row represents a single interaction identified by its guid.

Field NameData TypeDescription
guidvarchar(64)Unique identifier of the interaction. It is the primary key.
start_datedatetimeDate and time when the interaction started. Stored in UTC-0 timezone.
end_datedatetimeDate and time when the interaction ended. Stored in UTC-0 timezone.
campaignvarchar(200)Name of the uContact campaign the interaction belongs to.
channelvarchar(45)Channel through which the interaction took place (e.g. telephony, webchat, whatsapp, email, sms, instagram, messenger, facebook).
disposition_idvarchar(45)Identifier of the disposition (typification) assigned to the interaction.
agentvarchar(45)Username of the agent that handled the interaction.
datajsonJSON object with the full state and metadata of the interaction. Its internal structure — including the custom variables — is described below.
dialerListvarchar(200)Name of the dialer list the interaction originated from, when launched by an Outbound Hub. null otherwise.
contactIdvarchar(100)Identifier of the contact associated with the interaction.
clientIdvarchar(100)Client identifier (phone number for SMS/WhatsApp/telephony, email address for Email/Webchat).
connectorIdvarchar(100)Identifier of the channel connector (source number, DID, etc.) used by the interaction.
finishedtinyintIndicates whether the interaction has finished.

data column structure ​

The data column stores a JSON object with two kinds of information:

  1. Native interaction fields at the root of the object — values that belong to the channel and the interaction itself (direction, durations, response times, subject, etc.). These are managed by the system and should be treated as read-only.
  2. A nested data object that groups the custom variables of the interaction. Each variable is placed in a section according to where it was generated, so custom variables never get mixed with the native fields.

The sections inside data.data are:

SectionDescription
automationCustom variables defined and set during the execution of a bot flow or an IVR flow, through the Set data activity.
outboundhubThe custom parameters of the contact uploaded in the list.
aiagentCustom variables generated by the AI Agent during the interaction.

Example of the data column:

json
{
  "guid": "a1b2c3d4-...",
  "clientid": "59899123456",
  "clientname": "John Doe",
  "channel": "whatsapp",
  "campaign": "Sales",
  "direction": "inbound",
  "holdtime": 12,
  "duration": 184,
  "subject": "...",
  "data": {
    "automation": { "varA": "value A", "varB": "value B" },
    "outboundhub": { "policyNumber": "12345", "agentName": "Jane" },
    "aiagent": { "intent": "billing", "sentiment": "neutral" }
  }
}

Accessing custom variables from a custom form

When a custom form reads the interaction with getInteraction(), the data property is exposed as interaction.data, so the custom variables are available directly under their section:

js
interaction.data.automation.varA;
interaction.data.outboundhub.policyNumber;
interaction.data.aiagent.intent;

The bot/IVR generates the variables → a custom form reads them through getInteraction().data. See the Variables of the Bot start activity for how those variables are produced → they are persisted under data.data.automation in the interaction.

ccrepo.channels_spool_repo ​

This table acts as historical messages for channels (WhatsApp, SMS, Email, Instagram, Messenger, etc.). Each record represents a message uploaded to an Outbound Hub.

Field NameData TypeDescription
idintUnique and auto-incremental identifier for each record in the table. It is the primary key.
dialervarchar(200)Name of the Outbound Hub that generated this record.
dialerListvarchar(200)Name of the contact list within the Outbound Hub from which the record originated.
clientIdmediumtextIdentifier of the contact to be reached (e.g., phone number, email address, or social media ID depending on the channel).
datajsonAdditional metadata associated with the record in JSON format. Used to pass extra variables or context to the outbound message.
contentmediumtextBody of the message to be sent to the contact.
contactIdvarchar(200)Internal uContact identifier of the contact linked to this record.
statusintCurrent processing status of the record. See Status values.
priorityintNumeric priority for processing order. Higher values indicate higher priority. Default is 0.
timezonevarchar(200)Timezone of the contact, used to schedule the message delivery within permitted hours. Example: America/New_York
templatevarchar(200)Name or identifier of the message template to be used (e.g., a WhatsApp HSM template name).
subjectvarchar(200)Subject of the message. Primarily used for Email channel outbound messages.
attachmentsvarchar(1023)Comma-separated list or path references of files to be attached to the outbound message.

ccrepo.calls_spool_repo ​

This table acts as historical for voice calls. Each record represents a call scheduled by an Outbound Hub to be dialed to one or more contacts.

Field NameData TypeDescription
idintUnique and auto-incremental identifier for each record in the table. It is the primary key.
dialervarchar(200)Name of the Outbound Hub that generated this record.
dialerListvarchar(200)Name of the contact list within the Outbound Hub from which the record originated.
clientIdsmediumtextOne or more phone numbers associated with the contact, separated by a delimiter. The dialer iterates over them using clientIndex.
datajsonAdditional metadata associated with the record in JSON format. Used to pass extra variables or context to the outbound call.
contentmediumtextScript or content to be used during the call (e.g., IVR script, agent script).
agentvarchar(200)Username of the agent assigned to handle this call record. Empty if the call is handled automatically (e.g., predictive or IVR mode).
timezonevarchar(200)Timezone of the contact, used to schedule the call within permitted hours. Example: America/New_York
contactIdvarchar(200)Internal uContact identifier of the contact linked to this record.
priorityintNumeric priority for processing order. Higher values indicate higher priority. Default is 0.
statusintCurrent processing status of the record. See Status values.
clientIndexintZero-based index pointing to the current phone number being dialed from the clientIds list. Incremented on each failed attempt to a number.
triesintTotal number of dial attempts made for this record across all numbers. Default is 0.
lastTrytimestampTimestamp of the most recent dial attempt. Used to enforce retry intervals. Default is 2003-06-08 00:00:00.

Spool status values ​

Shared by both channels_spool_repo and calls_spool_repo.

ValueNameDescription
0BUFFERRecord is in the buffer, pending to be loaded into memory.
1MEMORYLoaded in memory by the ListManager and ready to be processed.
2PROCESSINGRecord is currently being processed.
3ERRORAn error occurred while processing the record.
4BLACKLISTContact is on the blacklist; the record will not be processed.
5FINISHEDThe interaction associated with this record has finished successfully.
6EXPIREDAll attempts have been exhausted without success. In channels_spool_repo: all delivery attempts for the clientId. In calls_spool_repo: all dial attempts across every number in clientIds.
7PAUSEDProcessing has been paused.
8ORIGINATEThe originate command was sent but the call has not yet entered the flow.
9FLOWThe call has entered the IVR or agent flow.
10ABANDONEDThe interaction was abandoned.
11TIMEOUTThe record timed out before completing.
12AMDThe Answering Machine Detection determined the recipient is not human.
13INTERNAL_ERRORAn internal error occurred (e.g., originate failure); this attempt is not counted toward the retry limit.

uContact by net2phone