---
title: "A building's units"
method: GET
path: "/buildings/{building_id}/units"
tags: ["Buildings"]
---

# A building's units

`GET /buildings/{building_id}/units`

## Request

- Base URL: `https://api.baseray.ai/v1`
- URL: `https://api.baseray.ai/v1/buildings/{building_id}/units`
- Auth: HTTP bearer

The units a building's record lists (flats, shops, parking spaces, storage), each with its number, name or door, its floor as the record words it and as a kind and number, and its entrance, kind, use, area, rooms and cadastral number where the record states them. `unit` finds units by their number or name ("275" finds 275, "Ap. 275" and "Parcare 275", never 1275); without it the list comes a page at a time. `meta.list_is_complete` is false when the record states a total that differs from its list: a unit missing from the list may then still exist. A building with no units listed has unknown units, never none. Costs what opening the building costs: free once opened.

## Path parameters

- `building_id` string, uuid, required

## Query parameters

- `unit` string
- `limit` integer
- `offset` integer

## Response `200`

OK

- BuildingUnitPage: One page of the units a building's record lists.
  - `data` BuildingUnit[], required: The page of matched units, by number, then by name.
    - `designation` string, nullable, required: The unit's number, name or door as the record writes it, e.g. `275`, `Parcare 12`.
    - `floor` string, nullable, required: The floor as the record words it, e.g. `P`, `ETAJ 7`; null when the record names none for the unit.
    - `floor_kind` 'basement' | 'semi_basement' | 'ground' | 'upper' | 'attic' | 'null', nullable, required: Which kind of floor it is on; null when not known.
    - `floor_number` integer, nullable, required: Basements and upper floors only, counted from 1.
    - `entrance` string, nullable, required: The entrance the unit is reached by, as the record names it.
    - `kind` 'dwelling' | 'commercial' | 'parking' | 'storage' | 'other' | 'null', nullable, required: `dwelling`, `commercial`, `parking`, `storage` or `other`; null when the record gives none.
    - `use` string, nullable, required: The use the record states for the unit, in its wording.
    - `area_m2` number, nullable, required: The unit's area as the record states it.
    - `rooms` integer, nullable, required: The rooms the record states.
    - `cadastral_number` string, nullable, required: The unit's own cadastral number, where the record keeps one.
  - `meta` BuildingUnitPageMeta, required: How the page stands against the building's whole list of units.
    - `listed` integer, required: The units the record lists; 0 when it lists none, which says nothing of how many there are.
    - `stated` integer, nullable, required: The units the record states the building has; null when it states no total.
    - `list_is_complete` boolean, required: True when the record lists units and its list matches every total it states.
    - `matched` integer, required: The listed units the answer is about: every one, or those `unit` finds.
    - `limit` integer, required: The page size asked for.
    - `offset` integer, required: The matched units skipped.
  - `links` Links, required
    - `next` string, uri, nullable, required: The next page's URL; null on the last page.

## Other responses

- `400`: A parameter is missing, malformed or out of range (`invalid_parameter`).
- `401`: No API key, or one that does not work: `missing_api_key`, `invalid_api_key`, `revoked_api_key` or `expired_api_key`.
- `402`: `insufficient_credits`: the answer's buildings need more credits than the workspace has left this month. Nothing was returned or charged.
- `403`: The key may not do this: `insufficient_scope`, or `workspace_access_revoked` when the key's creator no longer belongs to its workspace.
- `404`: No building has this id (`not_found`).
- `429`: `rate_limited` (the key's per-minute limit) or `quota_exceeded` (the workspace's daily quota).
- `503`: The building catalogue is unavailable right now (`upstream_unavailable`); retry after `Retry-After` seconds.

---

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