---
title: "/locations/findOrCreate"
method: POST
path: "/locations/findOrCreate"
---

# /locations/findOrCreate

`POST /locations/findOrCreate`

## Request

- Base URL: `https://api.securevan.com/v4`
- URL: `https://api.securevan.com/v4/locations/findOrCreate`
- Auth: HTTP basic

Similar to the [POST /people/findOrCreate](ref:people#peoplefindorcreate) endpoint, this endpoint searches for the given Location. If a Location is found, the existing Location is returned. If a Location is not found, a new Location is created.

This endpoint is useful when synchronizing from a system that does not uniquely identify locations.

This endpoint parses the address provided, and uses the following criteria to find existing locations in US contexts:

* If a `name` is provided and a ZIP5 can be determined (either provided or discovered based on `city` and `stateOrProvince`), and no Street Name can be parsed, a match will be attempted based on `name` and ZIP5
* Then, if a `name` is provided and a ZIP5 cannot be determined and no Street Name can be parsed, a match will be attempted based on `name`, `city`, and `stateOrProvince`
* Then, if a Street Name can be parsed and a ZIP5 can be determined (either provided or discovered based on `city` and `stateOrProvince`), a match will be attempted based on Street Number, Street Name, Apartment Number, and ZIP5

Non-US contexts match on exact name and parsed address.

If successful, the endpoint responds with HTTP Status Code `201 Created` (even if it matched and updated an existing Location). It also sets the **Location** header to the [location](ref:locationslocationid) of the Location.

## Request body

- object
  - `name` string
  - `address` object
    - `addressLine1` string
    - `city` string
    - `stateOrProvince` string
    - `zipOrPostalCode` string

## Response `201`

201

## Other responses

- `400`: 400

## Changes

- **2026-11-03** `4f2049fba5af`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ngpvan/apis/van-crm/changes/locations/findOrCreate/post.md)

---

[API](https://skmtc.dev/ngpvan/apis/van-crm.md) - [All operations](https://skmtc.dev/ngpvan/apis/van-crm/llms.txt) - [OpenAPI document](https://skmtc.dev/ngpvan/apis/van-crm/revisions/4f2049fba5af?raw)
