Skip to main content

Units

A unit belongs to a building. This endpoint creates and updates units. The same item shape is also accepted nested inside a prospect to create a unit on the fly.

See the Onboarding overview for the array, result, and upsert conventions this endpoint shares.

Create or update units​

POST /partners/{owner_slug}/units
Content-Type: application/json
[
{ "external_system_id": "acme-unit-456",
"property_external_id": "acme-prop-123",
"address": {
"line_one": "1101 Midland Avenue APT 01",
"line_two": null,
"city": "New Brunswick",
"state": "NJ",
"zip": "08901"
},
"pms_unit_id": "0401",
"default_coverage": { "type": "multiplier", "value": 1.5 } }
]

The example omits name, so Greenlight derives it as "01" from the address.

Request fields​

FieldRequiredNotes
external_system_idyesYour own identifier. The upsert key
property_external_idyesYour identifier for the building this unit belongs to, never a Greenlight one. A unit cannot move to a different building
namenoThe unit number or name as it appears on the lease, such as "4B". It is printed on the renter's policy. When omitted, it is derived from address. Sending it always takes precedence over derivation, and a name you send is never replaced by a derived one
addressnoThe unit's full address, exactly as stored, including any line 1 and line 2 inconsistency, designators, and extraneous text. Object: line_one, line_two, city, state, zip; country is accepted and ignored. Used to derive the building street and, when name is absent, the unit's label. line_two is not read for identity
pms_unit_idnoThe unit's code in the building's PMS, when the building has a PMS pair. For Yardi this is the unit code exactly as Yardi shows it, leading zeros included ("0401", not "401"); see Sourcing fields from Yardi. For an owner with an existing Greenlight relationship, send it: it is the primary unit match key
default_coveragenoOverrides the building's coverage for this unit, in the same two forms and limits. Inherits from the property when absent

Response​

{
"status_code": 200,
"results": [
{ "external_system_id": "acme-unit-456", "action": "created" }
],
"meta": { "created": 1, "updated": 0, "failed": 0 },
"request_id": "6f1c2b9e-7d4a-4c1e-9a55-0b8f3d2e1a77"
}

This endpoint takes unit items only. Units key on property_external_id, and one that Greenlight does not recognize fails that item, so send the property first, in an earlier POST /partners/{owner_slug}/properties request. Sending a building's units in a single request is recommended, because it resolves the building's derived address and unit names immediately.

Unit name derivation​

When name is absent, the label is derived, in order:

  1. The designator found in the unit's own street line ("APT 01" yields "01").
  2. The street line with the building's established street removed, so a bare "…Blvd. 208" resolves to "208".
  3. A designator in line_two.
  4. The pms_unit_id.

A single unit building defaults to "1". Standard designator words are dropped ("APT 01" yields "01"); nonstandard ones are kept verbatim, such as "5th Floor" or "Loft B". Where nothing is derivable in a multi unit building, the item fails with the detail { "field": "name", "code": "not_derivable", "message": "is required and could not be derived from the address" }, because Greenlight never guesses a label that will appear on a policy.

Derivation applies the same way to a unit nested inside a prospect.

Unit matching​

Within the parent building, in the same order as properties:

  1. If external_system_id is already linked to a unit, that unit is updated.
  2. PMS code, when sent. An existing unit with the same pms_unit_id is adopted and linked. This match is exact and unaffected by naming style, which is why an owner with an existing Greenlight relationship should always send it: a derived name such as "113" may not match the PMS's stored "0113".
  3. Otherwise, by a name you sent, ignoring case. A derived name is not used for matching. A unit already linked to a different identifier fails the item, as with properties.
  4. Otherwise, create.

One unit buildings. A property of type single_family or garden_community holds exactly one unit; a second unit sent for it fails that item with single_unit_property and a null field.

Item errors​

A failed item carries an error whose details name each refused field (see Errors); the other items still apply.

Detail codefieldCause
requiredexternal_system_idMissing identifier
unknown_buildingproperty_external_idSend the property first, in an earlier properties request
out_of_grantproperty_external_idAn owner with an existing Greenlight relationship, and the building is outside your grant
wrong_buildingproperty_external_idThe unit already exists under a different building
not_derivablenameSee Unit name derivation
ambiguousnameSeveral existing units match and nothing separates them; nothing was created
already_linkedexternal_system_idThe matched unit is linked to a different identifier of yours
not_a_unitexternal_system_idThe identifier is already in use for a property or bank account
property_lockednullThe unit's building cannot currently be changed
single_unit_propertynullA second unit sent for a one unit building
unknown_coverage_typedefault_coveragetype is not multiplier or amount_cents
not_positivedefault_coveragevalue is not a positive number
pms_authority_planneddefault_coverageCoverage cannot be set while the building is moving to PMS-sourced data
contendednullAnother write to the same records was in progress; retry the item

There is no unit level removal; a unit cannot be individually deactivated. Remove the whole building with the property's active: false, or resolve it with your Partner Success Manager.

Next steps​