Skip to main content
SIEG is a Brazilian fiscal document platform used by accounting firms and finance teams. It automatically captures every electronic fiscal document issued by or against a company and stores it in the Cofre SIEG. This source brings those documents — the original XML files — into your Lakehouse.

Configuring SIEG as a Source

In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the SIEG option from the list of connectors. Click Next and you’ll be prompted to add your access.

1. Add account access

SIEG requires three credentials, and all of them are issued by SIEG to you. The Client ID and the Secret Key identify your integration. They are created when SIEG approves an integration request:
1

Request the integration

Fill in the integration form on the SIEG integrations portal with your company and system details.
2

Wait for approval

SIEG reviews the request and replies by email with a link to your credentials.
3

Copy both values

Open the link and copy the ClientId and the SecretKey.
The credentials page can only be opened once. Copy both values somewhere safe before closing it — if they are lost, SIEG has to issue new ones.
The API Key selects which vault is read, and is created by an administrator of your own SIEG account:
1

Open the API settings

Sign in to app.sieg.com and go to Minha Conta > Integrações API SIEG.
2

Generate a new key

Click Gerar nova chave API, give it an identification name, choose an expiration date (minimum 3 months, maximum 5 years) and select the read access level.
3

Copy the key

Copy the value of the Chave API field. Like the other two, it is shown only once.
The following configurations are available:
  • Client ID: The Client ID issued for your integration.
  • Secret Key: The Secret Key issued for your integration.
  • API Key: The API key to access your vault.
  • Start from document number (NSU) (Advanced): The document to begin the first extraction from. Leave it empty to start at the oldest document SIEG still holds.
  • Document types (Advanced): Which types to extract. Leave it empty to bring all of them.
Add the account access and click Next.

2. Select streams

SIEG has a single stream, documents, which carries every document type. Select it 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 the table (which will contain the fetched documents), and the type of sync.
  • Layer: choose between the existing layers on your catalog. This is where you will find your new extracted table once 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.
  • Sync Type: use INCREMENTAL. Each run resumes exactly where the previous one stopped (driven by the unique document number), so only new documents are fetched. Read more about Sync Types here.
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, 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. Optionally, you can define some additional settings:
  • Delta Log Retention: determine for how long we should store old states of this table as it gets updated. Read more about this resource here.
  • Additional Full Sync: Run a full export periodically in addition to incremental syncs. (Note: historical syncs are subject to SIEG’s roughly 90-day retention window).
Once you are ready, click Next to finalize the setup.

5. Check your new source

You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.
For you to be able to see it on your Catalog, you need at least one successful source run.

Streams and Fields

Fiscal XML layouts change with every schema version, and NFS-e has no national standard — each municipality publishes its own. A fixed set of typed columns would break every time a layout changes, so SIEG documents follow the same model Nekt uses for NoSQL sources: the whole document lands in a single column, next to the metadata needed to identify and filter it.
Stream containing all captured electronic fiscal documents and their attached events.Key Fields:

Document types

All types share the documents table and are told apart by the document_type field.
Nota Fiscal Eletrônica (model 55) — the invoice used for goods transactions between companies. Delivered with document_type set to NFe.
Nota Fiscal de Consumidor Eletrônica (model 65) — the invoice used for retail sales to end consumers. Delivered with document_type set to NFCe.
Conhecimento de Transporte Eletrônico — the document that covers freight and transport services. Delivered with document_type set to CTe.
Nota Fiscal de Serviço Eletrônica — the invoice used for services. Delivered with document_type set to NFSe.
NFS-e has no national standard: each municipality defines its own XML layout. Many carry no access key, and some arrive wrapped in a consultation envelope rather than as a standalone note. For those, access_key is empty and the structure inside document varies by municipality.
Cupom Fiscal Eletrônico — the electronic sales receipt issued by SAT and MFE devices. Delivered with document_type set to CFe.
Events attached to a document: cancellations, correction letters (CC-e), and operation manifestations. Delivered with document_type set to Evento, carrying the access_key of the document they refer to and their code in event_codes.

Data Model

The connector has a single stream. Documents are identified by their nsu.

Transformation example: reading data out of a document

The metadata columns exist so that the most common filters — by party, by type, by date — never require parsing the document column. To read a specific field out of document, parse it in a Query or Notebook using standard JSON functions. For example:

Implementation Notes

SIEG keeps roughly 90 days of documents, and that window moves forward every day. Anything older is no longer served by the SIEG API and cannot be retrieved — by this source or by any other integration. If you need a longer history, it has to come out of SIEG by other means.This makes a first historical load time-sensitive: while it runs, SIEG keeps trimming the oldest documents. A full 90-day window is around 2.4 million documents and takes roughly a day and a half of uninterrupted extraction, against a floor that advances by about one day’s worth of documents per day. It finishes comfortably if it is left alone — but every interrupted run gives back ground that the trimming takes permanently.If the extraction ever falls behind the trimming, the source warns you in the run log: documents between where it stopped and where SIEG’s history now begins were removed before they could be read.

API Limits & Performance

  • The SIEG API allows 60 requests per minute and returns at most 50 documents per call, which caps the extraction at roughly 1,500 documents per minute. A first load covering the full retention window can take a day or more for high-volume accounts, and the incremental runs after it are quick.
  • Adaptive Pacing: The connector implements adaptive API pacing that measures each endpoint against its own normal latency threshold. Because operations vary widely in latency (e.g. quick listings vs. 3-5s batch downloads or heavy event paginations), this granular pacing avoids false degradation signals and optimizes overall extraction speed without tipping the API over.
  • Each run resumes from the document right after the last one extracted, so nothing is fetched twice and nothing is skipped.
  • Selecting fewer document types does not make the extraction faster, since SIEG numbers every type in a single sequence, but it avoids storing what you do not need.

Skills for agents

Download SIEG skills file

SIEG connector documentation as plain markdown, for use in AI agent contexts.