---
title: "Verify account against the AEAT census"
method: POST
path: "/companies/{company}/census-verification"
tags: ["Account"]
---

# Verify account against the AEAT census

`POST /companies/{company}/census-verification`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/census-verification`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Check the persisted company name + tax ID pair against the AEAT census (VNifV2) to anticipate VeriFactu 4104 rejections.
- No request body; it always verifies the persisted fiscal data.
- Fail-open: if AEAT is unreachable it returns 200 with `status: unavailable`.
- Test keys (`fact_test_`) return deterministic statuses per magic NIF without contacting AEAT.

## Path parameters

- `company` string, uuid, required

## Headers

- `Idempotency-Key` string, required
- `Factuarea-Version` string, date

## Response `200`

- object
  - `data` CensusVerification, required: Result of verifying the account's persisted company name + tax ID pair against the AEAT census (VNifV2). Use it to anticipate VeriFactu 4104 rejections before invoicing. Fail-open: returns `unavailable` when AEAT cannot be reached.
    - `object` 'census_verification', required: Stripe-like discriminator. Always `census_verification` for this resource.
    - `status` 'identified' | 'not_identified' | 'not_identified_similar' | 'identified_inactive' | 'identified_revoked' | 'unavailable', required: Census result. `identified`: name + tax ID match an active taxpayer. `not_identified`: the pair is not in the census. `not_identified_similar`: a similar individual exists (natural persons only). `identified_inactive` / `identified_revoked`: the taxpayer is deregistered or revoked. `unavailable`: AEAT could not answer (timeout, fault, no platform certificate) — verification is informational and never blocks.
    - `verified_name` string, nullable, required: The company name that was checked against the census (the persisted account name). `null` when the account has never been verified.
    - `checked_at` string, date-time, nullable, required: ISO 8601 timestamp of the last verification. `null` when never verified.

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company. `profile_not_found`: the company in the path does not exist, is not in the API key scope or belongs to the other environment (live or test).
- `422`: Validation failed — e.g. the API key plan limit was reached, or an invoice language outside the allowed catalog (`es`, `en`, `ca`). The `error.param` field identifies which input is invalid, if any.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
