> For the complete documentation index, see [llms.txt](https://ajuda.espiaonfe.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.espiaonfe.com.br/gestao/nf-e/historico/investigar-xml.md).

# Investigar XML NF-e

Aprenda como verificar se a SEFAZ já disponibilizou o XML completo de uma NF-e após a manifestação do destinatário e saiba quando o documento pode ser baixado pelo Espião Cloud.

## Como verificar se a SEFAZ já disponibilizou o XML da NF-e

A funcionalidade Investigar XML permite **verificar se a SEFAZ já disponibilizou o arquivo XML completo de uma NF-e após a manifestação do destinatário**. Nesta página você aprenderá como consultar a disponibilidade do XML e entender quando ele pode ser baixado pelo Espião Cloud.

### 🤔 O que seria Investigar XML?

Este recurso permite verificar se a SEFAZ já disponibilizou os arquivos XML das notas fiscais manifestadas.

{% hint style="info" %}
Ao realizar a consulta na SEFAZ, os arquivos XML das notas manifestadas (Ciência ou Confirmação da Operação) são retornados automaticamente

O recurso **"Investigar XML"** é útil quando uma nota já foi manifestada, mas o arquivo XML correspondente ainda não foi recebido na consulta. Ele permite investigar e recuperar o documento ausente.
{% endhint %}

**Pré-requisitos** \
Antes de utilizar esta funcionalidade, verifique se sua empresa atende aos seguintes critérios: \
✔ Possuir um certificado digital do tipo A1. \
✔ Os documentos a serem consultados devem ter data de **emissão dentro dos últimos 90 dias**. \
✔ A consulta está sujeita ao limite exigido pela SEFAZ: **máximo de 20 XMLs por hora**.

{% hint style="warning" %}
**ATENÇÃO**

A SEFAZ **somente** disponibiliza os arquivos XML das notas fiscais manifestadas como: **Ciência** ou **Confirmação da Operação**.\
\
Se a manifestação do destinatário **ainda não foi realizada acesse:** [Manifest. Destinatário](https://ajuda.espiaonfe.com.br/gestao/nf-e/manifest.-destinatario/certificado-a1.md).
{% endhint %}

### 📃 Para Investigar os XMLs, siga as instruções a seguir

1\. No menu **Histórico**, selecione a opção **NF-e**

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FjM788AE2K7zG9z3sviUd%2Fhistorico-nfe.png?alt=media&amp;token=1ced8d8d-71af-4e42-8d04-5063a4d26e94" alt="" width="221"><figcaption></figcaption></figure></div>

2\. Na aba **“NF-e Histórico”**, selecione a opção desejada entre **“Grupos de empresas”** ou **“Somente a(s) empresa(s)”**. Em seguida, defina o período que deseja visualizar, escolhendo entre **“Mês atual”**, **“Mês passado”** ou, se preferir, clique diretamente no campo de data para selecionar um período personalizado.

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FagwI24kPtYnqxtmJKhQi%2Fpesquisar-documentos-ja-consultados.png?alt=media&amp;token=5e72ebbf-2c63-493e-923b-bd0eee948332" alt="" width="563"><figcaption></figcaption></figure></div>

3. Em seguida, selecione o(s) documento(s) sem arquivo(s) XML(s).

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FeohM5kcUipEmRauCwLCI%2Finvestigar-xml.png?alt=media&amp;token=64976fac-4777-4cfd-9e8e-d219297821a1" alt="" width="563"><figcaption></figcaption></figure></div>

4. Depois clique em **Investigar XML.**

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FeA6Uk00XLXfJ8MwSTEcy%2Finvestigar-xml-nfe.png?alt=media&amp;token=ee213ade-1a3a-43d1-9907-b1dc565ce9b0" alt="" width="563"><figcaption></figcaption></figure></div>

Seguindo esses passos, você poderá verificar e obter os XMLs das notas fiscais manifestadas de forma rápida e segura! 🚀


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.espiaonfe.com.br/gestao/nf-e/historico/investigar-xml.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
