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.
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.
- 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.
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.
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).
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.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.Documents
Documents
Stream containing all captured electronic fiscal documents and their attached events.Key Fields:
Document types
All types share thedocuments table and are told apart by the document_type field.
NF-e
NF-e
Nota Fiscal Eletrônica (model 55) — the invoice used for goods transactions between companies. Delivered with
document_type set to NFe.NFC-e
NFC-e
Nota Fiscal de Consumidor Eletrônica (model 65) — the invoice used for retail sales to end consumers. Delivered with
document_type set to NFCe.CT-e
CT-e
Conhecimento de Transporte Eletrônico — the document that covers freight and transport services. Delivered with
document_type set to CTe.NFS-e
NFS-e
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.CF-e
CF-e
Cupom Fiscal Eletrônico — the electronic sales receipt issued by SAT and MFE devices. Delivered with
document_type set to CFe.Events
Events
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 theirnsu.
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 thedocument column.
To read a specific field out of document, parse it in a Query or Notebook using standard JSON functions. For example:
SQL transformation
SQL transformation
Implementation Notes
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.