# List Locations

Retrieves a list of the locations configured for a practice group on Hero Health.

Endpoint: GET /v1/locations
Version: 1.0.0
Security: apiKeyAuth, practiceGroupId

## Security:

  - `apiKeyAuth` (unknown)
    apiKey in header x-api-key

  - `practiceGroupId` (unknown)
    apiKey in header x-practice-group-id

## Query parameters:

  - `appointment_type_ids` (array)

  - `has_availability` (boolean)

  - `search` (string)
    Case-insensitive partial match on the location's `name` or its `partner_site_name`, so a location can be found by either the name patients see or the site name it carries in the partner system.

  - `include[]` (array)
    Opts additional sets of locations into the response. Repeatable and combinable. By default only active locations are returned; `include[]=archived` adds archived locations, identifiable by a non-null `archived_at`.

  - `order_by` (string)
    Field to sort by. `name` sorts alphabetically, ignoring case; `slot_count` sorts by the number of available slots. Defaults to the practice group's configured location order.

  - `order_descending` (string)
    Sort direction. To list the locations with the most availability first, use `order_by=slot_count&order_descending=true`.

## Response 200:

  - `200` (unknown)
    Ok

## Response 200 fields (application/json):

  - `data` (array, required)

  - `data.id` (string, required)

  - `data.name` (string, required)

  - `data.partner_site_name` (string, required)

  - `data.about` (string, required)

  - `data.email` (string, required)

  - `data.phone_number` (string, required)

  - `data.map_url` (string, required)

  - `data.latitude` (string, required)

  - `data.longitude` (string, required)

  - `data.no_availability_text` (string, required)

  - `data.address` (object, required)

  - `data.address.line_1` (string, required)

  - `data.address.line_2` (string, required)

  - `data.address.line_3` (string, required)

  - `data.address.town` (string, required)

  - `data.address.county` (string, required)

  - `data.address.postcode` (string, required)

  - `data.archived_at` (string, required)

  - `data.created_at` (string, required)

  - `data.updated_at` (string, required)

  - `data.slot_count` (number, required)

  - `data.next_available_at` (string, required)

  - `count` (number, required)

## Response 400:

  - `400` (unknown)
    Validation error

## Response 400 fields (application/json):

  - `error` (boolean, required)
    Example: true

  - `statusCode` (number, required)
    Example: 400

  - `message` (array, required)

  - `message.code` (string, required)
    Example: invalid_type

  - `message.expected` (string, required)
    Example: string

  - `message.path` (array, required)
    Example: ["patient_id"]

  - `message.message` (string, required)
    Example: Required

## Response 401:

  - `401` (unknown)
    Unauthorised

## Response 404:

  - `404` (unknown)
    Not found

## Response 429:

  - `429` (unknown)
    Too Many Requests

## Response 500:

  - `500` (unknown)
    Unknown error

