

# Properties API Reference

API endpoints for managing properties.

## Get Properties

`GET` `https://api.igloohome.co/home/properties`

Returns list of properties on the account

### Query Parameters

- **`limit`** `number<int32>`\
  Number of objects to return, from 1 to 300. Defaults to 100.
  - Constraints: `>= 1`, `<= 300`
  - Default: `100`
  - Example: `30`
- **`cursor`** `string`\
  The pagination cursor. `cursor` is a string ID that marks your place in the list. For instance, if you make a list request and receive 100 objects, with `nextCursor` of `2sThyA1jii6WmTo3j`, your next call can include `cursor=2sThyA1jii6WmTo3j` in order to fetch the next page of the list.
- **`sort`** `string`\
  Order in which to return objects. Defaults to `desc`.
  - Default: `desc`
  - Allowed values: `asc`, `desc`

### Request Example

```bash
curl -X GET "https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
	req.Header.Set("Accept", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

```javascript
const res = await fetch("https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

const data = await res.json();
console.log(data);
```

```python
import requests

url = "https://api.igloohome.co/home/properties"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
params = {
    "limit": "value",
    "cursor": "value",
    "sort": "value"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
```

```kotlin
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value")
    .method("GET", null)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .build()

val response = client.newCall(request).execute()
println(response.body?.string())
```

```swift
import Foundation

var request = URLRequest(url: URL(string: "https://api.igloohome.co/home/properties?limit=value&cursor=value&sort=value")!)
request.httpMethod = "GET"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
```

### Responses

`200 OK`
`400 Bad Request`
`401 Unauthorized, invalid or expired authorization token`
`402 Response`
`403 Forbidden. accessToken scope must contain 'igloohomeapi/get-properties'`
`500 Internal Server Error`

**Response body — `200`:**

- **`nextCursor`** `string`\
  A string pointing to the next page of results. Empty string indicates you reached the end of the list
  - Example: `2sFZqWxJuynYnwLHg`
- **`payload`** `array of object`\
  An array containing the return properties
  - **`name`** `string`\
    Name of the property
    - Example: `Singapore HQ`
  - **`id`** `string`\
    Unique Identifier of the property
    - Example: `2sFZqWxJuynYnwLHg`
  - **`timezone`** `string`\
    Property timezone
    - Example: `Asia/Singapore`

**Response body — `400`:**

- **`error`** `string`

**Response body — `402`:**

- **`error`** `string`

**Example response — `200`:**

```json
{
  "nextCursor": "2rqQx4Riasw3Rs6db",
  "payload": [
    {
      "id": "2sFZqWxJuynYnwLHg",
      "name": "Singapore HQ",
      "timezone": "Asia/Singapore"
    },
    {
      "id": "2rqQx4Riasw3Rs6db",
      "name": "Igloocompany HQ",
      "timezone": "Asia/Singapore"
    }
  ]
}
```

**Example response — `400`:**

```json
{
  "error": "'limit' must be between 1 to 300 inclusive"
}
```

**Example response — `402`:**

```json
{
  "error": "30 days igloohome API trial has ended"
}
```

## Get Property Detail

`GET` `https://api.igloohome.co/home/properties/{propertyId}`

Returns info on a property

### Path Parameters

| Parameter | Type | Required |
| --- | --- | --- |
| propertyId | string | Yes |

### Request Example

```bash
curl -X GET "https://api.igloohome.co/home/properties/{propertyId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://api.igloohome.co/home/properties/{propertyId}"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
	req.Header.Set("Accept", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

```javascript
const res = await fetch("https://api.igloohome.co/home/properties/{propertyId}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

const data = await res.json();
console.log(data);
```

```python
import requests

url = "https://api.igloohome.co/home/properties/{propertyId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
```

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/home/properties/{propertyId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
```

```kotlin
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/home/properties/{propertyId}")
    .method("GET", null)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .build()

val response = client.newCall(request).execute()
println(response.body?.string())
```

```swift
import Foundation

var request = URLRequest(url: URL(string: "https://api.igloohome.co/home/properties/{propertyId}")!)
request.httpMethod = "GET"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
```

### Responses

`200 OK`
`401 Unauthorized, invalid or expired authorization token`
`402 Response`
`403 Forbidden. accessToken scope must contain 'igloohomeapi/get-properties'`
`404 Property Not Found`
`500 Internal Server Error`

**Response body — `200`:**

- **`payload`** `object`
  - **`name`** `string`\
    Name of the property
    - Example: `Singapore HQ`
  - **`id`** `string`\
    Unique Identifier of the property
    - Example: `2sFZqWxJuynYnwLHg`
  - **`timezone`** `string`\
    Property timezone
    - Example: `Asia/Singapore`

**Response body — `402`:**

- **`error`** `string`

**Example response — `200`:**

```json
{
  "payload": {
    "id": "2sFZqWxJuynYnwLHg",
    "name": "Singapore HQ",
    "timezone": "Asia/Singapore"
  }
}
```

**Example response — `402`:**

```json
{
  "error": "30 days igloohome API trial has ended"
}
```

## Get Devices by Property ID

`GET` `https://api.igloohome.co/home/properties/{propertyId}/devices`

Returns a list of devices of given property. Devices include locks, as well as non-lock devices.

|Device Type|
|--|
|Lock|
|Keypad|
|Bridge|
|Fob|

### Path Parameters

| Parameter | Type | Required |
| --- | --- | --- |
| propertyId | string | Yes |

### Query Parameters

- **`cursor`** `string`\
  The pagination cursor. `cursor` is a string ID that marks your place in the list. For instance, if you make a list request and receive 100 objects, with `nextCursor` of `2sThyA1jii6WmTo3j`, your next call can include `cursor=2sThyA1jii6WmTo3j` in order to fetch the next page of the list.
- **`limit`** `number<int32>`\
  Number of objects to return, from 1 to 300. Defaults to 100.
  - Constraints: `>= 1`, `<= 300`
  - Default: `100`
  - Example: `30`
- **`sort`** `string`\
  Order in which to return objects. Defaults to `desc`.
  - Default: `desc`
  - Allowed values: `asc`, `desc`

### Request Example

```bash
curl -X GET "https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
	req.Header.Set("Accept", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

```javascript
const res = await fetch("https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

const data = await res.json();
console.log(data);
```

```python
import requests

url = "https://api.igloohome.co/home/properties/{propertyId}/devices"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
params = {
    "cursor": "value",
    "limit": "value",
    "sort": "value"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
```

```kotlin
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value")
    .method("GET", null)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .build()

val response = client.newCall(request).execute()
println(response.body?.string())
```

```swift
import Foundation

var request = URLRequest(url: URL(string: "https://api.igloohome.co/home/properties/{propertyId}/devices?cursor=value&limit=value&sort=value")!)
request.httpMethod = "GET"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
```

### Responses

`200 OK`
`400 Bad Request`
`401 Unauthorized, invalid or expired authorization token`
`402 Response`
`403 Forbidden, accessToken scope must contain 'igloohomeapi/get-devices'`
`500 Internal Server Error`

**Response body — `200`:**

- **`nextCursor`** `string`\
  A string pointing to the next page of results. Empty string indicates you reached the end of the list
  - Example: `2sThyA1jii6WmTo3j`
- **`payload`** `array of object`\
  An array containing the return devices
  - **`id`** `string`\
    Internal batch identifier of the device
    - Example: `2rqQx4Riasw3Rs6db01`
  - **`type`** `string`\
    Device Type
    - Example: `Keypad`
  - **`deviceId`** `string`\
    Unique Identifier of the device
    - Example: `EK1X013f300d`
  - **`deviceName`** `string`\
    Name of the device
    - Example: `My keypad 1`
  - **`batteryLevel`** `integer`\
    Battery level of the device
  - **`pairedAt`** `string<date-time>`\
    Pairing date
    - Example: `2022-05-30T00:00:00+08:00`
  - **`homeId`** `array of string`\
    Associated home/property(s)
    - Example: `["2rqQx4Riasw3Rs6db"]`
  - **`linkedDevices`** `array of object`\
    Device(s) linked to this device
    - Example: `[{"type":"Lock"},{"deviceId":"IGP102c1854a"}]`
    - **`id`** `string`\
      Internal batch identifier of the linked device
    - **`type`** `string`
    - **`deviceId`** `string`

**Response body — `400`:**

- **`error`** `string`

**Response body — `402`:**

- **`error`** `string`

**Example response — `200`:**

```json
{
  "nextCursor": "22j3230ids0idsa0d",
  "payload": [
    {
      "deviceId": "EK1X013f300d",
      "deviceName": "Keypad",
      "homeId": [
        "2rqQx4Riasw3Rs6db"
      ],
      "linkedDevices": [
        {
          "deviceId": "IGP102c1854a",
          "type": "Lock"
        }
      ],
      "pairedAt": "2022-06-30T17:00:00+08:00",
      "type": "Keypad"
    }
  ]
}
```

**Example response — `400`:**

```json
{
  "error": "'limit' must be between 1 to 300 inclusive"
}
```

**Example response — `402`:**

```json
{
  "error": "30 days igloohome API trial has ended"
}
```

