> For the complete documentation index, see [llms.txt](https://apidocs.cloudinvoice.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.cloudinvoice.net/documentacao-api/relatorios/csv/create.md).

# Create

Gera um relatório com os parâmetros indicados.

## Gerar Relatório

<mark style="color:green;">`POST`</mark> `https://api.cloudinvoice.net/reports/csv/:code/new/`

#### Path Parameters

| Name                                   | Type   | Description                                                                                                                                       |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| code<mark style="color:red;">\*</mark> | string | <p>Código do Relatório<br><br>Poderá consultar a lista de Relatórios disponíveis <a href="/documentacao-api/relatorios/csv/list.md">aqui</a>.</p> |

#### Request Body

{% hint style="warning" %}
Os valores de input são variáveis, consoante o código do relatório pedido.\
Fazer um pedido ao endpoint pretendido em **`GET`** fornece instruções dos campos e valores que poderá utilizar em cada caso.
{% endhint %}

{% tabs %}
{% tab title="Exemplo de Pedido" %}

```shell
curl -X POST https://api.cloudinvoice.net/reports/csv/monthly_invoicing_totals/new/
    -d '{
        "year": "2026"
    }'
```

{% endtab %}

{% tab title="\[GET] Ex. de Resposta" %}

```json
{
    "id": 200102,
    "code": "monthly_invoicing_totals",
    "title": "Facturação Mensal",
    "report_title": "Relatorio De Faturação Mensal",
    "fields": {
        "location_id": {
            "label": "Localização",
            "help_text": "",
            "required": false,
            "disabled": false,
            "initial": null,
            "choices": [
                {
                    "value": 1,
                    "text": "Localização 1"
                }
            ]
        },
        "year": {
            "label": "Ano",
            "help_text": "",
            "required": true,
            "disabled": false,
            "initial": "2026",
            "choices": [
                {
                    "value": 2024,
                    "text": "2024"
                },
                {
                    "value": 2025,
                    "text": "2025"
                },
                {
                    "value": 2026,
                    "text": "2026"
                }
            ]
        },
        "document_serie_id": {
            "label": "Série de Documentos",
            "help_text": "",
            "required": false,
            "disabled": false,
            "initial": null,
            "choices": [
                {
                    "value": 1,
                    "text": "A01 - Série A01"
                }
            ]
        }
    }
}
```

{% endtab %}

{% tab title="\[POST] Ex. de Resposta" %}

```json
{
    "download": "https://www.cloudinvoice.net/downloads/37a8e9b9-3238-4294-82ce-17c61ab52b08/download_file/?retrieve=true"
}
```

{% endtab %}
{% endtabs %}

Para ver exemplos de pedidos nas várias linguagens, consulte a página[ Exemplos de Pedidos.](/introducao/exemplos-de-pedidos.md)
