> For the complete documentation index, see [llms.txt](https://integracao.gitbook.io/invoisys/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integracao.gitbook.io/invoisys/endpoints/recebimento-notas/ct-e/api-entrada-de-nf-e-por-xml-1.md).

# Importar de anexo

### Endpoint

<mark style="color:green;">`POST`</mark> `https://sandbox-api.invoisys.io/v1/cte-entrada/anexar`

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Accept        | string | `application/jso​n​` |
| Authorization | string | `bearer <valor>`     |

#### Request Body

| Name     | Type    | Description                                                                                                     |
| -------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| ambiente | integer | <p>Ambiente de importação do XML<br><code>ENUM: 1 - Produção; 2 - Homologação</code><br><code>TAM: 1</code></p> |
| idNFe    | string  | ID invoiSys do CT-e                                                                                             |
| fileName | string  | Nome do arquivo a ser anexado                                                                                   |
| base64   | string  | Base64 do conteúdo que sera anexado                                                                             |

#### Response

{% tabs %}
{% tab title="200 - Sucesso" %}

```csharp
{
  "idArquivo": "356553325169831937",
  "mensagem": "Anexo inserido com sucesso."
}
```

{% endtab %}

{% tab title="201 - Sobrescrita" %}

```csharp
{
  "idArquivo": "356553325169831937",
  "mensagem": "Anexo sobrescrito com sucesso."
}
```

{% endtab %}

{% tab title="400 - Base64 inválido" %}

```csharp
{
  "idArquivo": "",
  "mensagem": "Base64 inválido."
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### Swagger

[Você pode acessar nossa API e realizar testes diretamente na nossa plataforma Swagger!](https://sandbox-api.invoisys.io/swagger/index.html)
{% endhint %}

## APIs Relacionadas 🎈

* [Consultar CT-es via NSUi](/invoisys/endpoints/recebimento-notas/ct-e/api-entrada-de-nf-e-xml-resumido-obtido.md)

## Referências à API 📌

* Passo-a-Passo do Recebimento CT-e
* Fluxograma - Recebimento CT-e
