Invoice e-mail
Query invoice e-mail
Status, wait or failure reason and what was actually sent, by the emailId from acceptance.
/openapi/v2/empresas/{empresaId}/emails/{emailId}token, timestamp and sign signature headers, see Authentication.Queries an e-mail accepted by Send e-mail. It is the fallback to the webhook: email.sent and email.failed carry the same verdict but require an explicit subscription. An emailId of another company answers 10021020.
Path parameters
empresaId* | string | Company identifier |
emailId* | string | E-mail identifier |
* Required field
null.emailId | string | E-mail identifier |
id | string | Request identifier |
tipoDocumento | string | Document type |
documentoId | string | Document identifier |
numero | int | Document number |
chaveAcesso | string | Access key |
codigoVerificacao | string | Verification code |
templateId | string | Template used |
status | string | E-mail status |
motivoEspera | string | Wait reason |
motivoFalha | string | Failure reason |
destinatarios | array | Effective recipients |
anexos | array | Requested attachments |
assunto | string | Rendered subject |
criadoEm | string | Acceptance time |
enviadoEm | string | Hand-off to the mail service |
atualizadoEm | string | Last update |
The document fields (numero, chaveAcesso, codigoVerificacao) come from the acceptance moment and are refreshed on send; assunto and enviadoEm only exist after sending; motivoEspera only in Aguardando and motivoFalha only in Falha. Enviado and Falha are terminal: from them the same document accepts a new send.
Aguardando: key missing
São Paulo NFS-e whose 50-digit key has not come back yet: chaveAcesso is null, codigoVerificacao already exists, motivoEspera = chaveAcesso. The platform rechecks every 30 seconds for up to 120 minutes; nothing to do on your side.
{"emailId": "2103160000000000002","id": "mail-sp-000045","tipoDocumento": "NFSe","documentoId": "SP-20260928-045","numero": 45,"chaveAcesso": null,"codigoVerificacao": "ABCD1234","templateId": "2103150000000000002","status": "Aguardando","motivoEspera": "chaveAcesso","motivoFalha": null,"destinatarios": ["financeiro@cliente.com.br"],"anexos": ["pdf", "xml"],"assunto": null,"criadoEm": "2026-09-28T12:00:00Z","enviadoEm": null,"atualizadoEm": "2026-09-28T12:03:00Z"}
status* | string | E-mail status |
motivoEspera* | string | Wait reason |
* Required field
Aguardando: PDF or XML missing
You asked for an attachment and the file is not available yet: motivoEspera = pdf when the rendering service is down, xml when the authorized XML is not archived yet. Same 30-second recheck and same 120-minute limit.
{"emailId": "2103160000000000003","id": "email-pedido-8843-1","tipoDocumento": "NFe","documentoId": "pedido-8843","numero": 11770,"chaveAcesso": "35241204893402000113650010000117701017244270","codigoVerificacao": null,"templateId": "2103150000000000001","status": "Aguardando","motivoEspera": "pdf","motivoFalha": null,"destinatarios": ["comprador@exemplo.com"],"anexos": ["pdf"],"assunto": null,"criadoEm": "2026-09-28T12:10:00Z","enviadoEm": null,"atualizadoEm": "2026-09-28T12:10:30Z"}
status* | string | E-mail status |
motivoEspera* | string | Wait reason |
* Required field
Enviado
The mail service accepted the message: assunto carries the final text and enviadoEm the hand-off time. An email.sent arrives with the same data. Delivery into the recipient inbox depends on their provider.
{"emailId": "2103160000000000001","id": "email-pedido-8842-1","tipoDocumento": "NFe","documentoId": "pedido-8842","numero": 11769,"chaveAcesso": "35241204893402000113650010000117691017244265","codigoVerificacao": null,"templateId": "2103150000000000001","status": "Enviado","motivoEspera": null,"motivoFalha": null,"destinatarios": ["comprador@exemplo.com"],"anexos": ["pdf", "xml"],"assunto": "Nota fiscal 11769 - Loja Exemplo LTDA","criadoEm": "2026-09-28T12:00:00Z","enviadoEm": "2026-09-28T12:00:31Z","atualizadoEm": "2026-09-28T12:00:31Z"}
status* | string | E-mail status |
assunto* | string | Rendered subject |
enviadoEm* | string | Hand-off to the mail service |
* Required field
Falha
Terminal. Causes: exhausted wait (motivoFalha names chaveAcesso, pdf or xml), exhausted send attempts, document no longer authorized, template disabled after acceptance or a voucher that cannot be issued. An email.failed arrives with motivo_falha. Fix the cause and resend with a new id.
{"emailId": "2103160000000000002","id": "mail-sp-000045","tipoDocumento": "NFSe","documentoId": "SP-20260928-045","numero": 45,"chaveAcesso": null,"codigoVerificacao": "ABCD1234","templateId": "2103150000000000002","status": "Falha","motivoEspera": null,"motivoFalha": "Tempo esgotado aguardando: chaveAcesso","destinatarios": ["financeiro@cliente.com.br"],"anexos": ["pdf", "xml"],"assunto": null,"criadoEm": "2026-09-28T12:00:00Z","enviadoEm": null,"atualizadoEm": "2026-09-28T14:00:30Z"}
status* | string | E-mail status |
motivoFalha* | string | Failure reason |
* Required field
tipoDocumentoDocument type
| Values | Meaning |
|---|---|
| NFe | NF-e, goods invoice |
| NFSe | NFS-e, service invoice |
| CTe | CT-e, transport document |
| DCe | DC-e, content declaration |
statusE-mail status
| Values | Meaning |
|---|---|
| Aguardando | Accepted, waiting for document data; motivoEspera says what |
| Enfileirado | Queued, data complete, waiting to be sent |
| Enviando | A worker is rendering and sending |
| Enviado | Handed to the mail service; terminal |
| Falha | Final failure; motivoFalha explains; terminal |
motivoEsperaWait reason
Only with status Aguardando; null otherwise.
| Values | Meaning |
|---|---|
| chaveAcesso | The 50-digit key of a São Paulo NFS-e not yet returned by the national environment |
| PDF not generated yet; the rendering service is unavailable right now | |
| xml | Authorized XML not archived yet |
anexos[]Attachments
File name: {tipo}-{chave}.pdf / .xml, for example NFSe-3550...077.xml.
| Values | Meaning |
|---|---|
| PDF voucher: DANFE, DANFSe, DACTE or DACE | |
| xml | Authorized XML, the legal original |
| Code | HTTP | |
|---|---|---|
| 10003000 | 404 | empresaId not found. |
| 10021020 | 404 | E-mail not found or does not belong to this company. Check the emailId and the empresaId. |
