> For the complete documentation index, see [llms.txt](https://api-docs.everreal.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.everreal.co/endpoints/units/units-query.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.everreal.co/~gitbook/mcp).

# Units Query

Get unit list from EverReal

### **Introduction**

The `units` query returns the [units](https://api-docs.everreal.co/key-concepts.md#unit) of your [partner](https://api-docs.everreal.co/key-concepts.md#partner). You can filter by `externalId`, `propertyId`, `ownerId`, `propertyGroupId`, `leasingStatus` and more. Use the paging option to read more items.

### Filter rules

* `companyId` narrows the answer to one [company](https://api-docs.everreal.co/key-concepts.md#company) of your partner. A `companyId` of another partner gives an empty list.
* `includeExternal` needs a `companyId`. Without a `companyId`, `includeExternal` is ignored.
* `companyId`, `propertyId`, `propertyGroupId` and `ownerId` must be [uuids](https://api-docs.everreal.co/key-concepts.md#uuid). Another value answers `BAD_USER_INPUT` with `reporting.api.filter.uuidInvalid`.

To change fields of the unit of a [listing](https://api-docs.everreal.co/key-concepts.md#listing), see [Listing: unit and property fields](https://api-docs.everreal.co/endpoints/listing/listing-unit-and-property-fields.md).

### Unit Query

To query units from EverReal, use the `units` query.

```graphql
type Query {
  units(input: UnitsFilterListPaging): [Unit]
}
```

**Schema**

```graphql
input UnitsFilterListPaging {
  filter: UnitsFilter
  paging: GraphPaging
  sort: GraphSorting
}

input UnitsFilter {
  id: String
  companyId: String
  externalId: String
  propertyGroupId: String
  propertyId: String
  ownerId: String
  """
  Full search in Unit [name, objectId] OR Property [address, name]
  """
  fullSearch: String
    @deprecated(reason: "This will be removed, because 'leasingStatuses' should be used, which provides more flexibility.")
  leasingStatus: String
  """
  Search by multiple leasing statuses at the time
  """
  leasingStatuses: [FILTER_UNITS_LEASING_STATUSES]
  hasListing: Boolean
  updatedAt: IDateRange
  includeExternal: Boolean # needs companyId
}

input GraphPaging {
  skip: Int
  take: Int
}
input GraphSorting {
  fieldName: String
  direction: String
}

type Unit {
  id: String
  objectId: String
  externalId: String
  name: String
  category: String
  type: String
  subtype: String
  leasingStatuses: UnitLeasingStatuses
  leasingStatusCurrentlyLeased: Boolean
  statuses: AllUnitStatuses
  availability: [Availability]
    @deprecated(reason: "A unit can have multiple leasingStatuses, please switch to 'leasingStatusesEnum' property")
  leasingStatusEnum: FILTER_UNITS_LEASING_STATUSES
  leasingStatusesEnum: [FILTER_UNITS_LEASING_STATUSES]
  statusesEnum: [String]
  floorNumber: Float @deprecated('use floorNo instead')
  floorNo: Float
  surface: Float
  livingSurface: Float
  netFloorSurface: Float
  hasMainStorage: Boolean
  rooms: UnitRooms
  owner: Owner
  amenities: Amenities
  descriptions: UnitDescription
  unitResponsibleId: String
  unitResponsible: ResponsibleUser
  surcharges: Float
  currentRent: Float
  targetRent: Float
  availableFrom: DateTime
  onHoldStatus: Boolean
  onHoldReason: UNIT_ON_HOLD_REASON
  property: Property
  financingType: UNIT_FINANCING_TYPE
  createdAt: DateTime
  updatedAt: DateTime
}

type ResponsibleUser {
  id: String
  email: String
  firstName: String
  lastName: String
}

type UnitDescription {
  object: String
  amenities: String
  location: String
  other: String
}

type Amenities {
  amenitiesIncluded: [AMENITIES_INCLUDED]
  hasParking: Boolean
  parking: UnitParkingType
  qualityOfAmenities: QUALITY_OF_AMENITIES
  condition: AMENITIES_CONDITION
  lastRenovationYear: Int
  heatingType: HEATING_TYPE
  mainEnergySource: ENERGY_SOURCE_TYPE
  energyPerformanceCertificateAvailability: ENERGY_PERFORMANCE_CERTIFICATE_AVAILABILITY
  energyCertificateCreationDate: ENERGY_CERTIFICATE_CREATION_DATE
  buildingEnergyRatingType: BUILDING_ENERGY_RATING_TYPE
  thermalCharacteristic: Float
  energyConsumptionContainsWarmWater: Boolean
  energyEfficiencyClass: ENERGY_EFFICIENCY_CLASS
  hasLanCables: YES_NO_BYAPPOINTMENT
  hasAirConditioning: YES_NO_BYAPPOINTMENT
  floorType: COMMERCIAL_UNIT_FLOORTYPE
  goodsLiftLoad: Float
  floorLoad: Float
  supplyType: STORE_SUPPLY_TYPE
  powerSupplyLoad: Float
  craneRunwayLoad: Float
}

type Availability {
  from: DateTime
}

type UnitRooms {
  rooms: Float
  bedrooms: Float
  bathrooms: Float
}

type UnitLeasingStatuses {
  vacant: Boolean
  terminated: Boolean
  futureLeased: Boolean
  currentlyLeased: Boolean
}

enum UNIT_FINANCING_TYPE {
  PRIVATELY_FINANCED
  PUBLICLY_SUBSIDIZED
}

enum FILTER_UNITS_LEASING_STATUSES {
  LEASED
  TERMINATED
  VACANT
  FUTURE_LEASED
  ON_HOLD
}
```

***Example for units query***

{% tabs %}
{% tab title="GraphQL" %}

```graphql
{
  units(
    input: {
      filter: { externalId: "ER-P12-U-22" }
      paging: { skip: 0, take: 20 }
    }
  ) {
    id
    name
    unitResponsible {
      email
      firstName
      lastName
    }
    externalId
    category
    type
    subtype
    currentRent
    amenities {
      amenitiesIncluded
      qualityOfAmenities
      hasParking
      parking {
        type
        quantity
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
