# Validate Postal Codes

Validates a list of postal codes.
Input is `multipart/form-data` using either:
- `file`: an uploaded CSV or newline-separated file of postal codes.
- `content`: raw CSV or newline-separated text in the request body.

If both are provided, `file` takes precedence and `content` is ignored.
Duplicate codes are deduplicated before validation.
Returns HTTP 200 when all codes are valid, HTTP 400 if any are invalid or
the request is malformed, HTTP 415 if the content-type is not multipart/form-data.
Invalid entries include the line number, character position, original value,
and normalized form to aid correction.

Endpoint: POST /validate_postal_codes
Version: 3.0.1807
Security: Auth0

## Security:

  - `Auth0` (unknown)
    oauth2 scopes: offline_access, manage:services

## Request fields (multipart/form-data):

  - `file` (string)
    CSV or newline-separated file of postal codes. Takes precedence over `content` if both are provided.

  - `content` (string)
    Raw CSV or newline-separated postal codes. Used only when `file` is not provided.

## Response 200:

  - `200` (unknown)
    All postal codes are valid.

## Response 200 fields (application/json):

  - `status` (object, required)

  - `status.code` (string, required)
    Example: ok

## Response 400:

  - `400` (unknown)
    One or more postal codes are invalid, or the request itself is malformed.
Two response shapes are possible:
- `validate_postal_codes_error`: returned when codes are submitted but fail validation.
- `error_response`: returned for input errors (missing file/content, wrong content-type, etc.).

## Response 400 fields (application/json):

  - `status` (object, required)

  - `status.code` (string, required)
    Example: invalid

  - `status.content` (string, required)
    Example: Validation Errors

  - `errors` (array, required)

  - `errors.field-error` (array)

  - `errors.field-error.code` (string, required)
    Example: FIELD_INVALID

  - `errors.field-error.error` (string, required)
    Example: line 1, position 7 : Invalid or unknown target value '99999'.

  - `errors.field-error.normalized` (string, required)
    Example: us99999

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 401:

  - `401` (unknown)
    Error response

## Response 401 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 403:

  - `403` (unknown)
    Error response

## Response 403 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 415:

  - `415` (unknown)
    Error response

## Response 415 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

