Download OpenAPI specification:
The OpenAPI specification for the Cozify ONE platform.
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.
If you are new to Cozify Services, there are some terms you might not be familiar with.
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.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.
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.Deprecated. This whole feature — the
DeviceEventsStreamstream, the four subscribe methods, and their request payloads — is superseded by the contracted push stream. UsePushand itsDeviceStateDeviceRegisterPushmessage instead: it carries the same device state, is part of this document rather than hand-copied by each consumer, and delivers the current state of every device in the register as its first messages, so a subscriber has nothing to poll for an initial value.It still works and is not scheduled for removal. One known consumer remains on it; removal waits on that migration rather than on a date.
DeviceEventsStream stream; its
messages are delivered over SignalR and are not part of this OpenAPI document — which is
itself a reason to prefer the push.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.
Operations for managing device registers, such as executing commands on device registers and querying device register states.
Deprecated. Use /graph/command with migrated device register Graph commands instead.
| deviceRegisterId required | string (DeviceRegisterId) [ 3 .. 64 ] characters ^[A-Za-z0-9_-]+$ Example: default-devices Globally unique device register identifier. |
Request object for command.
required | object (DeviceRegisterCommand) Base type for all device register commands. Abstract base; never instantiated directly. Use a concrete subtype. |
{- "command": {
- "type": "string"
}
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}
}Deprecated. Use /graph/query with migrated device register Graph queries instead.
| deviceRegisterId required | string (DeviceRegisterId) [ 3 .. 64 ] characters ^[A-Za-z0-9_-]+$ Example: default-devices Globally unique device register identifier. |
Request object for query.
required | object (DeviceRegisterQuery) Base type for all device register queries. Abstract base; never instantiated directly. Use a concrete subtype. |
{- "query": {
- "type": "string"
}
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}
}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.
Allows the execution of a specific query.
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- |
{- "query": {
- "type": "string"
}, - "correlationId": "string",
- "traceparent": "string"
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}, - "correlationId": "string",
- "traceparent": "string"
}Allows the execution of a specific command.
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- |
{- "command": {
- "type": "string"
}, - "correlationId": "string",
- "traceparent": "string"
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}, - "correlationId": "string",
- "traceparent": "string"
}Fetches the pushes waiting for one session. The same stream the SignalR Push method serves, over a request a client can make from anywhere - a client that cannot hold a socket open uses this and receives identical data.
The response is a JSON array written as the pushes arrive rather than at the end, so a client reading it as an asynchronous enumeration receives each push as it happens. The elements are the same PushMessage envelopes the stream delivers, so the code handling one handles the other.
One fetch ends once its wait is up and the client asks again. The subscription survives the gap between one fetch and the next - a caller between fetches is still a caller - for as long as the service's idle grace, which is comfortably longer than the longest wait this endpoint allows. Stop fetching for longer than that and the subscription is released as any departed client's is: the fetches still answer, with heartbeats and nothing else, until a subscribe asks for it again.
What arrives during a gap is not held for later either, so a client that stops fetching for a while comes back to the stream as it is rather than to a backlog. That is the guarantee the socket carries too: every push states whole current state rather than a change to apply, so the next one for a device corrects whatever was missed, and a client that wants everything at once re-subscribes and is answered with a snapshot.
Subscribe first, through PUT /graph/command, naming the same sessionId there as here. Over the SignalR hub that field is replaced with the connection id and may be left out; over HTTP there is no connection to take it from, so the caller names its own.
SignalR method: Push.
The session to fetch for, and how long to wait.
| sessionId required | string (PushSessionId) [ 1 .. 128 ] characters This governs release, never delivery. Delivery is per user: every connection of a user receives everything that user is watching, whichever session asked for it and whatever this field says. There is no per-session delivery path, so this is not a way to address one connection. What the session decides is who may give a subscription back — a subscription belongs to the user, so without counting the sessions holding it the first tab to navigate away would silence the rest. Over the SignalR hub the server replaces whatever is sent here with the connection id, so on that transport the field is inert and may be left out; it is replaced rather than trusted because the connection id is how the server recognises a session that has stopped reading, and gives back what a closed tab held without it having unsubscribed. Set it yourself only over plain HTTP, where there is no connection to take it from — callers that send nothing there share one anonymous session and can release each other's subscriptions. |
| wait | integer [ 1 .. 55 ] Default: 25 How long this fetch waits for pushes before completing, in seconds. Bounded by the service at 55, which is under the time most proxies will hold an idle response open, and at one second below - a fetch that waits for nothing answers before the stream has handed anything over, so it comes back empty however much was waiting for it. |
{- "sessionId": "string",
- "wait": 25
}[- {
- "push": {
- "type": "string"
}
}
]Operations related to the Cozify Hub, including command execution and querying the state of the hub and its connected devices.
Deprecated. Use /graph/command with migrated hub Graph commands instead.
| hubId required | string <uuid> (HubIdProperty) Deprecated Example: 3ee5d62c-fa38-42a0-a5ac-0c4b315d75fb The identifier of the Cozify Hub. |
Request object for command.
required | object (HubCommand) Deprecated Deprecated. Use base Graph hub commands through /graph/command. Abstract base; never instantiated directly. Use a concrete subtype. |
{- "command": {
- "type": "string"
}
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}
}Deprecated. Use /graph/query with migrated hub Graph queries instead.
| hubId required | string <uuid> (HubIdProperty) Deprecated Example: 3ee5d62c-fa38-42a0-a5ac-0c4b315d75fb The identifier of the Cozify Hub. |
Request object for query.
required | object (HubQuery) Deprecated Deprecated. Use base Graph hub queries through /graph/query. Abstract base; never instantiated directly. Use a concrete subtype. |
{- "query": {
- "type": "string"
}
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}
}Operations related to the Cozify Hubs services, including command execution and querying the state of the fleet.
Deprecated. Use /graph/query with migrated hubs Graph queries instead.
Request object for query.
required | object (HubsQuery) Deprecated Base type for all hubs queries. Abstract base; never instantiated directly. Use a concrete subtype. |
{- "query": {
- "type": "string"
}
}{- "result": {
- "type": "string",
- "error": {
- "code": "E_UNKNOWN",
- "message": "string",
- "details": {
- "property1": "string",
- "property2": "string"
}, - "errors": [
- { }
]
}
}
}