Cozify OneAPI (3.0)

Download OpenAPI specification:

This is OpenAPI specification for Cozify ONE platform.

Terminology

If you are new to Cozify Services, there are some terms you might not be familiar with.

  • resource - A manageable item that is available through platform. Hubs, Devices and Sites are examples of resources. Resource groups, subscriptions and tags are also examples of resources. * resource group - A container that holds related resources for an platform solution. The resource group includes those resources that you want to manage as a group. You decide which resources belong in a resource group based on what makes the most sense for your organization. * resource provider - A service that supplies platform resources. For example, a common resource provider is Cozify.Site, which supplies the structural management of site (aka. Buildings) resource. Cozify.DeviceRegister is another common resource provider.

Receiving events from server using SignalR In addition to the REST endpoints described here, there is also SignalR hub for streaming device events and managing event subscriptions at /hub/v1 endpoint. See the following page for more information about SignalR streams and how to use them with a .NET/JavaScript/Java client: https://learn.microsoft.com/en-us/aspnet/core/signalr/streaming

  1. In order to be able to receive events from the hub, you must open the event stream, otherwise no events will be delivered regardless of subscriptions: - The device events stream name is DeviceEventsStream
  • The event type DeviceEvent is defined in this OpenApi document
  • For instructions how to use the server-to-client streaming sections in this article
  1. To manage event subscriptions there are the following methods: - DeviceEventsSubscribeAll(string deviceRegisterId)
  • Subscribe to events from all devices in the register
  • DeviceEventsUnsubscribeAll(string deviceRegisterId)
    • Unsubscribe from all device events from the register
  • DeviceEventsSubscribe(SubscribeDeviceEvents subscribeRequest)
    • Subscribe to events from specific devices in the register
    • The SubscribeDeviceEvents type is defined in this OpenApi document.
    • WARNING: If previously subscribed to all events from the same register, this does not change anything; You will still receive events from all devices
  • DeviceEventsUnsubscribe(UnsubscribeDeviceEvents unsubscribeRequest)
    • Unsubscribe from specific devices from the register
    • The UnsubscribeDeviceEvents type is defined in this OpenApi document.
    • WARNING: If previously subscribed to all events from the same register, this does not change anything; You will still receive events from all devices
      • Use DeviceEventsUnsubscribeAll instead in this case

Note > Cozify will only support Transport Layer Security (TLS) 1.2 or later.

DeviceRegister

Operations for managing device registers, such as executing commands on device registers and querying device register states.

DeviceRegisterCommand

Allows the execution of a specific command against a device register. This operation can be used to mutate the state of devices and the device register itself.

Authorizations:
Bearer
path Parameters
deviceRegisterId
required
string

The identifier of the device register.

Request Body schema: application/json
required

Request object for command.

required
object (DeviceRegisterCommand)

Base type for all device register commands.

Responses

Request samples

Content type
application/json
{
  • "command": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

DeviceRegisterQuery

Allows the execution of a specific query against a device register. This operation is used to retrieve the state of devices and the device register itself.

Authorizations:
Bearer
path Parameters
deviceRegisterId
required
string

The identifier of the device register.

Request Body schema: application/json
required

Request object for query.

required
object (DeviceRegisterQuery)

Base type for all device register queries.

Responses

Request samples

Content type
application/json
{
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

Graph

Cozify Graph is the gateway to data and intelligence in Cozify One.

Query

Allows the execution of a specific query.

Authorizations:
Bearer
Request Body schema: application/json
required

Request object for query.

required
object (Query)

Base type for queries.

Responses

Request samples

Content type
application/json
{
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

Command

Allows the execution of a specific command.

Authorizations:
Bearer
Request Body schema: application/json
required

Request object for command.

required
object (Command)

Base type commands.

Responses

Request samples

Content type
application/json
{
  • "command": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

Hub

Operations related to the Cozify Hub, including command execution and querying the state of the hub and its connected devices.

HubCommand Deprecated

Deprecated. Use /graph/command with migrated hub Graph commands instead.

Authorizations:
Bearer
path Parameters
hubId
required
string <uuid> (HubIdProperty)
Deprecated
Example: 3ee5d62c-fa38-42a0-a5ac-0c4b315d75fb

The identifier of the Cozify Hub.

Request Body schema: application/json
required

Request object for command.

required
object (HubCommand)
Deprecated

Deprecated. Use base Graph hub commands through /graph/command.

Responses

Request samples

Content type
application/json
{
  • "command": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

HubQuery Deprecated

Deprecated. Use /graph/query with migrated hub Graph queries instead.

Authorizations:
Bearer
path Parameters
hubId
required
string <uuid> (HubIdProperty)
Deprecated
Example: 3ee5d62c-fa38-42a0-a5ac-0c4b315d75fb

The identifier of the Cozify Hub.

Request Body schema: application/json
required

Request object for query.

required
object (HubQuery)
Deprecated

Deprecated. Use base Graph hub queries through /graph/query.

Responses

Request samples

Content type
application/json
{
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

Hubs

Operations related to the Cozify Hubs services, including command execution and querying the state of the fleet.

HubsQuery

Allows the execution of a specific query against a Cozify Hubs services. This operation can be used to retrieve the state of fleets and the Hubs themselves.

Authorizations:
Bearer
Request Body schema: application/json
required

Request object for query.

required
object (HubsQuery)

Base type for all hubs queries.

Responses

Request samples

Content type
application/json
{
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}