> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kualiz as a data source

> Bring data from Kualiz to your Lakehouse.

Kualiz is a Brazilian omnichannel customer-service and CRM platform (WhatsApp, Instagram, Facebook, Telegram, voice and webchat in a single queue), with a built-in CRM of pipelines, opportunities, products and FAQs. Nekt extracts this data through the Kualiz integration API.

## Configuring Kualiz as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Kualiz option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

The following configurations are required:

* **Instance URL**: The base URL of your Kualiz instance, for example `https://your-company.kualiz.com.br` (no trailing path). The integration endpoints live under this URL.

* **API Key**: The global integration API key of your instance. Generate it inside Kualiz under **Configurações** and paste it here. The key is sent with every request, so keep it secret.

* **Start Date**: (Optional) The earliest date from which records will be synced for incremental streams.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: you can choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: every time the extraction happens, we'll get only the new data - which is good if, for example, you want to keep every record ever fetched.
  * Full table: every time the extraction happens, we'll get the current state of the data - which is good if, for example, you don't want to have deleted data in your catalog.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/get-started/core-concepts/triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from Kualiz and their corresponding fields. All streams are extracted as full tables.

<AccordionGroup>
  <Accordion title="Queues">
    Service queues (filas) configured in the instance, with live counters.

    **Key Fields:**

    * `id` - Unique identifier of the queue
    * `name` - Display name of the queue
    * `type` - Type of the queue
    * `enabled` - Whether the queue is enabled in the system
    * `connected` - Whether the queue is connected to the messaging service
    * `authenticatedNumber` - Phone number authenticated on the queue
    * `openChats` - Number of chats currently open in the queue
    * `todaysRespondedChats` - Chats already answered in this queue today
    * `loggedAgentsCount` - Number of agents currently logged into the queue
  </Accordion>

  <Accordion title="Pipelines">
    CRM pipelines (funis) and their stages.

    **Key Fields:**

    * `id` - Unique identifier of the pipeline
    * `name` - Display name of the pipeline
    * `description` - Description of the pipeline
    * `stageorders` - Ordered list of stage IDs in the pipeline
    * `stages` - Ordered stages of the pipeline (JSON array of objects)
    * `maxdaysonpipeline` - Maximum days an opportunity may stay in the pipeline
    * `lossreasons` - Configured loss reasons (JSON array of objects)
    * `permissions` - Pipeline permission rules (JSON array of objects)
  </Accordion>

  <Accordion title="Opportunities">
    CRM opportunities. Iterated per queue and pipeline.

    <Note>The API returns only the currently **open** opportunities of a pipeline; already-closed (won or lost) opportunities are not returned, so this stream is a snapshot of the open pipeline.</Note>

    **Key Fields:**

    * `id` - Unique identifier of the opportunity
    * `title` - Title of the opportunity
    * `value` - Value as an integer multiplied by 100 (e.g. 10000 = 100.00)
    * `status` - Opportunity status: 0 open, 1 won, 2 lost
    * `probability` - Probability of closing, from 0 to 100
    * `fkPipeline` - ID of the pipeline the opportunity belongs to
    * `fkStage` - ID of the current stage
    * `responsableid` - ID of the responsible user
    * `mainphone` / `mainmail` - Primary phone and email
    * `expectedclosedate` - Expected close date (ISO 8601)
    * `createdAt` / `closedat` - Creation and close dates (ISO 8601)
    * `formsdata` - Custom form data (JSON object)
    * `queueId` - Source queue the opportunity was fetched from
  </Accordion>

  <Accordion title="Products">
    Products registered in the instance. Iterated per queue.

    **Key Fields:**

    * `id` - Unique identifier of the product
    * `name` - Name of the product
    * `internalcode` - Internal reference of the product
    * `gtin` - GTIN (barcode) of the product
    * `value` - Price as an integer multiplied by 100
    * `saleprice` - Promotional price as an integer multiplied by 100
    * `currency` - ISO 4217 currency code (e.g. BRL, USD)
    * `available` - Whether the product is available
    * `groups` - IDs of product groups the product belongs to
    * `files` - Files associated with the product (JSON array of objects)
  </Accordion>

  <Accordion title="Product Groups">
    Product groups configured in the instance.

    **Key Fields:**

    * `id` - Unique identifier of the product group
    * `name` - Name of the product group
    * `description` - Description of the product group
  </Accordion>

  <Accordion title="Contact Tags">
    Contact tags (etiquetas de contatos). Iterated per queue.

    **Key Fields:**

    * `id` - Unique identifier of the tag
    * `name` - Name of the tag
    * `bgcolor` - Background color of the tag
    * `fgcolor` - Font color of the tag
  </Accordion>

  <Accordion title="Chat Tags">
    Chat tags (etiquetas de atendimento). Iterated per queue.

    **Key Fields:**

    * `id` - Unique identifier of the chat tag
    * `name` - Name of the chat tag
    * `description` - Description of the chat tag
    * `marker` - Emoji marker of the chat tag
    * `priority` - Priority of the chat tag
    * `locktag` - Whether agents cannot remove this tag from a chat
    * `alertonpanel` - Whether this tag raises an alert on the panel
  </Accordion>

  <Accordion title="FAQs">
    Frequently asked questions configured in the instance.

    **Key Fields:**

    * `id` - Unique identifier of the FAQ
    * `question` - The FAQ question text
    * `description` - The FAQ answer / description
    * `keywords` - Keywords used to match the FAQ
    * `rating` - Average rating of the FAQ
    * `votes` - Number of votes the FAQ received
    * `faqgroups` - IDs of FAQ groups the FAQ belongs to
  </Accordion>

  <Accordion title="FAQ Groups">
    FAQ groups configured in the instance.

    **Key Fields:**

    * `id` - Unique identifier of the FAQ group
    * `name` - Name of the FAQ group
    * `items` - Number of FAQs in the group
  </Accordion>
</AccordionGroup>
