Skip to content

Validate Postal Codes

Request

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.

Security
Auth0(Required scopes: offline_accessmanage:services)
Bodymultipart/form-datarequired
Any of:
filestring, (binary)

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

contentstring

Raw CSV or newline-separated postal codes. Used only when file is not provided.

curl -i -X POST \
  https://api.mediamath.com/api/v3.0/validate_postal_codes \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F file=string \
  -F content=string

Responses

All postal codes are valid.

Bodyapplication/json
statusobjectrequired
Response
{ "status": { "code": "ok" } }