> 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/distritos/create.md).

# Create

## Criar Distrito

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

#### Request Body

| Name                                          | Type                                                                      | Description                                                                                                                                                                                                                                                                    |
| --------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| code<mark style="color:red;">\*</mark>        | <p>string<br><sub><mark style="color:$info;">Valor Único</mark></sub></p> | Código                                                                                                                                                                                                                                                                         |
| description<mark style="color:red;">\*</mark> | string                                                                    | Descrição                                                                                                                                                                                                                                                                      |
| country\_id                                   | integer                                                                   | <p>País</p><p><br>Consulte a tabela <a href="/pages/zDxRAoofNg5nAbyoGGBy">Países</a> para saber mais.</p>                                                                                                                                                                      |
| territory\_id                                 | integer                                                                   | <p>Território</p><p></p><p>Consulte a tabela <a href="/pages/Le16rQ3NG33zktn1PTI4#territorios-campo-territory">Apêndice</a> para saber mais.</p><p></p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Aplicável apenas se o País for Portugal.</p> |

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

```shell
curl -X POST https://api.cloudinvoice.net/districts/new/
    -d '{
        "code": "D1",
        "description": "Distrito #1"
    }'
```

{% endtab %}

{% tab title="Exemplo de Resposta" %}

```json
{
    "id": 30,
    "code": "D1",
    "description": "Distrito #1",
    "country_id": 1,
    "country": {
        "code": "PT",
        "country_name": "Portugal"
    },
    "territory_id": 101,
    "territory": {
        "code": "CO",
        "description": "Continente"
    }
}
```

{% endtab %}
{% endtabs %}

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