igloo
Docs / iglooworks / API Reference / Jobs

Jobs API Reference

API endpoints for managing jobs.

Bridge Proxied Jobs

Lock Jobs

Bridge Proxied Jobs send commands to smart locks through a Bridge device. Your application calls the API; the Bridge talks to the lock over Bluetooth.

Send these jobs with Create Bridge Proxied Job.

Job Creation

Create a job by making a POST request to:

/devices/{deviceId}/jobs/bridges/{bridgeId}
Request Parameters
Parameter Type Description
jobType number Command type identifier (see Job Types)
jobData object Command-specific parameters
departmentId string Required unless the account has a single department
Response
{
  "jobId": "string"
}
Job Types
Job Type ID
Lock 1
Unlock 2
Create Custom PIN code 4
Delete PIN code 5
Get Battery Level 9
Get Device Status 10
Get Activity Logs 15

Command Details

Lock

Locks the device and optionally synchronizes its internal clock.

Parameters

Parameter Type Description Required
lockTime ISO_DATE Synchronize the lock's clock No

Request Example

{
  "jobType": 1,
  "jobData": {
    "lockTime": "2024-01-01T12:00:00+00:00"
  }
}
Unlock

Unlocks the device and optionally synchronizes its internal clock.

Parameters

Parameter Type Description Required
lockTime ISO_DATE Synchronize the lock's clock No

Request Example

{
  "jobType": 2,
  "jobData": {
    "lockTime": "2024-01-01T12:00:00+00:00"
  }
}
Create Custom PIN code

Creates a PIN code with specific access permissions and time restrictions.

Parameters

Parameter Type Description Required
accessName string Display name for the PIN code, up to 60 characters Yes
pin string 4-6 digit PIN code Yes
pinType number PIN type (see table below) Yes
startDate string When PIN becomes active (ISO_DATE format) Yes
endDate string When PIN expires (ISO_DATE format) Duration only

PIN Types

Type ID Description
One-Time 1 Valid for 24 hours from start date
Permanent 2 Valid indefinitely from start date
Duration 4 Valid between start and end dates

Request Example

{
  "jobType": 4,
  "jobData": {
    "accessName": "Guest PIN",
    "pin": "123456",
    "pinType": 4,
    "startDate": "2024-01-01T12:00:00+00:00",
    "endDate": "2024-01-01T16:00:00+00:00"
  }
}

Usage Examples

One-Time PIN (24-hour validity):

{
  "jobType": 4,
  "jobData": {
    "accessName": "OTP PIN",
    "pin": "123456",
    "pinType": 1,
    "startDate": "2024-01-01T00:00:00+00:00"
  }
}

Permanent PIN:

{
  "jobType": 4,
  "jobData": {
    "accessName": "Permanent PIN",
    "pin": "123456",
    "pinType": 2,
    "startDate": "2024-01-01T00:00:00+00:00"
  }
}

Duration PIN (specific time window):

{
  "jobType": 4,
  "jobData": {
    "accessName": "Duration PIN",
    "pin": "123456",
    "pinType": 4,
    "startDate": "2024-01-01T12:00:00+00:00",
    "endDate": "2024-01-01T16:00:00+00:00"
  }
}
Delete PIN code

Removes a PIN access from the lock. Identify it by accessId, the ID of the PIN access record from List Device Access.

Note: An unactivated AlgoPIN with a start date more than 256 hours after its creation cannot be deleted.

Parameters

Parameter Type Description Required
accessId string ID of the PIN access record to delete Yes

Request Example

{
  "jobType": 5,
  "jobData": {
    "accessId": "665f1c2a9b3e4d5f6a7b8c9d"
  }
}
Get Battery Level

Retrieves the lock's current battery level as a percentage.

Request Example

{
  "jobType": 9
}
Get Device Status

Queries the lock's current operational status.

Request Example

{
  "jobType": 10
}
Get Activity Logs

Downloads activity logs from the lock. Optionally synchronizes the lock's clock.

Important: Activity logs are deleted from the lock after retrieval.

Parameters

Parameter Type Description Required
lockTime ISO_DATE Synchronize the lock's clock No

Request Example

{
  "jobType": 15,
  "jobData": {
    "lockTime": "2024-01-01T12:00:00+00:00"
  }
}

Error Status Codes

Status Code Description Applies To
400 Request validation failed (missing or invalid field) All
401 Missing, invalid or expired access token All
402 Account suspended, or the iglooworks API trial has ended All
403 The token lacks the scope for this job type, or the user revoked access All
404 No PIN access matches jobData.accessId Delete PIN code
406 A pending job for the same PIN exists, or the PIN is already in use on this lock Create Custom PIN code
409 The lock is not associated with the given department All
415 Missing Content-Type: application/json All

Get Bridge Job Status

GEThttps://api.igloohome.co/works/bridge/jobs/{jobId}

Path Parameters

Parameter Type Required
jobId string Yes

Request Example

curl -X GET "https://api.igloohome.co/works/bridge/jobs/{jobId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
const res = await fetch("https://api.igloohome.co/works/bridge/jobs/{jobId}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

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

url = "https://api.igloohome.co/works/bridge/jobs/{jobId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/bridge/jobs/{jobId}"
	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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/bridge/jobs/{jobId}",
    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;
val client = OkHttpClient()

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

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/bridge/jobs/{jobId}")!)
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

200401403404422

OK.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

Create Bridge Proxied Job

POSThttps://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}

Sends a command to a lock through its Bridge: lock, unlock, create or delete a PIN, get status, or get activity logs. The shape of jobData depends on jobType. CREATE_CUSTOM_PIN and DELETE_PIN_CODE have their own sub-schemas; other job types accept an open object.

Path Parameters

Parameter Type Required
deviceId string Yes
bridgeId string Yes

Body Parameters

Content-Type:application/json
  • jobType integer required
    1=LOCK, 2=UNLOCK, 4=CREATE_CUSTOM_PIN, 5=DELETE_PIN_CODE, 9=GET_BATTERY_LEVEL, 10=GET_DEVICE_STATUS, 15=GET_ACTIVITY_LOGS.
    • Allowed values: 1, 2, 4, 5, 9, 10, 15
  • jobData object
    Shape depends on jobType. See the operation summary.
  • departmentId string
    Required unless the account has a single department, in which case the API ignores it.

Request Example

curl -X POST "https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "departmentId": "value",
    "jobData": "value",
    "jobType": "value"
  }'
const res = await fetch("https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "departmentId": "value",
    "jobData": "value",
    "jobType": "value"
  })
});

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

url = "https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
payload = {
    "departmentId": "value",
    "jobData": "value",
    "jobType": "value"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}"
	payload := []byte(`{
		"departmentId": "value",
		"jobData": "value",
		"jobType": "value"
	}`)

	req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
	req.Header.Set("Content-Type", "application/json")
	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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "departmentId" => "value",
        "jobData" => "value",
        "jobType" => "value"
    ])
]);

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

echo $response;
val client = OkHttpClient()

val mediaType = "application/json".toMediaType()
val body = """
    {
        "departmentId": "value",
        "jobData": "value",
        "jobType": "value"
    }
""".trimIndent().toRequestBody(mediaType)

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}")
    .method("POST", body)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .addHeader("Content-Type", "application/json")
    .build()

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{deviceId}/jobs/bridges/{bridgeId}")!)
request.httpMethod = "POST"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let payload: [String: Any] = [
    "departmentId": "value",
    "jobData": "value",
    "jobType": "value"
]
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

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

Responses

200400401403404406409415

OK.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

App Sync Jobs

Delete PIN Access

DELETEhttps://api.igloohome.co/works/devices/{id}/access/{accessId}

Revokes a PIN access by creating an asynchronous delete job.

Path Parameters

Parameter Type Required
id string Yes
accessId string Yes

Request Example

curl -X DELETE "https://api.igloohome.co/works/devices/{id}/access/{accessId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
const res = await fetch("https://api.igloohome.co/works/devices/{id}/access/{accessId}", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

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

url = "https://api.igloohome.co/works/devices/{id}/access/{accessId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{id}/access/{accessId}"
	req, _ := http.NewRequest("DELETE", 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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{id}/access/{accessId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json"
    ]
]);

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

echo $response;
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{id}/access/{accessId}")
    .method("DELETE", null)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .build()

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{id}/access/{accessId}")!)
request.httpMethod = "DELETE"
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

200401403404409415

Delete job created.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

List Device Jobs

GEThttps://api.igloohome.co/works/devices/{id}/jobs

Path Parameters

Parameter Type Required
id string Yes

Query Parameters

  • jobType string
    Comma-separated, from: delete_pin, create_bluetooth_pin, add_group_key, delete_group_key.
  • status string
    • Allowed values: pending, complete, failed
  • departmentId string
    Filter jobs to a single department (not comma-separated, unlike jobType).
  • limit integer
    • Constraints: >= 1, <= 300
    • Default: 100
  • cursor string
  • sort string
    • Default: desc
    • Allowed values: asc, desc

Request Example

curl -X GET "https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&limit=value&cursor=value&sort=value" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
const res = await fetch("https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&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);
import requests

url = "https://api.igloohome.co/works/devices/{id}/jobs"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
params = {
    "jobType": "value",
    "status": "value",
    "departmentId": "value",
    "limit": "value",
    "cursor": "value",
    "sort": "value"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&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;
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&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())
import Foundation

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{id}/jobs?jobType=value&status=value&departmentId=value&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

200400401403

OK.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

Create Custom PIN

POSThttps://api.igloohome.co/works/devices/{id}/jobs

Creates an asynchronous job that sets a custom PIN on the lock over Bluetooth.

Path Parameters

Parameter Type Required
id string Yes

Body Parameters

Content-Type:application/json
  • description string
  • departmentId string
    Required unless the account has a single department, in which case the API ignores it.
  • pinType string required
    • Allowed values: duration, otp, permanent
  • startDateTime string<date-time> required
    Format YYYY-MM-DDTHH:mm:ss+hh:mm. At most 1 hour in the past.
  • endDateTime string<date-time>
    Format YYYY-MM-DDTHH:mm:ss+hh:mm. Required only when pinType is duration (must be after startDateTime, at most 1 year later). Forbidden otherwise.
  • customPin string required
    4-6 digits, sent as a string.

Request Example

curl -X POST "https://api.igloohome.co/works/devices/{id}/jobs" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "customPin": "value",
    "departmentId": "value",
    "description": "value",
    "endDateTime": "value",
    "pinType": "value",
    "startDateTime": "value"
  }'
const res = await fetch("https://api.igloohome.co/works/devices/{id}/jobs", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "customPin": "value",
    "departmentId": "value",
    "description": "value",
    "endDateTime": "value",
    "pinType": "value",
    "startDateTime": "value"
  })
});

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

url = "https://api.igloohome.co/works/devices/{id}/jobs"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
payload = {
    "customPin": "value",
    "departmentId": "value",
    "description": "value",
    "endDateTime": "value",
    "pinType": "value",
    "startDateTime": "value"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{id}/jobs"
	payload := []byte(`{
		"customPin": "value",
		"departmentId": "value",
		"description": "value",
		"endDateTime": "value",
		"pinType": "value",
		"startDateTime": "value"
	}`)

	req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
	req.Header.Set("Content-Type", "application/json")
	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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{id}/jobs",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "customPin" => "value",
        "departmentId" => "value",
        "description" => "value",
        "endDateTime" => "value",
        "pinType" => "value",
        "startDateTime" => "value"
    ])
]);

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

echo $response;
val client = OkHttpClient()

val mediaType = "application/json".toMediaType()
val body = """
    {
        "customPin": "value",
        "departmentId": "value",
        "description": "value",
        "endDateTime": "value",
        "pinType": "value",
        "startDateTime": "value"
    }
""".trimIndent().toRequestBody(mediaType)

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{id}/jobs")
    .method("POST", body)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .addHeader("Content-Type", "application/json")
    .build()

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{id}/jobs")!)
request.httpMethod = "POST"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let payload: [String: Any] = [
    "customPin": "value",
    "departmentId": "value",
    "description": "value",
    "endDateTime": "value",
    "pinType": "value",
    "startDateTime": "value"
]
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

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

Responses

200400401403409415

Job created.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

Get Job

GEThttps://api.igloohome.co/works/devices/{id}/jobs/{jobId}

Path Parameters

Parameter Type Required
id string Yes
jobId string Yes

Request Example

curl -X GET "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
const res = await fetch("https://api.igloohome.co/works/devices/{id}/jobs/{jobId}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
  }
});

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

url = "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}"
	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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}",
    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;
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{id}/jobs/{jobId}")
    .method("GET", null)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .build()

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}")!)
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

200401403404

OK.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}

Update Job Status

PATCHhttps://api.igloohome.co/works/devices/{id}/jobs/{jobId}

Path Parameters

Parameter Type Required
id string Yes
jobId string Yes

Body Parameters

Content-Type:application/json
  • status string required
    • Allowed values: complete, failed
  • reason string
    Stored only when status is failed.

Request Example

curl -X PATCH "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "value",
    "status": "value"
  }'
const res = await fetch("https://api.igloohome.co/works/devices/{id}/jobs/{jobId}", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "reason": "value",
    "status": "value"
  })
});

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

url = "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Accept": "application/json"
}
payload = {
    "reason": "value",
    "status": "value"
}
response = requests.patch(url, headers=headers, json=payload)
print(response.json())
package main

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

func main() {
	url := "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}"
	payload := []byte(`{
		"reason": "value",
		"status": "value"
	}`)

	req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(payload))
	req.Header.Set("Content-Type", "application/json")
	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))
}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "PATCH",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN",
        "Accept: application/json",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "reason" => "value",
        "status" => "value"
    ])
]);

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

echo $response;
val client = OkHttpClient()

val mediaType = "application/json".toMediaType()
val body = """
    {
        "reason": "value",
        "status": "value"
    }
""".trimIndent().toRequestBody(mediaType)

val request = Request.Builder()
    .url("https://api.igloohome.co/works/devices/{id}/jobs/{jobId}")
    .method("PATCH", body)
    .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN")
    .addHeader("Accept", "application/json")
    .addHeader("Content-Type", "application/json")
    .build()

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

var request = URLRequest(url: URL(string: "https://api.igloohome.co/works/devices/{id}/jobs/{jobId}")!)
request.httpMethod = "PATCH"
request.setValue("Bearer YOUR_ACCESS_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let payload: [String: Any] = [
    "reason": "value",
    "status": "value"
]
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

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

Responses

200400401403404

OK. '{payload: null}' if the job no longer exists at update time.

Example response — 402-account-suspended:

{
  "error": "account.payment.is.suspended"
}

Example response — 402-trial-ended:

{
  "error": "30 days iglooworks API trial has ended"
}