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

# Flash as a data source

> Bring time and attendance data from Flash to your Lakehouse.

Flash is a Brazilian HR and benefits platform. The connector uses the Flash API to extract data from the **Controle de Jornada** (time and attendance) module: the time punches of each employee, the payroll budgets (verbas) calculated from them, events such as justified absences, and the timetable (escala) each employee follows. It also extracts the companies of your economic group and their employees, so you can analyze working hours, overtime, and absences in your Lakehouse.

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

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

### 1. Add account access

The connector authenticates with a Flash **API key**. To generate it, an administrator of your company in Flash goes to [hros.flashapp.com.br](https://hros.flashapp.com.br/), opens **Configurações > Plataforma > Chaves de acesso programático**, and generates a key.

<Note>
  API access must be enabled by Flash for your company. If the option to generate a key is not available, contact Flash support ([empresa@flashapp.com.br](mailto:empresa@flashapp.com.br)) and ask them to enable API access.
</Note>

The following configurations are available:

* **API Key**: the API key generated in Flash. Required.

* **Start Date**: the first day of history extracted. Time punches are read from this day on the first sync and continue from the last synced day afterwards. Budgets, events, and timetable allocations are read in full, month by month, from this date on every sync. Required.

* **Company IDs** (advanced): the Flash ids of the companies to extract. Leave it empty to extract every company of the economic group the API key belongs to.

* **Time Punches Lookback Days** (advanced): how many days before today the time punches are read again on every sync, so adjustments and approvals made after the punch are picked up. The default is 35, which covers the whole previous month.

* **Requests Per Minute** (advanced): how fast the connector may call Flash. The default is 120. When Flash asks the connector to slow down, it waits and continues automatically.

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.

<Note>
  Flash returns time punches one day at a time, for one company at a time. On the first sync, the connector makes one request per day since the start date for each company, so an early start date makes that sync noticeably longer. Later syncs only read the recent days.
</Note>

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**: time punches are INCREMENTAL: each sync brings the recent days again plus any new ones. The other streams are FULL\_TABLE: each sync replaces the table with what Flash currently holds. Read more about Sync Types [here](https://docs.nekt.com/get-started/core-concepts/types-of-sync).

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

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

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 Flash and their corresponding fields. API reference: [Flash API](https://docs.api.flashapp.services/).

<Note>
  Every table has a `raw_payload` column with the whole record exactly as Flash returned it, so information without a column of its own is still available. Lists and objects are stored as JSON text, and timestamps are converted to UTC.
</Note>

<AccordionGroup>
  <Accordion title="Companies">
    Companies of the economic group the API key belongs to (or only those set in Company IDs). Every other table is read company by company.

    Table: `companies` · Primary key: `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | String | Unique identifier of the company in Flash. |
    | `name` | String | Trade name of the company. |
    | `legal_name` | String | Legal (registered) name of the company. |
    | `registration_number` | String | Company registration number (CNPJ). |
    | `active` | Boolean | Whether the company is active in Flash. |
    | `logo` | String | URL of the company logo. |
    | `address_street` | String | Street of the company address. |
    | `address_number` | String | Number of the company address. |
    | `address_complement` | String | Complement of the company address (suite, floor). |
    | `address_district` | String | District (bairro) of the company address. |
    | `address_city` | String | City of the company address. |
    | `address_state` | String | State of the company address (e.g. SP). |
    | `address_zip_code` | String | Postal code (CEP) of the company address. |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>

  <Accordion title="Employees">
    Employees registered in each company. Use it to add names, e-mails and organization data to the time punches, which only carry the employee id, external id, PIS, and CPF.

    Table: `employees` · Primary key: `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | String | Unique identifier of the employee in Flash. |
    | `company_id` | String | Identifier of the Flash company the record belongs to. |
    | `name` | String | Full name of the employee. |
    | `email` | String | Personal e-mail address of the employee. |
    | `corporate_email` | String | Corporate e-mail address of the employee. |
    | `document_number` | String | Employee's CPF (Brazilian individual taxpayer number). |
    | `external_id` | String | Identifier of the employee in the company's own systems (external id). |
    | `phone_number` | String | Phone number of the employee. |
    | `status` | String | Status of the employee in Flash (e.g. ACTIVE, INACTIVE). |
    | `cost_center_id` | String | Identifier of the cost center the employee belongs to. |
    | `manager_id` | String | Identifier of the employee's direct manager (another employee id). |
    | `invitation_date` | Datetime | When the invitation to the Flash app is (or was) sent to the employee. |
    | `profile_picture` | String | URL of the employee's profile picture. |
    | `group_ids` | Array of strings | Identifiers of the groups the employee belongs to. |
    | `groups` | String (JSON) | Groups the employee belongs to (JSON array of objects with id and name). |
    | `department_ids` | Array of strings | Identifiers of the departments the employee belongs to. |
    | `role_ids` | Array of strings | Identifiers of the roles (cargos) assigned to the employee. |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>

  <Accordion title="Time Punches">
    Time punches (marcações de ponto) of each employee, one row per employee and day; the punches of the day are in the `attendances` column. Each sync reads again the last days set in Time Punches Lookback Days (35 by default), so adjustments and approvals made after the punch are picked up.

    Table: `time_punches` · Primary key: `company_id`, `employee_id`, `day` · Sync: Incremental

    | Field | Type | Description |
    | :- | :- | :- |
    | `company_id` | String | Identifier of the Flash company the record belongs to. |
    | `employee_id` | String | Identifier of the employee in Flash. |
    | `day` | Date | Day the punches belong to (the day requested from Flash), used as the incremental replication key. |
    | `date` | Datetime | Date of the punches as returned by Flash. |
    | `external_id` | String | Identifier of the employee in the company's own systems (external id). |
    | `pis` | String | Employee's PIS number (Brazilian social integration program id). |
    | `document_number` | String | Employee's CPF (Brazilian individual taxpayer number). |
    | `attendances` | String (JSON) | Punches of the day (JSON array of objects): time, attendanceStatus, approvalStatus, reason, offline (punched offline), followingDay (punch belongs to the next calendar day), isReceiptAvailable and nsr (sequential registration number of the punch). |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>

  <Accordion title="Budgets">
    Payroll budgets (verbas) calculated from the time tracking, per employee and month, such as overtime and absences. Every sync reads every month from the start date to the current month.

    Table: `budgets` · Primary key: `company_id`, `employee_id`, `year`, `month`, `event_code`, `date` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `company_id` | String | Identifier of the Flash company the record belongs to. |
    | `employee_id` | String | Identifier of the employee in the time and attendance module. |
    | `employee_id_api` | String | Identifier of the employee as exposed by the Flash API (employeeIdApi). |
    | `external_id` | String | Identifier of the employee in the company's own systems (external id). |
    | `year` | Integer | Year of the payroll period. |
    | `month` | Integer | Month of the payroll period (1-12). |
    | `date` | Datetime | Date of the budget line. |
    | `event_code` | String | Code of the payroll event (verba), as configured in Flash. |
    | `event_description` | String | Description of the payroll event (e.g. overtime 50%, absences). |
    | `event_type` | String | Type of the payroll event, as returned by Flash. |
    | `event_value` | String | Value of the event as returned by Flash (text). |
    | `event_decimal_value` | Number | Value of the event as a decimal number (e.g. hours as 1.5). |
    | `event_value_in_hours_and_minutes` | String | Value of the event in hours and minutes (e.g. 01:30). |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>

  <Accordion title="Events">
    Time and attendance events, such as justified absences, medical certificates, and time off. Every sync reads every month from the start date to the current month; an event that spans several months appears once.

    Table: `events` · Primary key: `company_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Unique identifier of the event in Flash. |
    | `company_id` | String | Identifier of the Flash company the record belongs to. |
    | `employee_id` | String | Identifier of the employee the event belongs to. |
    | `external_id` | String | Identifier of the employee in the company's own systems (external id). |
    | `reason_id` | Integer | Identifier of the event reason (type of absence or occurrence). |
    | `reason_api_id` | String | Identifier of the event reason as exposed by the Flash API. |
    | `period_type` | String | How the event period is expressed (e.g. whole days or hours). |
    | `start_date` | Datetime | When the event starts. |
    | `end_date` | Datetime | When the event ends. |
    | `duration` | Number | Duration of the event. |
    | `justification` | String | Justification written for the event. |
    | `authorization_text` | String | Text of the authorization given for the event. |
    | `employee_authorization_id` | Integer | Identifier of the employee authorization linked to the event. |
    | `approval_type` | String | How the event is approved, as returned by Flash. |
    | `status` | String | Status of the event (e.g. cancelled). |
    | `period_year` | Integer | Year of the period the event is accounted in. |
    | `period_month` | Integer | Month of the period the event is accounted in (1-12). |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>

  <Accordion title="Timetable Allocations">
    Which timetable (escala) each employee follows, and from when. Every sync reads every month from the start date to the end of the current month; an allocation valid in several months appears once.

    Table: `timetable_allocations` · Primary key: `company_id`, `employee_id`, `allocation_id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `company_id` | String | Identifier of the Flash company the record belongs to. |
    | `employee_id` | String | Identifier of the employee in Flash. |
    | `allocation_id` | Integer | Unique identifier of the allocation. |
    | `external_id` | String | Identifier of the employee in the company's own systems (external id). |
    | `employee_name` | String | Name of the employee. |
    | `timetable_id` | Integer | Identifier of the timetable (escala) the employee is allocated to. |
    | `timetable_code` | String | Code of the timetable. |
    | `timetable_name` | String | Name of the timetable. |
    | `allocation_start_date` | String | When the allocation starts, as returned by Flash. |
    | `allocation_end_date` | String | When the allocation ends, as returned by Flash (empty when open-ended). |
    | `raw_payload` | String (JSON) | The whole record exactly as Flash returned it (JSON object), including fields that have no column of their own. |
  </Accordion>
</AccordionGroup>


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