---
title: "Matches a string of comma separated postal codes in specified country"
method: POST
path: "/api/v3/targeting/geo/countries/{countryId}/postalcodes/match"
tags: ["Targeting"]
---

# Matches a string of comma separated postal codes in specified country

`POST /api/v3/targeting/geo/countries/{countryId}/postalcodes/match`

## Request

- Base URL: `https://ads.nextdoor.com`
- URL: `https://ads.nextdoor.com/api/v3/targeting/geo/countries/{countryId}/postalcodes/match`
- Auth: HTTP bearer

## Path parameters

- `countryId` string, required

## Request body

- object
  - `postal_codes` string: String of postal codes to match. Allowed separators: newline, comma, or semicolon

## Response `200`

A list of postal codes available for ad group targeting for the specified country and
 a list of invalid postal codes

- object
  - `invalid_postal_codes` string[]: The list of invalid postal codes that did not match any targeting in the specified country
  - `matching_postal_code_ids` string[]: The list of postal code targeting ids that matched the input postal codes.

## Other responses

- `400`: Bad Request. Indicates that the server cannot process the request due to client-side error. For example invalid input.
- `401`: Unauthorized. The API key is invalid and needs to be re-generated.
- `403`: Forbidden. The token passed in has been successfully authenticated, but can’t perform the given action due to not having sufficient permissions.
- `500`: Internal server error.
- `503`: The server is temporarily unable to handle the request due to maintenance or overload.

---

[API](https://skmtc.dev/nextdoor/apis/advertising.md) - [All operations](https://skmtc.dev/nextdoor/apis/advertising/llms.txt) - [OpenAPI document](https://skmtc.dev/nextdoor/apis/advertising/revisions/cdbbecabcffc?raw)
