---
title: "Create client"
method: POST
path: "/api/clients"
tags: ["Clients - Protected"]
---

# Create client

`POST /api/clients`

Create a new client with proper data separation.

This endpoint follows the correct client creation pattern:
1. Client basic info goes to Cliente table (nome, nif, contacto, etc.)
2. Email goes to Emails table (id_modulo=12, id_modulo_id=client_id)
3. Address goes to Moradas table (id_modulo=12, id_modulo_id=client_id)

Automatically assigns the client to the authenticated user's company.
Validates NIF uniqueness within the company.

## Headers

- `x-api-token` string, nullable

## Request body

- ClientCreate — Client creation request.
  - `nome` string, required
  - `email` string, nullable
  - `contacto` string, nullable
  - `nif` integer, nullable — Tax ID (unique per company)
  - `cc` string, nullable — ID card number
  - `validade_cc` string, date, nullable — ID card validity
  - `entidade_emissora_cc` string, nullable
  - `particular` boolean — True=Individual, False=Company
  - `recorrente` boolean — Is recurring client
  - `carta_conducao` string, nullable
  - `data_carta_conducao` string, date, nullable
  - `iban` string, nullable
  - `iban_alimentar` string, nullable
  - `pais` string, nullable
  - `morada` string, nullable
  - `codigo_postal` string, nullable
  - `localidade` string, nullable
  - `cidade` string, nullable
  - `id_pontodevenda` integer, nullable
  - `id_estado_civil` integer, nullable
  - `id_tipo_casa` integer, nullable
  - `id_contrato_trabalho` integer, nullable
  - `tipo_id` integer, nullable
  - `agregado_familiar` integer, nullable
  - `creditos_ativos` integer, nullable
  - `mensalidade_casa` number, nullable
  - `antiguidade_empresa` integer, nullable
  - `mensalidade_creditos` number, nullable
  - `vencimento_liquido` number, nullable
  - `foreign_nif` string, nullable — Foreign tax ID

## Response `201`

Successful Response

- ClientResponse — Client response with ID and addresses.
  - `id` integer, required
  - `nome` string, required
  - `email` string, nullable
  - `contacto` string, nullable
  - `nif` integer, nullable
  - `cc` string, nullable
  - `validade_cc` string, date, nullable
  - `entidade_emissora_cc` string, nullable
  - `particular` boolean
  - `recorrente` boolean
  - `carta_conducao` string, nullable
  - `data_carta_conducao` string, date, nullable
  - `iban` string, nullable
  - `iban_alimentar` string, nullable
  - `pais` string, nullable
  - `morada` string, nullable
  - `codigo_postal` string, nullable
  - `localidade` string, nullable
  - `cidade` string, nullable
  - `idcompany` integer, nullable
  - `id_pontodevenda` integer, nullable
  - `id_estado_civil` integer, nullable
  - `id_tipo_casa` integer, nullable
  - `id_contrato_trabalho` integer, nullable
  - `tipo_id` integer, nullable
  - `agregado_familiar` integer, nullable
  - `creditos_ativos` integer, nullable
  - `mensalidade_casa` number, nullable
  - `antiguidade_empresa` integer, nullable
  - `mensalidade_creditos` number, nullable
  - `vencimento_liquido` number, nullable
  - `foreign_nif` string, nullable
  - `addresses` AddressResponse[]
    - `id` integer, required
    - `morada` string, nullable
    - `codigo_postal` string, nullable
    - `localidade` string, nullable
    - `cidade` string, nullable
    - `pais` string, nullable
    - `principal` boolean
  - `ID` integer, nullable
  - `Nome` string, nullable
  - `NIF` integer, nullable
  - `Contacto` string, nullable
  - `CC` string, nullable
  - `ValidadeCC` string, nullable
  - `EntidadeEmissoraCC` string, nullable
  - `CartaConducao` string, nullable
  - `DataCartaConducao` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/multigest/multigest-protected-api/revisions/8492136eefc5/schema)
