canonical: https://jentic.com/apis/sieg.com/enviar-xmls

# Sieg Enviar Xmls

The SIEG Enviar Xmls API uploads a Brazilian fiscal document XML from an external system into a SIEG account. The request carries the document as a Base64-encoded string in the Xml field, and the response returns isSuccess, isFailure, statusCode, errorMessage, and a data string describing the result. A 409 Conflict response signals that the XML belongs to a company that is not valid for the account, so an upload job can tell a rejected document from a transport error.

## For AI agents

Upload a fiscal document XML into SIEG from another system: send it Base64-encoded in the Xml field and read isSuccess, errorMessage, and statusCode to confirm it was accepted.

## Scope

Does not issue or authorize invoices with SEFAZ, download documents, or file tax returns. Use for uploading existing fiscal document XMLs into a SIEG account only.

## Capabilities

- Upload a fiscal document XML to SIEG as a Base64 string in the Xml field
- Confirm each upload with the isSuccess and isFailure flags and the statusCode
- Surface the reason for a rejected upload from errorMessage
- Detect XMLs for a company the account cannot accept through the 409 Conflict response

## Use cases

### Agent-run XML uploads through Jentic

An accounting agent connected through Jentic receives fiscal XMLs from email or a shared folder and loads them into SIEG. It Base64-encodes each file, sends it in the Xml field, and reports any upload where isSuccess is false along with the errorMessage. The SIEG JWT and access key are injected at call time, so the agent never holds them.

Example prompt: Base64-encode the file invoice-35251.xml, call POST `/api/v1/send-xml` with it in Xml, and report isSuccess, statusCode, and errorMessage

### ERP to SIEG document sync

Companies that issue documents from their own ERP can keep SIEG complete by sending each authorized XML as soon as it is generated. The single upload operation takes one document per call, and the response flags tell the sync job whether to mark the document as delivered or retry it later.

Example prompt: For each XML generated by the ERP today, call POST `/api/v1/send-xml` with its Base64 content and mark it delivered when isSuccess is true

### Handling rejected uploads

Accounting offices that serve many clients sometimes receive XMLs for a company not set up in the SIEG account. The upload returns 409 Conflict for an invalid company, so a job can route those files to a review queue instead of retrying, and log the errorMessage for the person who fixes the account setup.

Example prompt: Call POST `/api/v1/send-xml` for each file in the inbox, move any file that returns 409 to a review folder, and list their errorMessage values

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/v1/send-xml` | Upload a Base64 fiscal XML to SIEG |

## Key resources

- **XML upload** — A single fiscal document XML sent Base64-encoded in the Xml field, with a success or failure result

## 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: 63 / 100
  - AI-Readiness & Agent Experience: 53 / 100
  - Agent Usability: 94 / 100
  - Security: 58 / 100
  - AI Discoverability: 50 / 100
- **View full report:** https://jentic.com/apis/sieg.com/enviar-xmls/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 Enviar Xmls by hand means obtaining a SIEG JWT, pairing it with an X-API-Key or X-OAuth-Token header, Base64-encoding every document, and branching on isSuccess and 409 responses. Through Jentic you install once, import Enviar Xmls from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** Enviar Xmls carries the document inside the request body, so rules bound which operations your agent may call, not which documents it uploads. This is a write into your SIEG account, so include it only for agents that should upload and leave it out for agents that only read SIEG data.
- **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 'upload a fiscal XML to SIEG' or 'send an NF-e XML', and Jentic returns the Enviar Xmls operation with its input schema so the agent sends the Base64 Xml field correctly.

## Related APIs

- **SIEG Contar Xmls** — Count stored XMLs by type for a date range and CNPJ filters
- **SIEG BaixarXml** — Download one fiscal document XML by its access key
- **NotaGuard** — List and filter NF-e, NFC-e, and NFS-e documents and download their XML or DANFE

## FAQ

### What authentication does the SIEG Enviar Xmls API use?

Per its OpenAPI spec, each call needs two credentials together: a JWT sent as an HTTP bearer token, plus either an X-API-Key header or an X-OAuth-Token header carrying a SIEG OAuth 2.0 token. Through Jentic both credentials are stored encrypted by your own instance and attached at call time, so the agent never sees them.

### How do I format the XML for Enviar Xmls?

Encode the whole XML document as Base64 and send it as the Xml string in the JSON request body. The spec defines one document per request.

### What does a 409 response from Enviar Xmls mean?

The spec documents 409 as Conflict - Invalid company: the XML belongs to a company the SIEG account cannot accept. The response body uses the same isSuccess, errorMessage, and statusCode fields, so read errorMessage for the detail.

### What are the rate limits for the SIEG Enviar Xmls 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 Enviar Xmls MCP server?

You don't need an MCP server to give your agent the Enviar Xmls API. Jentic connects it directly from the API Directory: import it, store your SIEG JWT and access key once, and your agent calls the upload operation when it needs it, discovered on demand rather than held in its context.

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

Yes, at the operation level. Because this is a write operation, you might give an upload agent a rule that includes only this upload, and keep it out of the rule for agents that only read or count documents, and every call is logged. The rule cannot restrict which document is uploaded, because the XML travels in the request body.

### How do I upload an XML to SIEG through Jentic?

Search Jentic for 'upload a fiscal XML to SIEG', load the POST `/api/v1/send-xml` operation, and send the Base64-encoded document in Xml. To run it on your own infrastructure, install Jentic One from its GitHub repo.
