---
title: "Auto-create a client from VIES registry data"
method: POST
path: "/api/clients/auto-from-nif"
tags: ["Clients - Protected"]
---

# Auto-create a client from VIES registry data

`POST /api/clients/auto-from-nif`

Create the client for a NIF using its VIES-registered name/address, when
it doesn't exist yet in the company (invoice-insertion auto-create). The
client is created with no email/contacto — allowed, since both are optional.
Always returns 200 with a structured outcome; the FE branches on
created/exists/reason. Plain `def` — it does DB work in the threadpool.

## Headers

- `x-api-token` string, nullable

## Request body

- AutoFromNifRequest — Auto-create-from-NIF request body.
  - `nif` string, required

## Response `200`

Successful Response

- AutoFromNifResponse — Auto-create-from-NIF structured outcome (always HTTP 200).
  - `created` boolean, required
  - `exists` boolean
  - `client_id` integer, nullable
  - `nome` string, nullable
  - `reason` 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/4b44eb76b3ee/schema)
