---
title: "Get locations (v1)"
method: POST
path: "/api/v1/references/locations"
tags: ["api---references"]
---

# Get locations (v1)

`POST /api/v1/references/locations`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/api/v1/references/locations`
- Auth: HTTP bearer

Returns a list of all possible locations with user restrictions.

## Request body

- ApiGetLocationsV1
  - `name` string: Location name to search.
  - `coordinates` object[]: Limit search to locations within a closed polygon. First and last points must match.
    - `latitude` number, required: Latitude.
    - `longitude` number, required: Longitude.
  - `zip_codes` string[]: List of zip codes to filter by.
  - `lang` string: Language to use for the location names in the response. (When the provided language is not supported, the results will be returned in English.)

## Response `200`

- ApiLocationsV1
  - `locations` object[], required: List of location objects.
    - `location_id` integer, required: ID of the location.
    - `name` string, required: Name of the location.
    - `parent_id` integer, required: ID of the parent level location.
    - `administrative_level` string, required: Location administrative level.
    - `locations_structure` object[], required: Information about all the parent locations, starting from the top-most level - country.
      - `location_id` integer, required: ('Location ID, as returned by the [POST /api/v1/references/locations](/#operation/api__post__v1__references__locations) endpoint.',)
      - `name` string, required: Location name.
      - `administrative_level` string, required: Location administrative level.
      - `zip_codes` string[]: The location zip codes.
      - `level` integer, required: Location level as number.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/casafari/apis/casafari-api.md) · [All operations](https://skmtc.dev/casafari/apis/casafari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/casafari/apis/casafari-api/revisions/6743b99d4bf9?raw)
