---
title: "Fits a street address into a country-specific maximum length."
method: POST
path: "/v1/address-fit"
tags: ["Address Fit"]
---

# Fits a street address into a country-specific maximum length.

`POST /v1/address-fit`

## Request

- Base URL: `https://api.cloud.precisely.com`
- URL: `https://api.cloud.precisely.com/v1/address-fit`
- Auth: one of:
  - HTTP bearer
  - API key in header `Authorization`

Fits a single street address line into the requested maximum length for the given
country. The street is progressively abbreviated using country-specific abbreviation
rules (e.g. "Street" -> "St", "Apartment" -> "Apt") until it fits, or until no further
abbreviation is possible.

The `result.status` field indicates the outcome:
- `OK` — the processed street fits within `maxLength`. `warnings` is omitted.
- `WARN` — the street could not be shortened enough to fit within `maxLength`, so the
  best-effort abbreviated street is returned along with a non-empty `warnings` list.

If the request itself is invalid (missing/blank street, unsupported or unrecognised
countryCode, out-of-range maxLength, malformed JSON, etc.) no `result` is returned;
instead a 4xx/5xx response with a non-empty `errors` list is returned. See the Error
Codes table above for the full list.

## Headers

- `X-Request-Id` string

## Request body

- AddressFitRequest: Address Fit request: a single street address line to fit into a country-specific maximum length.
  - `street` string, required: The street address line to fit. Must be non-blank and at most 500 characters.
  - `countryCode` string, required: Country code identifying which country-specific abbreviation rules to apply. Must resolve to a valid ISO 3166-1 alpha-3 code (e.g. "GBR", "USA"); values that cannot be resolved to a supported alpha-3 code, or that resolve to a country not yet supported by this API, are rejected (see DIS-LI-1016 in the Error Codes table above).
  - `maxLength` integer: Maximum allowed length (in characters) for the processed street. If omitted, the country's default maximum length is used.

## Response `200`

Street address fitted successfully (see result.status for OK/WARN)

- AddressFitResponse: Address Fit response envelope.
  - `response` AddressFitResponseAddressFitResponseBody: Outcome status and the fitted address result.
    - `status` 'OK' | 'WARN': `OK` if the processed street fits within maxLength; `WARN` if it could not be shortened enough and the best-effort result is returned with warnings.
    - `result` AddressFitResult: The result of fitting a single street address into the requested country-specific maximum length.
      - `countryCode` string: ISO 3166-1 alpha-3 country code the street was fitted for.
      - `maxLength` integer: The maximum length that was applied (either the requested value, or the country's default if none was requested).
      - `originalStreet` string: The original, unmodified street address line as submitted in the request.
      - `processedStreet` string: The abbreviated street address line, after applying country-specific abbreviation rules.
      - `originalLength` integer: Character length of originalStreet.
      - `finalLength` integer: Character length of processedStreet.
      - `warnings` string[]: Present only when status is WARN: explains why processedStreet still exceeds maxLength. Omitted entirely (not an empty array) when status is OK.

## Other responses

- `400`: Invalid request for Address Fit API
- `401`: Unauthorized: Invalid token for Address Fit API
- `403`: Forbidden for Address Fit API
- `429`: Too many requests for Address Fit API
- `500`: Internal server error for Address Fit API

---

[API](https://skmtc.dev/precisely/apis/address-fit-api.md) · [All operations](https://skmtc.dev/precisely/apis/address-fit-api/llms.txt) · [OpenAPI document](https://skmtc.dev/precisely/apis/address-fit-api/revisions/e6b323b64f92?raw)
