> ## 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.

# Msys Imob as a data source

> Bring your Msys Imob properties, attendances (leads), people, active rental contracts, open bank slips and reference tables to Nekt.

Msys Imob is a real estate management system for agencies that sell and rent properties. This connector reads your Msys Imob account through the Msys Imob API and brings the active properties, the attendances (leads) with their details and feedback history, the people registered in the system (owners, tenants, buyers, agents...), the active rental contracts, the open bank slips of the tenants, and the reference tables (categories, cities, condominiums, campaigns, portals and others).

> [!NOTE]
>
> The connector only reads data. It never creates, changes or deletes anything in Msys Imob.

## Configuring Msys Imob 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 Msys Imob option from the list of connectors.

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

### 1. Add account access

The connector signs in with an Msys Imob **API refresh token**. Msys Imob generates it for your account:

**1. Ask Msys Imob for an API refresh token**

Contact Msys Imob support ([suporte@moldsystems.com.br](mailto:suporte@moldsystems.com.br)) and ask for a refresh token for the Msys Imob API (OpenAPI v1) of your account.

**2. Paste it in Nekt**

Paste the token in the **Refresh Token** field.

The following configuration is available:

* **Refresh Token**: The Msys Imob API refresh token. On every sync the connector exchanges it for an access token that lasts one day.

> [!WARNING]
>
> Use this refresh token only in Nekt. Msys Imob returns a refresh token on every login and does not document whether the previous one stops working; Nekt keeps the newest one for the next sync. If another tool or script uses the same token, a sync may fail to log in. If a sync fails with "Msys Imob refused the refresh token", ask Msys Imob support for a new token and update it in the source settings.

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/runs/scheduling-and-triggers.md), 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).

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

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.

> [!NOTE]
>
> Each table is read completely and checked before it is loaded, so a sync that fails half-way never leaves a table with part of its rows. If Msys Imob refuses access to one area of the system (for example, contracts or bank slips), the tables of that area are skipped, the sync log says which ones, and the other tables keep syncing.

## Fields by stream

> [!NOTE]
>
> The Msys Imob API does not document the fields of its main lists (properties, attendances, people and active contracts). These tables keep the whole record in **one JSON column**, `data`, with the field names exactly as Msys Imob sends them (for example `idtProperty`, `valSales`, `namDistrict`), next to their id columns. Extract the fields you need in a [Query](https://docs.nekt.com/queries), for example `JSON_VALUE(data, '$.valSales')` in BigQuery.

### Properties and attendances

> [accordion] Properties
>
> Active properties (for sale, for rent, or both). Properties that are no longer active in Msys Imob are not returned by the API, so they leave this table.
>
> Table: `properties` · Primary key: `property_id` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `property_id` | Integer | Unique identifier of the property in Msys Imob (the property code). |
> | `data` | String (JSON) | The full property record as Msys Imob returns it. |

> [accordion] Attendances
>
> Attendances (leads and their follow-up) of every status: normal, attention, caution, lost, finished, rented and sold.
>
> Table: `attendances` · Primary key: `attendance_id`, `pre_attendance_id` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `attendance_id` | Integer | Identifier of the attendance; 0 when the row is only a pre-attendance. |
> | `pre_attendance_id` | Integer | Identifier of the pre-attendance; 0 when the row has none. |
> | `status` | String | Status code: N normal, W attention, D caution, L lost, F finished, R rented, S sold. |
> | `data` | String (JSON) | The full attendance record as Msys Imob returns it. |

> [accordion] Attendance Details
>
> Details of each attendance, with its feedback history. Msys Imob serves them one attendance at a time, so incremental syncs only read again the attendances that are new or changed in the attendance list, plus a seventh of the others each day: every attendance is refreshed at least once a week. The first sync and full syncs read every attendance and take longer.
>
> Table: `attendance_details` · Primary key: `attendance_id` · Sync: Incremental (`details_read_at`)
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `attendance_id` | Integer | Unique identifier of the attendance. |
> | `pre_attendance_id` | Integer | Identifier of the pre-attendance that originated the attendance. |
> | `code` | String | Codes of the properties linked to the attendance, comma separated. |
> | `property_ids` | Array of integers | Identifiers of the properties linked to the attendance. |
> | `pretender` | String | Name of the prospect. |
> | `email` | String | E-mail of the prospect. |
> | `phone` | String | Phone of the prospect. |
> | `profile` | String | Profile of the prospect. |
> | `temperature` | String | Temperature (interest level) of the attendance. |
> | `relevance` | String | Relevance of the attendance. |
> | `status` | String | Status code of the attendance. |
> | `type` | String | Type of the attendance (LOCATION rental, SALES sale). |
> | `pipeline_level` | String | Stage of the attendance in the sales pipeline. |
> | `how_to_get` | String | How the prospect reached the agency (media). |
> | `employee` | String | Agent in charge of the attendance. |
> | `team` | String | Team in charge of the attendance. |
> | `sector` | String | Sector (department) of the attendance. |
> | `condominium` | String | Condominium of interest. |
> | `real_estate` | String | Agency (branch) of the attendance. |
> | `last_feedback` | String | Text of the last feedback recorded. |
> | `reason_finished` | String | Reason the attendance was finished. |
> | `created_at` | Datetime | When the attendance was created (Brasília time). |
> | `updated_at` | Datetime | When the attendance was last updated (Brasília time). |
> | `finished_at` | Datetime | When the attendance was finished (Brasília time). |
> | `feedbacks` | String (JSON) | Feedback history (JSON array of objects with desFeedback, dtaInsert and namResponsible). |
> | `details_read_at` | Datetime | When the connector read these details, used as the incremental replication key. |

### People

> [accordion] People
>
> Everyone registered in Msys Imob: owners, tenants, buyers, guarantors, agents, captivators, employees and service providers, active and inactive. Incremental syncs ask Msys Imob for the people registered or updated since the day before the last sync.
>
> Table: `people` · Primary key: `person_id` · Sync: Incremental (`synced_at`)
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `person_id` | Integer | Unique identifier of the person. |
> | `synced_at` | Datetime | When the connector read this row, used as the incremental replication key. |
> | `data` | String (JSON) | The full person record as Msys Imob returns it. |

### Contracts and bank slips

> [accordion] Active Contracts
>
> Active rental contracts.
>
> Table: `active_contracts` · Primary key: `contract_id` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `contract_id` | Integer | Unique identifier of the contract. |
> | `data` | String (JSON) | The full contract record as Msys Imob returns it. |

> [accordion] Open Bank Slips
>
> Bank slips (boletos) still open for the tenants of the active contracts. Msys Imob looks them up one tenant (CPF or CNPJ) at a time, so this table makes one request per tenant. Paid slips leave the table. If no open slip is found (or Msys Imob returns no active contract) but the previous sync had some, the table is kept as it was and the sync reports it; run a Full sync to accept an empty table.
>
> Table: `open_bank_slips` · Primary key: `document`, `slip_key` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `document` | String | CPF or CNPJ (digits only) of the tenant. |
> | `slip_key` | String | Key of the bank slip within the tenant (its URL). |
> | `bank_slip_url` | String | URL of the bank slip. |
> | `bank_slip_due_date` | Date | Due date of the bank slip. |
> | `contract_due_date` | Date | Due date (end) of the contract. |
> | `property_address` | String | Address of the rented property. |
> | `user_phone_number` | String | Phone number of the tenant. |
> | `contract_ids` | Array of integers | Active contracts in which this document is a tenant. |

### Reference tables

All reference tables are synced as full table and have the same columns: `id` (identifier of the row in Msys Imob), `name` (its name or description) and `data` (the full row as Msys Imob returns it, JSON). Some have an extra column, which is part of the primary key.

> [accordion] Reference tables
>
> | Table | Content | Extra column |
> | :- | :- | :- |
> | `banks` | Banks registered in the system. | |
> | `branch_activities` | Branches of activity of commercial properties. | |
> | `campaigns` | Sale and rental campaigns. | `campaign_type` (S sale, L rental) |
> | `categories` | Property categories. | |
> | `sub_categories` | Property sub-categories. | |
> | `characteristics` | Property and furniture characteristics. | `characteristic_type` (P property, M furniture) |
> | `states` | States. | |
> | `cities` | Cities of each state. | `state_id` |
> | `condominiums` | Condominiums. | |
> | `condominium_towers` | Towers of each condominium. | `condominium_id` |
> | `markers` | Property markers (tags). | |
> | `portals` | Listing portals active in the system. | |
> | `portal_highlights` | Highlight types of each portal. | `portal_id` |
> | `real_estates` | Agencies (branches) of the account. | |
> | `departments` | Departments. | |
> | `groups` | Groups. | |
> | `job_titles` | Job titles. | |
> | `how_to_get` | Options of how a client reached the agency. | |
> | `medias` | Media options (how the client arrived). | |
> | `incident_types` | Incident (ocorrência) types. | |
> | `issuing_institutions` | ID document issuing institutions. | |
> | `marital_statuses` | Marital statuses. | |
> | `nationalities` | Nationalities. | |
> | `professions` | Professions. | |
> | `schoolings` | Schooling levels. | |
> | `nfse_implementations` | Service invoice (NFS-e) implementations. | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.