Cozify OneAPI (3.0)

Download OpenAPI specification:

The OpenAPI specification for the Cozify ONE platform.

Graph API

Cozify Graph is the primary, unified API surface. Instead of per-resource REST endpoints, a single pair of endpoints dispatches a polymorphic set of typed messages, each selected by its type discriminator:

  • PUT /graph/command — change state.
  • POST /graph/query — read state.

Commands that start long-running work return an operation you can track to completion, and server-side changes are delivered live as push messages over the SignalR hub stream. The classic per-provider REST endpoints (Hub, Hubs, DeviceRegister) are deprecated in favor of Graph.

Terminology

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

  • resource — A manageable item available through the platform. Hubs, Devices and Sites are examples of resources; resource groups, subscriptions and tags are too.
  • resource group — A container that holds related resources for a platform solution. You decide which resources belong to a group based on what makes the most sense for your organization.
  • resource provider — A service that supplies platform resources. For example, the canonical site resource provider is Cozify.Sites, which supplies the structural management of site (a.k.a. building) resources. Cozify.Site is accepted as a compatibility alias for clients that model the provider namespace separately from the plural resource type. Cozify.DeviceRegister is another common resource provider.

SignalR (/hub/v1)

In addition to the REST endpoints described here, the API is available over a persistent SignalR connection at the /hub/v1 endpoint. See Microsoft's guide to SignalR streaming for how to consume it from a .NET / JavaScript / Java client.

Graph over SignalR

The Graph command/query API is exposed as hub methods that carry the same envelopes as the REST endpoints:

  • Command(CommandRequest) returns CommandResponse — the equivalent of PUT /graph/command.
  • Query(QueryRequest) returns QueryResponse — the equivalent of POST /graph/query.

Device events

  1. To receive device events you must open the event stream — otherwise no events are delivered, regardless of subscriptions. Open the DeviceEventsStream stream; its messages are delivered over SignalR and are not part of this OpenAPI document.
  2. To manage event subscriptions, use the following hub methods:
    • DeviceEventsSubscribeAll(deviceRegisterId) — subscribe to events from all devices in the register.
    • DeviceEventsUnsubscribeAll(deviceRegisterId) — unsubscribe from all device events from the register.
    • DeviceEventsSubscribe(request) — subscribe to events from specific devices in the register. Warning: if you previously subscribed to all events from the same register, this changes nothing — you will still receive events from every device.
    • DeviceEventsUnsubscribe(request) — unsubscribe from specific devices in the register. Warning: if you previously subscribed to all events from the same register, this changes nothing — use DeviceEventsUnsubscribeAll instead.

Note: Cozify supports Transport Layer Security (TLS) 1.2 or later only.

DeviceRegister

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

DeviceRegisterCommand Deprecated

Deprecated. Use /graph/command with migrated device register Graph commands instead.

Authorizations:
Bearer
path Parameters
deviceRegisterId
required
string (DeviceRegisterId) [ 3 .. 61 ] characters ^([a-z0-9\-_])+$
Example: default-devices

Globally unique device register identifier.

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 Deprecated

Deprecated. Use /graph/query with migrated device register Graph queries instead.

Authorizations:
Bearer
path Parameters
deviceRegisterId
required
string (DeviceRegisterId) [ 3 .. 61 ] characters ^([a-z0-9\-_])+$
Example: default-devices

Globally unique device register identifier.

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 unified gateway to data and actions in Cozify One. In place of per-resource REST endpoints, a single pair of endpoints - PUT /graph/command to change state and POST /graph/query to read it - dispatches a polymorphic set of typed commands and queries, each selected by its type discriminator. Commands that start long-running work return an operation you can track to completion, and server-side changes are delivered live as push messages over stream.

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. Abstract base; never instantiated directly. Use a concrete subtype.

correlationId
string (CorrelationId) [ 1 .. 128 ] characters

Client-chosen opaque identifier for an operation. Supplied on the request and echoed back on the response, and attached to server logs and traces so the caller can correlate their request with server-side activity.

traceparent
string (Traceparent) ^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-...

W3C Trace Context traceparent ("00---"). On a request it continues the caller's distributed trace on the server, carried in the body so it also works on transports without headers (SignalR); over HTTP the traceparent header takes precedence. On a response it is the server-side trace of the operation, for support and log/trace lookup.

Responses

Request samples

Content type
application/json
{
  • "query": {
    },
  • "correlationId": "string",
  • "traceparent": "string"
}

Response samples

Content type
application/json
{
  • "result": {
    },
  • "correlationId": "string",
  • "traceparent": "string"
}

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. Abstract base; never instantiated directly. Use a concrete subtype.

correlationId
string (CorrelationId) [ 1 .. 128 ] characters

Client-chosen opaque identifier for an operation. Supplied on the request and echoed back on the response, and attached to server logs and traces so the caller can correlate their request with server-side activity.

traceparent
string (Traceparent) ^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-...

W3C Trace Context traceparent ("00---"). On a request it continues the caller's distributed trace on the server, carried in the body so it also works on transports without headers (SignalR); over HTTP the traceparent header takes precedence. On a response it is the server-side trace of the operation, for support and log/trace lookup.

Responses

Request samples

Content type
application/json
{
  • "command": {
    },
  • "correlationId": "string",
  • "traceparent": "string"
}

Response samples

Content type
application/json
{
  • "result": {
    },
  • "correlationId": "string",
  • "traceparent": "string"
}

Push

Marker endpoint for the SignalR Push streaming method. Server-to-client push messages are delivered over the SignalR hub Push stream, not over HTTP - calling this HTTP endpoint always returns 400. It exists to publish the PushMessage shape delivered over the stream. SignalR method: Push.

Authorizations:
Bearer
Request Body schema: application/json
required

Schema marker only. Documents the shape of the PushMessage delivered over the SignalR Push stream; this HTTP endpoint does not consume a request body and always returns 400.

required
object (Push)

Base type for server-to-client push messages delivered over the Graph hub stream. Abstract base; never instantiated directly. Use a concrete subtype.

Responses

Request samples

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

Response samples

Content type
application/problem+json
{
  • "title": "string",
  • "status": 400,
  • "detail": "string",
  • "instance": "string"
}

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 Deprecated

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

Authorizations:
Bearer
Request Body schema: application/json
required

Request object for query.

required
object (HubsQuery)
Deprecated

Base type for all hubs queries.

Responses

Request samples

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

Response samples

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

Service

Service-level operational endpoints, such as the anonymous status/version probe.

Status

Returns service status, including the running version. Anonymous - no authentication is required.

Responses

Response samples

Content type
application/json
{
  • "version": "3.0.1+build.42"
}