# Listings and places

Your rental listings, and the properties, units and property groups they and your
knowledge are tied to. Only rental listings are served here (`for sale` ones are not).

## The listing object

```json
{
  "id": 800,
  "externalId": "BLDG7-4B",
  "source": "API",
  "status": "ACTIVE",
  "rent": 2450,
  "securityDeposit": 2450,
  "availableOn": "2026-12-01",
  "leaseTermMonths": 12,
  "description": "Corner one-bedroom with river views.",
  "photos": ["https://cdn.example.com/4b-1.jpg"],
  "listingUrl": "https://example.com/apartments/4b",
  "unit": { "id": 40, "name": "4B", "beds": 1, "baths": 1, "sqft": 640, "floor": 4 },
  "property": { "id": 30, "name": "The Alder", "address": "120 Main Street", "city": "Portland", "state": "OR", "zip": "97204" },
  "createdAt": "2026-10-01T12:00:00.000Z",
  "updatedAt": "2026-10-20T12:00:00.000Z"
}
```

| Field | Type | Notes |
|-------|------|-------|
| `externalId` | string, ≤ 255 | Your own id. Only listings created through the API carry one. |
| `source` | string | `API` for listings created here; otherwise where it came from (a feed, a PMS). |
| `status` | `DRAFT` `ACTIVE` `LEASED` `WITHDRAWN` | `ACTIVE` is on the market. |
| `rent` | number > 0, or null | `null` means "call for pricing". |
| `securityDeposit` | number ≥ 0, or null | |
| `availableOn` | `YYYY-MM-DD`, or null | `null` is available now. |
| `leaseTermMonths` | 1–600, or null | |
| `description` | string ≤ 20,000, or null | |
| `photos` | up to 100 http(s) URLs | |
| `listingUrl` | http(s) URL, or null | |
| `unit` | object | The unit the listing offers (see below). |

## Endpoints

### `GET /v1/listings`

Query: `status` (one of the statuses), `updated_since` (ISO 8601 time; no offset means UTC), `cursor`, `limit`. Returns a page of listings.

### `GET /v1/listings/{id}`

One listing.

### `POST /v1/listings`

Creates a listing; `unit` is required. Answers `201` with the listing and a `Location`.

A unit is named by `id`, or by `name` inside a `property`:

```json
{
  "status": "ACTIVE",
  "rent": 2450,
  "availableOn": "2026-12-01",
  "unit": {
    "name": "4B",
    "beds": 1, "baths": 1, "sqft": 640, "floor": 4,
    "property": { "address": "120 Main Street", "city": "Portland", "state": "OR", "zip": "97204" }
  }
}
```

A property is named by `id`, or found by `address` (`"115 East 34th Street"` finds `"115 E 34 St"`); a property or unit that doesn't exist yet is created. `beds`, `baths`, `sqft` and `floor` are applied only to units no property management system manages; a PMS's own facts win.

### `PATCH /v1/listings/{id}`

Changes only the fields sent; `null` clears a nullable field. `status`, `photos` and `unit` cannot be null. `externalId` can only be set on a listing created through the API.

### `PUT /v1/listings/external/{externalId}`

Creates or updates the API listing with your id: `201` when created (then `unit` is required), `200` when updated. Fields left out keep their values. Don't repeat `externalId` in the body. Safe to call repeatedly and concurrently: one id always makes one listing.

## Properties and property groups

### `GET /v1/properties`

A page of `{ id, name, address, city, state, zip, neighborhood }`.

### `GET /v1/properties/{id}/units`

A page of the property's units: `{ id, name, beds, baths, sqft, floor }`.

### `GET /v1/property-groups`

A page of `{ id, name, propertyIds }`: your groupings of properties ("Brooklyn", "Student housing"). Knowledge can be scoped to a property or a group by these ids.
