Create object


POST /v4/sites/{siteId}/objects
Parameters
siteId
uuid required
-
when the `type` value is `light`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "id": "575eb822-26ab-4318-b611-afe0703d419f",
    "roomId": "f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type": "light",
    "capabilities": [],
    "name": "Light #1"
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "capabilities": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "const": "dimmable"
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 201

Headers
Content-Type application/json
{
    "id":"575eb822-26ab-4318-b611-afe0703d419f",
    "name":"Light #1",
    "type":"light",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "capabilities":[],
    "attachedResources":[]
}
when the `type` value is `motionSensor`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "id":"514f6aaa-842b-4cf7-8980-140384127fbf",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type":"motionSensor",
    "name":"",
    "configuration": {
        "motion": {
            "action":"lightOn",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "absence": {
            "action":"lightOff",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
            "offDelay":1800000
        },
    },
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "configuration": {
      "type": "object",
      "properties": {
        "motion": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff",
                "sceneOn"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "sceneId": {
              "type": "string"
            }
          },
          "required": [
            "action"
          ]
        },
        "absence": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff",
                "sceneOn"
              ]
            },
            "offDelay": {
              "type": "number"
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "sceneId": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "motion",
        "absence"
      ]
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 201

Headers
Content-Type application/json
{
    "id":"514f6aaa-842b-4cf7-8980-140384127fbf",
    "name":"",
    "type":"motionSensor",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "configuration": {
        "motion": {
            "action":"lightOn",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "absence": {
            "action":"lightOff",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
            "offDelay":1800000
        },
    },
    "attachedResources":[]
}
when the `type` value is `doorSensor`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "id":"3c5617df-46c0-48fb-84db-356195aeb351",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type":"doorSensor",
    "name":"",
    "configuration": {
        "open": {
            "action":"lightOn",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "close": {
            "action":"lightOff",
            "objectIds":[]
        },
    },
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "configuration": {
      "type": "object",
      "properties": {
        "open": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            }
          },
          "required": [
            "action"
          ]
        },
        "close": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "open",
        "close"
      ]
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 201

Headers
Content-Type application/json
{
    "id":"3c5617df-46c0-48fb-84db-356195aeb351",
    "name":"",
    "type":"doorSensor",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "configuration": {
        "open": {
            "action":"lightOn",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "close": {
            "action":"lightOff",
            "objectIds":[]
        },
    },
    "attachedResources":[]
}
when the `type` value is `switch`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "id":"74714fb6-3910-41ab-b746-305c1159f6cf",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type":"switch",
    "variant":"1-key",
    "name":"",
    "configuration": {
        "left": {
            "action":"lightPushDim",
            "objectIds":[]
        },
        "double": {},
        "right": {
            "action":"lightPushDim",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
    },
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "variant": {
      "enum": [
        "1-key",
        "2-key"
      ]
    },
    "configuration": {
      "type": "object",
      "properties": {
        "left": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        },
        "double": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        },
        "right": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        }
      },
      "required": [
        "left",
        "double",
        "right"
      ]
    }
  },
  "required": [
    "type",
    "roomId",
    "variant",
    "configuration"
  ]
}

Response 201

Headers
Content-Type application/json
{
    "id":"74714fb6-3910-41ab-b746-305c1159f6cf",
    "name":"",
    "type":"switch",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "variant":"1-key",
    "configuration": {
        "left": {
            "action":"lightPushDim",
            "objectIds":[]
        },
        "right": {
            "action":"lightPushDim",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "double":{}
    },
    "attachedResources":[]
}