canonical: https://jentic.com/apis/sieg.com/baixar-eventos

# Sieg Baixar Eventos

The SIEG Baixar Eventos API downloads the fiscal events linked to Brazilian electronic documents such as NF-e, CT-e, and NFC-e, for example cancellations, from a SIEG account. A request identifies the document with ChaveXml and TipoXml and can narrow results by TipoEvento, an event date range, and the CNPJ of the issuer, recipient, sender, or service taker. Each returned event carries its TipoEvento code, Descricao, Protocolo, DataEvento, and the raw event XML, with Skip and Take for paging.

## For AI agents

Download the events tied to an NF-e, CT-e, or NFC-e from SIEG, such as cancellations, filtered by event type, date range, or the CNPJs involved.

## Scope

Does not issue or cancel documents, and does not download the document XML itself. Use for retrieving the events linked to NF-e, CT-e, and NFC-e documents only.

## Capabilities

- Download the fiscal events linked to a document identified by ChaveXml and TipoXml
- Filter events by TipoEvento, such as 110111 for a cancellation
- Narrow events to a DataInicioEvento and DataFimEvento window
- Filter by the CNPJ of the issuer (CnpjEmit), recipient (CnpjDest), sender (CnpjRem), or service taker (CnpjTom)
- Read each event's Descricao, Protocolo, DataEvento, and raw Xml, paging with Skip and Take

## Use cases

### Agent that confirms an invoice's status

Before a payment run, an agent checks that each supplier invoice is still valid. Through Jentic the agent searches for 'download events for an NF-e', loads the baixarEventos operation, and sends the ChaveXml and TipoXml with TipoEvento 110111, with the SIEG JWT and access key injected at call time. If a cancellation event comes back, the agent holds the payment and reports the Protocolo.

Example prompt: Call POST `/api/v1/baixar-eventos` with ChaveXml for the supplier invoice, TipoXml 1, and TipoEvento 110111, and hold payment if any event is returned

### Event history for a document

Audits and disputes need the full trail of what happened to a document after it was issued. Without a TipoEvento filter the operation returns every event SIEG holds for the ChaveXml, each with its Descricao, DataEvento, Protocolo, and the raw event XML. Skip and Take page through long histories.

Example prompt: Call POST `/api/v1/baixar-eventos` with ChaveXml, TipoXml 2, Skip 0, and Take 50, then list each event's Descricao and DataEvento in date order

### Counterparty-filtered event review

Accounting firms that serve several companies need events for one client at a time. The CnpjEmit, CnpjDest, CnpjRem, and CnpjTom filters restrict results to documents where that CNPJ is the issuer, recipient, sender, or service taker, and the DataInicioEvento and DataFimEvento fields bound the period under review.

Example prompt: Call POST `/api/v1/baixar-eventos` with ChaveXml, TipoXml 1, CnpjDest set to the client's CNPJ, DataInicioEvento '2026-10-01T00:00:00Z', and DataFimEvento '2026-10-31T23:59:59Z'

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/v1/baixar-eventos` | Download events linked to a fiscal document |

## Key resources

- **Fiscal events** — Events linked to a document, each with TipoEvento, Descricao, Protocolo, DataEvento, and raw Xml

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 66 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 65 / 100
  - AI-Readiness & Agent Experience: 52 / 100
  - Agent Usability: 94 / 100
  - Security: 58 / 100
  - AI Discoverability: 50 / 100
- **View full report:** https://jentic.com/apis/sieg.com/baixar-eventos/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Baixar Eventos by hand means obtaining a SIEG JWT from a separate authentication endpoint, pairing it with an X-API-Key or X-OAuth-Token header, and paging results with Skip and Take. Through Jentic you install once, import Baixar Eventos from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** Baixar Eventos carries the document key and CNPJ filters inside the request body, so rules bound which operations your agent may call, not which companies or documents. Limit the agent to the operations it needs, such as reading events, and keep other SIEG operations out unless you add them.
- **Credential handling:** Your SIEG JWT and access key are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'check whether an NF-e was cancelled' or 'download events for a CT-e', and Jentic returns the matching SIEG operation with its input schema so the agent sends ChaveXml, TipoXml, and filters correctly.

## Related APIs

- **NotaGuard** — Read NF-e, NFC-e, and NFS-e documents with their SEFAZ events
- **SIEG BaixarXml** — Download a single document XML by access key, optionally with its events
- **SIEG Baixar XML por NSU** — Download XMLs as a ZIP by NSU sequence number

## FAQ

### What authentication does the SIEG Baixar Eventos API use?

Per its OpenAPI spec, each call needs a JWT sent as an HTTP bearer token together with either an X-API-Key header or an X-OAuth-Token header carrying a SIEG OAuth 2.0 token. The JWT is generated by SIEG's authentication endpoint, which this spec does not include. Through Jentic both credentials are stored by your own instance and attached at call time, so the agent never sees them.

### Can I check whether an NF-e was cancelled?

Yes. Send ChaveXml and TipoXml 1 with TipoEvento 110111, the cancellation event code the spec gives as an example. A returned event with a Protocolo and DataEvento means the cancellation was recorded; ChaveXml and TipoXml are the only required fields.

### What are the rate limits for the SIEG Baixar Eventos API?

The OpenAPI spec does not specify rate limits. Check your SIEG plan and the documentation at https://sieg.com for current limits.

### Is there a SIEG Baixar Eventos MCP server?

You don't need an MCP server to give your agent Baixar Eventos. Jentic connects it directly from the API Directory: import it, store your SIEG JWT and access key once, and your agent calls the events operation when it needs it, found on demand rather than preloaded into its context.

### How do I download a document's events through Jentic?

Search Jentic for 'download events for an NF-e', load the POST `/api/v1/baixar-eventos` operation, and send ChaveXml and TipoXml, plus any TipoEvento, date, or CNPJ filters. Use Skip and Take to page through long results. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the SIEG Baixar Eventos API?

Yes, at the operation level. Give the agent a rule that includes this events download and nothing else from SIEG, and it can check cancellations but cannot download full document XML through the other SIEG APIs, with every call logged. The CNPJ and ChaveXml filters travel in the request body, so the rule cannot pin it to one company.
