> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.travtus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Properties

> This endpoint finds units with the list of body attributes passed to it.

You need to provide exact matches in the body of the request for the attributes of the units you are looking for.

You can provide either a list of group ids through the `group_ids` parameter or a list of group external references through the `groups_external_refs` attribute to filter the list of retrieved units down.

Do not provide both, as this will result in the request failing.

If no group\_ids or group\_external\_refs are specified in the request body, the authenticated user will retrieve unit records for all groups they have access to.

### Header

<ParamField header="Authorization" type="string" default="none" required>
  The authentication token for your request.
</ParamField>

### Body

<ParamField body="group_ids" type="[string]" default="none">
  The list of group ids for filtering the retrieved list.
</ParamField>

<ParamField body="groups_external_refs" type="[string]" default="none">
  The list of group external references for filtering the retrieved list.
</ParamField>

<ParamField body="external_ref" type="string" default="none">
  An external reference for the unit you want to find.

  This is typically an identifier you may use for unit records in your own system.
</ParamField>

<ParamField body="identifier" type="string" default="none">
  The internal reference for the units you want to find.
</ParamField>

<ParamField body="has_flex_wall" type="boolean" default="none">
  Whether the units you want to retrieve are flex apartments or not.
</ParamField>

<ParamField body="number_of_bathrooms" type="integer" default="none">
  The number of bathrooms the units you want to find have.
</ParamField>

<ParamField body="number_of_bedrooms" type="integer" default="none">
  The number of bedrooms the units you want to find have.
</ParamField>

<ParamField body="sqft" type="integer" default="none">
  The square feet surface for the units you want to find.
</ParamField>

<ParamField body="unit_number" type="string" default="none">
  The number of the units you want to find.
</ParamField>

<ParamField body="address" type="object" default="none">
  Address information for the units you want to find.

  <Expandable tilte="address">
    <ParamField body="building_name" type="string">
      The name of the building for the unit you want to find.
    </ParamField>

    <ParamField body="address_line_1" type="string">
      The first line of the address for the unit you want to find.
    </ParamField>

    <ParamField body="address_line_2" type="string">
      The second line of the address for the unit you want to find.
    </ParamField>

    <ParamField body="city" type="string">
      The address' city for the unit you want to find.
    </ParamField>

    <ParamField body="country" type="string">
      The address' country for the unit you want to find.
    </ParamField>

    <ParamField body="state" type="string">
      The address' state for the unit you want to find.
    </ParamField>

    <ParamField body="postal_code" type="string">
      The address' postal code for the unit you want to find.
    </ParamField>

    <ParamField body="latitude" type="float">
      The address' latitude for the unit you want to find.
    </ParamField>

    <ParamField body="longitude" type="float">
      The address' longitude for the unit you want to find.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="after-id" type="string" default="1">
  The API returns a maximum of 100 records per call.

  You can use this parameter to load the next set of records by passing in the value returned in the response, under `last_id`.
</ParamField>

### Response

<ResponseField name="last_id" type="integer">
  The last id in the set of results returned for this API call.

  You can use this value in the `after-id` parameter to load the next set of results.

  If there are no more results to load, this value will be -1.
</ResponseField>

<ResponseField name="units" type="[object]">
  The list of units retrieved by the endpoint

  <Expandable title="unit">
    <ResponseField name="identifier" type="string">
      The internal identifier for the retrieved unit.
    </ResponseField>

    <ResponseField name="external_ref" type="string">
      The external reference for the retrieved unit.
    </ResponseField>

    <ResponseField name="unit_number" type="string">
      The number of the retrieved unit.
    </ResponseField>

    <ResponseField name="is_flex" type="boolean">
      True if the retrieved unit is a flex apartment, false if it is not.
    </ResponseField>

    <ResponseField name="full_bathrooms" type="integer">
      The number of full bathrooms for the retrieved unit.
    </ResponseField>

    <ResponseField name="half_bathrooms" type="integer">
      The number of half bathrooms for the retrieved unit.
    </ResponseField>

    <ResponseField name="number_of_bedrooms" type="integer">
      The number of bedrooms for the retrieved unit.
    </ResponseField>

    <ResponseField name="sqft" type="integer">
      The square feet surface for the retrieved unit.
    </ResponseField>

    <ResponseField name="address" type="object">
      The unit's address.

      <Expandable title="address">
        <ResponseField name="building_name" type="string">
          The name of the building.
        </ResponseField>

        <ResponseField name="address_line_1" type="string" required>
          The first line of the unit's address.
        </ResponseField>

        <ResponseField name="address_line_2" type="string">
          The second line of the unit's address.
        </ResponseField>

        <ResponseField name="city" type="string">
          The city of the unit's address.
        </ResponseField>

        <ResponseField name="country" type="string">
          The country in which the unit's address is located.
        </ResponseField>

        <ResponseField name="state" type="string" required>
          The state in which the unit's address is located.
        </ResponseField>

        <ResponseField name="postal_code" type="string" required>
          The postal code for the unit's address.
        </ResponseField>

        <ResponseField name="latitude" type="string">
          The latitude of the unit's address.
        </ResponseField>

        <ResponseField name="longitude" type="string">
          The longitude of the unit's address.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Errors

Listed below are common errors that may be returned by the endpoint, along with their corresponding status code.

Status Code - 400

```json Missing Authorization header theme={null}
{
   "error": {
    "type": "missing_authorization",
    "message": "Your request does not include an 'Authorization' header with a bearer token for your account."
  }
}
```

Status Code - 401

```json Expired Authorization header bearer token value theme={null}
{
   "error": {
    "type": "expired_token",
    "message": "The bearer token you have provided in the 'Authorization' header has expired. Please obtain a new one."
  }
}
```

Status Code - 401

```json Invalid Authorization header bearer token value theme={null}
{
   "error": {
    "type": "invalid_authorization",
    "message": "The bearer token you have provided in the 'Authorization' header is invalid."
  }
}
```

Status Code - 400

Returned if both of the group\_ids and groups\_external\_refs attributes are provided

```json Both group ids and external refs provided for the unit find operation theme={null}
{
   "error": {
    "type": "both_group_identifiers_provided",
    "message": "You have provided both group ids and group external references for the find units operation. Please only provide one of the two."
  }
}
```

Status Code - 404

Returned if no unit records can be found matching the provided information.

```json No unit records found for the provided parameters theme={null}
{
   "error": {
    "type": "not_found",
    "message": "There are no unit records matching the information provided."
  }
}

```

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.travtus.com/units/find/' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <token>' \
  --data-raw '{
    "address": {
      "country": "United States"
    },
    "group_ids": ["group-1"],
    "after-id": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "last_id": 5,
    "units": [
      {
        "identifier": "internal-unit-id-1",
        "unit_number": "1",
        "is_flex": false,
        "full_bathrooms": 1,
        "half_bathrooms": 1,
        "number_of_bedrooms": 2,
        "sqft": 40,
        "address": {
          "building_name": "Building 1",
          "address_line_1": "Blvd Street",
          "address_line_2": "Appartment 12",
          "city": "New York",
          "country": "United States",
          "state": "New York",
          "postal_code": "10001",
          "latitude": 40.730610,
          "longitude": -73.935242
      },
      {
        "identifier": "internal-unit-id-2",
        "unit_number": "2",
        "is_flex": false,
        "full_bathrooms": 1,
        "half_bathrooms": 0,
        "number_of_bedrooms": 1,
        "sqft": 30,
        "address": {
          "building_name": "Building 1",
          "address_line_1": "Blvd Street",
          "address_line_2": "Appartment 10",
          "city": "New York",
          "country": "United States",
          "state": "New York",
          "postal_code": "10001",
          "latitude": 40.730610,
          "longitude": -73.935242
        }
      },
    ]
  }
  ```
</ResponseExample>
