unknown_country

No postal format is published for that country

The country code parses, but the address format table carries no format for it, so there is no layout, no required-field list and no postcode pattern to measure the address against.

appears in
reason
credits
Free. An address that cannot stand as written never costs a credit.

What it means

Spaw measures an address against its own country: which parts that operator requires, how the lines are ordered, and what shape the postcode takes. The table behind that (named `address-formats` in `sources`) covers the countries and territories with a published format; a code outside it — a user-defined code such as `ZZ`, or a territory with no format of its own — leaves nothing to check.

The API endpoints validate `country` against the same table before the lookup runs, so a request naming an unknown country answers `422 VALIDATION_FAILED` instead. This reason is what the lookup itself answers.

What to do

Send the ISO 3166-1 alpha-2 code of the country the post is addressed to. For a territory with no format of its own, use the code of the operator that delivers there.

Example response

{
    "valid": false,
    "reason": "unknown_country",
    "country": "ZZ",
    "country_name": null,
    "postal_code_type": null,
    "risk_score": null
}

Abbreviated: a real answer carries all 33 fields, listed in the validate-phone reference.

Related

markdown version: /docs/reasons/unknown_country.md