# Resolve a setting

Source: https://api-docs.magicdoor.com/api-reference/settings/resolve-setting

Returns the value that actually applies to one entity, walking lease → unit → property → portfolio → company and stopping at the first override it finds. `source` tells you which level the value came from. Requires the `settings:read` permission.

`GET https://services.magicdoor.com/settings/company-portal/settings/{settingsType}/{level}/{levelId}`

**Authentication:** bearer token in the `Authorization` header, as `Bearer <token>`.

## Path parameters

- `settingsType` (enum<string>, required) — Which family of settings to act on. Matched case-insensitively against the registered settings types. One of: `achpaymentprocessing`, `agentschat`, `associationviolation`, `autopayincentives`, `chat`, `chatai`, `chatailease`, `chataileaserenewal`, `chataileaserentersinsurance`, `chataimaintenancerequests`, `chataitranslation`, `communications`, `company`, `contribution`, `depositpayment`, `distribution`, `email`, `emailnotification`, `latefees`, `leasechartofaccount`, `leaseinvoice`, `leaserenewal`, `leaserentersinsurance`, `maintenancerequest`, `maintenancerequestrunbook`, `managementfee`, `outgoingpayments`, `property`, `rentalapplication`, `rentalapplicationbilling`, `rentalapplicationchartofaccount`, `rentalapplicationgeneral`, `rentalapplicationpayment`, `rentalapplicationpaymentaccount`, `rentalapplicationquestionnaire`, `rentalapplicationscreening`, `rentpayment`, `rentpaymentfailurefee`, `rentpaymentnotification`, `rentpaymentprocessingfees`, `syndication`, `tenantautopayfailednotification`, `tenantpaymentreminder`, `text`, `workorder`. Example: `property`.
- `level` (enum<string>, required) — The kind of entity the setting is attached to. Matched case-insensitively. One of: `company`, `portfolio`, `property`, `unit`, `lease`. Example: `property`.
- `levelId` (string, required) — The entity to resolve the setting for, of the kind named by `level`. A Snowflake id, sent as a whole number in the URL. Example: `1842918365109710848`.

## Example request

```bash
curl --request GET \
  --url 'https://services.magicdoor.com/settings/company-portal/settings/property/property/1842918365109710848' \
  --header 'Authorization: Bearer <token>'
```

## Responses

### 200 — The effective value for the entity.

- `…settings properties` (object) — The properties of the chosen settings type, spread across the top level of the response. The example below is the `property` settings type.
- `level` (enum<string>) — The kind of entity this stored row is attached to. Present only when the value came from a stored row; absent when the response is the built-in default. One of: `company`, `portfolio`, `property`, `unit`, `lease`.
- `levelId` (string) — The id of the entity this stored row is attached to. At company level this is the company's own id. Present only when the value came from a stored row; absent when the response is the built-in default.
- `groupId` (string) — Identifies rows written together by a single multi-target override call. Absent on rows written on their own. Present only when the value came from a stored row; absent when the response is the built-in default.
- `source` (enum<string>) — Which level the returned value came from. Sent as the JSON value `null` when nothing is stored and the response is the built-in default. Note that this field is capitalised (`Company`, `Property`), unlike `level` elsewhere in the API. One of: `Company`, `Portfolio`, `Property`, `Unit`, `Lease`.
- `sourceId` (string) — The id of the entity the returned value is stored against, matching `source`. Sent as the JSON value `null` when the response is the built-in default.
- `isDefault` (boolean, required) — `true` when no setting is stored anywhere the endpoint looked and the response is MagicDoor's built-in default for this settings type.

```json
{
  "reserve": 500,
  "ownerApprovalLimit": 1000,
  "vendorApprovalLimit": 250,
  "level": "property",
  "levelId": "1842918365109710848",
  "source": "Property",
  "sourceId": "1842918365109710848",
  "isDefault": false
}
```

### 401 — The access token is missing, expired, or invalid.

### 403 — The caller does not hold the `settings:read` permission.

### 404 — No settings type is registered under the `settingsType` in the URL, or the portfolio, property, unit or lease named by `level` and `levelId` does not exist.

```json
{
  "type": "https://httpstatuses.com/404",
  "title": "Not Found",
  "status": 404,
  "detail": "Property 1842918365109710848 not found",
  "instance": "/company-portal/settings/property/property/1842918365109710848",
  "traceId": "0HN7GK9C2M4PQ",
  "entityType": "Property",
  "entityId": "1842918365109710848"
}
```

This is the read to use when you want to know what MagicDoor will do for a given lease, unit, property or portfolio. The ancestor chain is looked up first — asking for a lease pulls in its unit, property, portfolio and company — and the most specific stored override wins. When no level in the chain has a stored value, the built-in default is returned with `isDefault` set to `true`.
