# POST /v1/addresses/validate

> Index: https://kartpunkt.se/llms.txt

operationId: `validateAddress`. Validate an address.
Tag: `addresses`.

Whether an address a person entered exists as given, with the closest match, what differs in `issues` and other candidates; it is never silently corrected. For autocomplete while the person types, use `POST /v1/geocode`.

## Request

`POST https://api.kartpunkt.se/v1/addresses/validate` with `Authorization: Bearer $KARTPUNKT_API_KEY` and `Content-Type: application/json`, from your backend (never browser code: the key would leak, and CORS is not enabled).

Example body:

```json
{
  "street": "Östra Ågatan",
  "number": 12,
  "letter": "B",
  "postcode": "75797"
}
```

JSON body:

- `street` (string, max 200 chars, required): Street name or address area, e.g. 'Östra Ågatan'. Case and å/ä/ö are ignored.
- `number` (integer 0..99999 | null, optional): House number, e.g. 12.
- `letter` (string, max 2 chars | null, optional): Letter after the number, e.g. 'B'.
- `postcode` (string, max 10 chars | null, optional): Postnummer, e.g. '75331' or '753 31'. Scopes the match; strongly recommended.
- `locality` (string, max 100 chars | null, optional): Postort or kommun, e.g. 'Uppsala'. Scopes the match when postcode is missing.

## Response 200

Example:

```json
{
  "valid": true,
  "match": {
    "id": "se.syn.syn-0000t9b",
    "type": "address",
    "label": "Östra Ågatan 12B, 757 97 Uppsala",
    "street": "Östra Ågatan",
    "number": 12,
    "letter": "B",
    "postcode": "75797",
    "locality": "Uppsala",
    "municipality_code": "0380",
    "municipality": "Uppsala",
    "county_code": "03",
    "county": "Uppsala län",
    "district_code": "903801",
    "district": "Uppsala norra",
    "point": {
      "lat": 59.92238511056452,
      "lon": 17.582745460249157
    },
    "position_type": "entrance",
    "match_type": "exact",
    "score": 1
  },
  "issues": [],
  "suggestions": [],
  "provenance": {
    "synthetic": true,
    "sources": [
      {
        "id": "synthetic",
        "name": "Kartpunkt synthetic test addresses",
        "licence": "CC0-1.0",
        "attribution": "Syntetiska testadresser från Kartpunkt, inte verkliga adresser.",
        "url": "https://creativecommons.org/publicdomain/zero/1.0/",
        "updated": "2026-10-13"
      }
    ]
  }
}
```

- `valid` (boolean): true only if the address exists exactly as given (no issues).
- `match` ([Address](https://api.kartpunkt.se/docs/shapes/Address.md) | null): The closest existing address, or null when the street was not found; on number_not_found, the nearest number on the street. It is never silently corrected: compare it with the input.
- `issues` (array of "street_not_found" | "number_not_found" | "letter_not_found" | "postcode_mismatch" | "locality_mismatch" | "ambiguous"): What is wrong with the input; empty when valid.
- `suggestions` (array of [Address](https://api.kartpunkt.se/docs/shapes/Address.md)): Other candidates: on street_not_found, search hits for the input; on number_not_found, the nearest house numbers on the street. Otherwise empty.
- `provenance` ([Provenance](https://api.kartpunkt.se/docs/shapes/Provenance.md))

## Errors

Every error is `{ error, message, param?, doc_url }`; `message` says what to do next. All codes: [https://api.kartpunkt.se/errors](https://api.kartpunkt.se/errors). What to do on each, with retries: [https://api.kartpunkt.se/docs/recipes/errors-and-retries.md](https://api.kartpunkt.se/docs/recipes/errors-and-retries.md).

- [`invalid_request`](https://api.kartpunkt.se/errors/invalid_request) (400): The request does not match the API schema. Fix the fields named in this message; see /openapi.json.
- [`unauthorized`](https://api.kartpunkt.se/errors/unauthorized) (401): Missing or unknown API key. Send it as 'Authorization: Bearer <key>' (or 'x-api-key'), read from the KARTPUNKT_API_KEY environment variable. The user creates a kp_test_ key on their Kartpunkt account page (https://kartpunkt.se/konto) and puts it in KARTPUNKT_API_KEY themselves; never ask them to paste a key into chat.
- [`live_access_required`](https://api.kartpunkt.se/errors/live_access_required) (403): This account is not approved for live data: kp_live_ keys are for customers under contract. Use a kp_test_ key. To ask for live access, the account holder writes to hej@kartpunkt.se, or orders a plan at https://kartpunkt.se/konto#plan.
- [`use_not_permitted`](https://api.kartpunkt.se/errors/use_not_permitted) (403): This operation would use a data source in a way its licence or approval does not allow (see GET /v1/sources). It cannot be answered for this key.
- [`quota_exceeded`](https://api.kartpunkt.se/errors/quota_exceeded) (429): Request limit or plan quota reached (per minute, per day, or the account plan's monthly quota). Wait the number of seconds in the Retry-After header, then retry; without Retry-After, no wait helps: tell the account holder what this message says.
- [`internal_error`](https://api.kartpunkt.se/errors/internal_error) (500): Something failed on our side. Retry after a few seconds; if it keeps failing, contact hej@kartpunkt.se.
- [`live_data_unavailable`](https://api.kartpunkt.se/errors/live_data_unavailable) (503): Live data is not available yet: it opens when Kartpunkt's import of Lantmäteriet's address register completes. Use a kp_test_ key until then.

## Limits

| Limit | Synchronous |
| --- | --- |
| `number` (at most) | 99999 |
| Request body | 1 MB |

## Metering

With a `kp_live_` key, one live call per request; each address in the answer counts toward the plan's daily address limit.
