Skip to content

Routes

A route is a part of an endpoint that denotes what types of interfaces the endpoint can support from a specific plugin. Additionally, a route may describe the endpoint with metadata such as names, manufacturer name, model data, etc.

Get Routes

View source specification ↗
GET /routes

Lists routes owned by the authenticated caller by default. Supplying an owner selects that owner's routes, subject to the caller's route-read permissions. The default page size is 10 and the maximum is 100. The returned route id is the persisted Port OS route identifier. For routes created through synchronization, use associatedPluginRouteId to match the stable plugin-owned or fixture route identity from the discovery payload.

Required scope

endpoint:read

Query parameters

ownerstring

Owner whose routes to list. Defaults to the authenticated caller when omitted. A different owner is permitted only for routes the caller can read.

expandarray<string>

Expansion tokens that request related or computed fields for each result. When omitted, the response contains only the default, shallower set of fields for each result.

nextTokenstring

Opaque token for the next page of results. Pass the continuation token returned by the previous response, unchanged. Omit it to start from the first page.

maxResultsinteger

Maximum number of results to return in one page. Defaults to 100. Values from 1 through 100 are accepted.

minimum: 1

maximum: 100

Default: 100

Returns

200

OK

Fields
resultsarray<Route>Required
etagstringRequired

Opaque strong version of the writable route document. Send in If-Match when replacing or deleting. Provider observations do not advance it.

pluginProfileIdstring

Stable profile ID selected from the registered plugin declaration. Required for V2 plugin discovery; retained with the route for admission and presentation.

minLength: 1

idstringRequired

The server-assigned, owner-scoped Port OS route identifier. Use this ID when replacing or deleting a stored route. Provider input uses the separate ProviderDiscoveredRoute schema; its id may identify an existing authorized route only. Use associatedPluginRouteId to match the stable plugin-native identity across reports.

pattern: "^port1/[^/]+/[^/]+/routes/[^/]+$"

associatedPluginIdstringRequired

The ID of the associated plugin

associatedPluginRouteIdstringRequired

The stable plugin-owned route identifier associated with this Port OS route. For synchronized plugin capability contracts and fixture parity checks, use this field to match a route from enumeration back to the discovery payload.

externalIdstringRequired

The external ID of the route given by the reporting system

associatedAuthLinkIdstringRequired

The ID of the associated auth link

associatedEndpointIdstringRequired

The ID of the associated endpoint

nameTypeValue

The name of the route as a human readable string or a localizable asset. This is either a raw string or a localizable asset reference.

interfacesarray<RouteInterface>Required

List of interfaces supported by the route. These denote what the route is capable of performing such as turning off/on, etc.

namestringRequired

The name of the interface

versionstring

the version of the interface

messagesarray<ApplicationInterfaceMessage>

Supported inbound message subset for the declared interface version. An omitted or empty list declares no supported messages; null also declares none. A supplied array contains distinct canonical names for implemented messages.

nullable: true

namestringRequired

The name of the command

attributesarray<ApplicationInterfaceAttribute>

Supported attribute subset. An omitted or empty list declares no supported attributes.

namestringRequired

The name of the attribute

valueobject

the value of the attribute, this is an opaque resource object, so it can be any type of struct.

configurationobject

The configuration of the interface

ontologicalTypesarray<string>Required

List of ontological types for the route. These are used mostly for customers to know what an endpoint is, like if its a lightbulb, or a speaker, etc.

pluginCustomMetadataobject

A set of custom metadata that the plugin uses and attaches to the route, this is meant specifically for the plugin to use.

descriptionTypeValue

The description of the route as a human readable string or a localizable asset.

manufacturerTypeValue

The manufacturer of the route as a human readable string or a localizable asset.

modelTypeValue

The model of the route as a human readable string or a localizable asset.

serialNumberTypeValue

The serial number of the route as a human readable string or a localizable asset.

paginationContextPaginationContext
errorsarray<Error>

Partial query errors collected while returning available results.

The one Port OS error shape, returned by every REST error response and every MCP tool error. `code` names the specific failure and `family` its broad class; both are closed enums, so clients branch on them and show `message`, which says what failed and what to do next.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

messagestringRequired

Plain-language description of the failure and the suggested next action.

detailsErrorDetails

Optional typed context for an error. Fields are additive and only populated when the error can safely expose that context to API clients.

errorsarray<SynchronizationItemError>

Every rejected item when a request that is validated item by item and applied atomically fails, such as a discovery `SynchronizationRequest` whose routes, group routes or relationships are rejected. Omitted for single-item failures.

One rejected discovery item of a `SynchronizationRequest`, keyed by the plugin-owned identity of the rejected item: `pluginRouteId` for a route or group route, or `relationshipExternalId` for a relationship. Exactly one of the two is set. It shares the `code`, `family`, `status` and `message` fields of `BatchItemError`; discovery items are keyed by plugin-owned identity because they carry no `requestId`. A request with any rejected item is rejected as a whole and lists every rejected item.

pluginRouteIdstring

Plugin-owned identifier of the rejected route or group route. Set unless the item is a relationship.

relationshipExternalIdstring

Plugin-owned `externalId` of the rejected relationship. Set only for relationship items.

interfacestring

Canonical capability interface name the failure applies to, when the failure is interface-specific.

versionstring

Declared capability interface version the failure applies to, when the failure is interface-specific.

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

statusintegerRequired

HTTP-equivalent status code of the item failure.

minimum: 400

maximum: 599

messagestringRequired

Plain-language description of the failure and the suggested fix.

Errors

400 BAD_REQUEST

Invalid query parameter, including an invalid maxResults value or pagination token.

Check the request fields and any validation details, then correct the payload.

500 INTERNAL

Internal server error

Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.

Upsert Route

View source specification ↗
POST /routes

Creates a route when id is omitted, or fully replaces its writable document when id names an existing route. Provider-observed capabilities and metadata are read-only. A replacement requires the current If-Match; response receipts are retained for 24 hours.

Required scope

endpoint:write

Header parameters

Idempotency-KeystringRequired

Client-chosen key that makes a non-idempotent request retry-safe, following draft-ietf-httpapi-idempotency-key-header. A committed response is stored for 24 hours and replayed for the same principal, operation, key and payload. Missing key returns 400 IDEMPOTENCY_KEY_REQUIRED, a key longer than 255 characters returns 400 IDEMPOTENCY_KEY_INVALID, the same key with a different payload returns 422, and the same key while the first request is still in flight returns 409. Requests rolled back before external provider attempts do not consume the key. Group mutations retain terminal failed responses after provider attempts together with received provider truth; their operation contract defines these replayable outcomes.

minLength: 1

maxLength: 255

If-Matchstring

Required for a full replacement when the request identifies an existing resource. Send that resource's quoted strong etag from its last GET. A missing condition on a replacement returns 428 PRECONDITION_REQUIRED; a stale condition returns 412 PRECONDITION_FAILED. Omit this header when creating a new resource without an id. Wildcards are accepted only where the operation explicitly permits them.

minLength: 1

Request body

Required

Fields

idstring

Existing route to replace. Omit on create; the server assigns the resource ID.

nameTypeValueRequired
endpointIdstringRequired

Endpoint to associate with the route. The caller must be allowed to write it.

pluginIdstringRequired

Plugin receiving this route's messages. The caller must be allowed to use it.

pluginRouteIdstringRequired

Plugin-native routing identity, distinct from the server-assigned route resource ID.

authLinkIdstringRequired

Existing authentication link for this route, or __none__ for an accountless plugin.

Returns

200

Stored route, including its current writable-document etag.

Fields
etagstringRequired

Opaque strong version of the writable route document. Send in If-Match when replacing or deleting. Provider observations do not advance it.

pluginProfileIdstring

Stable profile ID selected from the registered plugin declaration. Required for V2 plugin discovery; retained with the route for admission and presentation.

minLength: 1

idstringRequired

The server-assigned, owner-scoped Port OS route identifier. Use this ID when replacing or deleting a stored route. Provider input uses the separate ProviderDiscoveredRoute schema; its id may identify an existing authorized route only. Use associatedPluginRouteId to match the stable plugin-native identity across reports.

pattern: "^port1/[^/]+/[^/]+/routes/[^/]+$"

associatedPluginIdstringRequired

The ID of the associated plugin

associatedPluginRouteIdstringRequired

The stable plugin-owned route identifier associated with this Port OS route. For synchronized plugin capability contracts and fixture parity checks, use this field to match a route from enumeration back to the discovery payload.

externalIdstringRequired

The external ID of the route given by the reporting system

associatedAuthLinkIdstringRequired

The ID of the associated auth link

associatedEndpointIdstringRequired

The ID of the associated endpoint

nameTypeValue

The name of the route as a human readable string or a localizable asset. This is either a raw string or a localizable asset reference.

interfacesarray<RouteInterface>Required

List of interfaces supported by the route. These denote what the route is capable of performing such as turning off/on, etc.

namestringRequired

The name of the interface

versionstring

the version of the interface

messagesarray<ApplicationInterfaceMessage>

Supported inbound message subset for the declared interface version. An omitted or empty list declares no supported messages; null also declares none. A supplied array contains distinct canonical names for implemented messages.

nullable: true

namestringRequired

The name of the command

attributesarray<ApplicationInterfaceAttribute>

Supported attribute subset. An omitted or empty list declares no supported attributes.

namestringRequired

The name of the attribute

valueobject

the value of the attribute, this is an opaque resource object, so it can be any type of struct.

configurationobject

The configuration of the interface

ontologicalTypesarray<string>Required

List of ontological types for the route. These are used mostly for customers to know what an endpoint is, like if its a lightbulb, or a speaker, etc.

pluginCustomMetadataobject

A set of custom metadata that the plugin uses and attaches to the route, this is meant specifically for the plugin to use.

descriptionTypeValue

The description of the route as a human readable string or a localizable asset.

manufacturerTypeValue

The manufacturer of the route as a human readable string or a localizable asset.

modelTypeValue

The model of the route as a human readable string or a localizable asset.

serialNumberTypeValue

The serial number of the route as a human readable string or a localizable asset.

Response headers
ETagstring

Opaque strong entity tag of the returned resource version. Send it back in `If-Match` on the next mutation of the same resource.

Errors

400

Invalid request payload

Check the request fields and any validation details, then correct the payload.

404

Route ID does not exist.

Verify the target identifier and that its endpoint or plugin route still exists.

409

Idempotency key is in flight.

Check the device’s current mode or state. Retry only after the conflict is resolved.

412

If-Match does not match.

Inspect the returned code and family and follow the error handling guide.

422

Idempotency key payload conflict.

Correct the rejected value using the constraints in the error details or request schema.

428

Replacement requires If-Match.

Inspect the returned code and family and follow the error handling guide.

500

Internal server error

Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.

Get Route

View source specification ↗
GET /routes/{id}

Reads the authorized stored route, including provider observations and the current writable-document ETag for a subsequent replacement or delete.

Required scope

endpoint:read

Path parameters

idstringRequired

URL-encoded complete route identifier.

Returns

200

Route retrieved.

Fields
etagstringRequired

Opaque strong version of the writable route document. Send in If-Match when replacing or deleting. Provider observations do not advance it.

pluginProfileIdstring

Stable profile ID selected from the registered plugin declaration. Required for V2 plugin discovery; retained with the route for admission and presentation.

minLength: 1

idstringRequired

The server-assigned, owner-scoped Port OS route identifier. Use this ID when replacing or deleting a stored route. Provider input uses the separate ProviderDiscoveredRoute schema; its id may identify an existing authorized route only. Use associatedPluginRouteId to match the stable plugin-native identity across reports.

pattern: "^port1/[^/]+/[^/]+/routes/[^/]+$"

associatedPluginIdstringRequired

The ID of the associated plugin

associatedPluginRouteIdstringRequired

The stable plugin-owned route identifier associated with this Port OS route. For synchronized plugin capability contracts and fixture parity checks, use this field to match a route from enumeration back to the discovery payload.

externalIdstringRequired

The external ID of the route given by the reporting system

associatedAuthLinkIdstringRequired

The ID of the associated auth link

associatedEndpointIdstringRequired

The ID of the associated endpoint

nameTypeValue

The name of the route as a human readable string or a localizable asset. This is either a raw string or a localizable asset reference.

interfacesarray<RouteInterface>Required

List of interfaces supported by the route. These denote what the route is capable of performing such as turning off/on, etc.

namestringRequired

The name of the interface

versionstring

the version of the interface

messagesarray<ApplicationInterfaceMessage>

Supported inbound message subset for the declared interface version. An omitted or empty list declares no supported messages; null also declares none. A supplied array contains distinct canonical names for implemented messages.

nullable: true

namestringRequired

The name of the command

attributesarray<ApplicationInterfaceAttribute>

Supported attribute subset. An omitted or empty list declares no supported attributes.

namestringRequired

The name of the attribute

valueobject

the value of the attribute, this is an opaque resource object, so it can be any type of struct.

configurationobject

The configuration of the interface

ontologicalTypesarray<string>Required

List of ontological types for the route. These are used mostly for customers to know what an endpoint is, like if its a lightbulb, or a speaker, etc.

pluginCustomMetadataobject

A set of custom metadata that the plugin uses and attaches to the route, this is meant specifically for the plugin to use.

descriptionTypeValue

The description of the route as a human readable string or a localizable asset.

manufacturerTypeValue

The manufacturer of the route as a human readable string or a localizable asset.

modelTypeValue

The model of the route as a human readable string or a localizable asset.

serialNumberTypeValue

The serial number of the route as a human readable string or a localizable asset.

Response headers
ETagstring

Opaque strong entity tag of the returned resource version. Send it back in `If-Match` on the next mutation of the same resource.

Errors

404

Route not found.

Verify the target identifier and that its endpoint or plugin route still exists.

Delete Route

View source specification ↗
DELETE /routes/{id}

Deletes an existing route and fences its event sources atomically. Receipts are retained for 24 hours.

Required scope

endpoint:write

Path parameters

idstringRequired

URL-encoded complete route identifier.

Header parameters

Idempotency-KeystringRequired

Client-chosen key that makes a non-idempotent request retry-safe, following draft-ietf-httpapi-idempotency-key-header. A committed response is stored for 24 hours and replayed for the same principal, operation, key and payload. Missing key returns 400 IDEMPOTENCY_KEY_REQUIRED, a key longer than 255 characters returns 400 IDEMPOTENCY_KEY_INVALID, the same key with a different payload returns 422, and the same key while the first request is still in flight returns 409. Requests rolled back before external provider attempts do not consume the key. Group mutations retain terminal failed responses after provider attempts together with received provider truth; their operation contract defines these replayable outcomes.

minLength: 1

maxLength: 255

If-MatchstringRequired

The quoted strong entity tag of the resource the client last read (its `etag` field or `ETag` response header). The mutation is applied only when it still matches: a stale value returns 412 PRECONDITION_FAILED and a missing header returns 428 PRECONDITION_REQUIRED. Wildcards are accepted only where the operation explicitly permits them.

minLength: 1

Returns

200

Route deleted.

No response body.

Errors

400

Invalid request, missing Idempotency-Key, or a request body was supplied.

Check the request fields and any validation details, then correct the payload.

404

Route not found.

Verify the target identifier and that its endpoint or plugin route still exists.

409

Idempotency key in flight.

Check the device’s current mode or state. Retry only after the conflict is resolved.

412

Stale If-Match.

Inspect the returned code and family and follow the error handling guide.

422

Idempotency key payload conflict.

Correct the rejected value using the constraints in the error details or request schema.

428

Missing If-Match.

Inspect the returned code and family and follow the error handling guide.

Manage Provider Routes

View source specification ↗
POST /routes-manage

Atomically reconciles one provider report, including routes, endpoint creation and the provider group graph. Reported state is observed state; it cannot replace customer route documents or their associations. Partial reports never prune omitted routes. IDs on reports may identify existing routes only; new resources receive server-assigned IDs. Response receipts are retained for 24 hours.

Required scope

Any authenticated access token

Header parameters

Idempotency-KeystringRequired

Client-chosen key that makes a non-idempotent request retry-safe, following draft-ietf-httpapi-idempotency-key-header. A committed response is stored for 24 hours and replayed for the same principal, operation, key and payload. Missing key returns 400 IDEMPOTENCY_KEY_REQUIRED, a key longer than 255 characters returns 400 IDEMPOTENCY_KEY_INVALID, the same key with a different payload returns 422, and the same key while the first request is still in flight returns 409. Requests rolled back before external provider attempts do not consume the key. Group mutations retain terminal failed responses after provider attempts together with received provider truth; their operation contract defines these replayable outcomes.

minLength: 1

maxLength: 255

Request body

Required

Fields

operationsarray<RouteManageOperation>Required

One atomic provider report, containing up to 1000 routes and their graph.

One caller-correlated provider discovery report applied atomically.

requestIdstringRequired

Client-chosen identifier for one operation in a batch request. It must be unique within the request and is echoed in the matching result or error so items are correlated by ID, never by position.

minLength: 1

maxLength: 64

reportSynchronizationRequestRequired

Provider observations of routes, group routes and their relationships. New routes omit id and receive server-assigned identifiers. A supplied id must name an existing authorized route; an unknown id returns 404. Reported observations cannot replace the customer's writable route document. Match routes across reports by associatedPluginRouteId. Omitted group routes and relationships are not deletion instructions. References must resolve to committed data or to another item of the same report.

Returns

200

Per-report results and errors. An error means the entire report rolled back.

Fields
statusstringRequired

COMMITTED means all customer operations applied. PARTIALLY_SUCCEEDED means they applied with a reported provider fallback. FAILED means customer intent did not commit; operation-specific contracts state whether already received provider observations are retained.

Allowed values

  • COMMITTED
  • FAILED
  • PARTIALLY_SUCCEEDED
resultsarray<RouteManageResult>Required

The stored routes for one committed, caller-correlated provider discovery report.

requestIdstringRequired

Client-chosen identifier for one operation in a batch request. It must be unique within the request and is echoed in the matching result or error so items are correlated by ID, never by position.

minLength: 1

maxLength: 64

routesarray<Route>Required
etagstringRequired

Opaque strong version of the writable route document. Send in If-Match when replacing or deleting. Provider observations do not advance it.

pluginProfileIdstring

Stable profile ID selected from the registered plugin declaration. Required for V2 plugin discovery; retained with the route for admission and presentation.

minLength: 1

idstringRequired

The server-assigned, owner-scoped Port OS route identifier. Use this ID when replacing or deleting a stored route. Provider input uses the separate ProviderDiscoveredRoute schema; its id may identify an existing authorized route only. Use associatedPluginRouteId to match the stable plugin-native identity across reports.

pattern: "^port1/[^/]+/[^/]+/routes/[^/]+$"

associatedPluginIdstringRequired

The ID of the associated plugin

associatedPluginRouteIdstringRequired

The stable plugin-owned route identifier associated with this Port OS route. For synchronized plugin capability contracts and fixture parity checks, use this field to match a route from enumeration back to the discovery payload.

externalIdstringRequired

The external ID of the route given by the reporting system

associatedAuthLinkIdstringRequired

The ID of the associated auth link

associatedEndpointIdstringRequired

The ID of the associated endpoint

nameTypeValue

The name of the route as a human readable string or a localizable asset. This is either a raw string or a localizable asset reference.

interfacesarray<RouteInterface>Required

List of interfaces supported by the route. These denote what the route is capable of performing such as turning off/on, etc.

namestringRequired

The name of the interface

versionstring

the version of the interface

messagesarray<ApplicationInterfaceMessage>

Supported inbound message subset for the declared interface version. An omitted or empty list declares no supported messages; null also declares none. A supplied array contains distinct canonical names for implemented messages.

nullable: true

namestringRequired

The name of the command

attributesarray<ApplicationInterfaceAttribute>

Supported attribute subset. An omitted or empty list declares no supported attributes.

namestringRequired

The name of the attribute

valueobject

the value of the attribute, this is an opaque resource object, so it can be any type of struct.

configurationobject

The configuration of the interface

ontologicalTypesarray<string>Required

List of ontological types for the route. These are used mostly for customers to know what an endpoint is, like if its a lightbulb, or a speaker, etc.

pluginCustomMetadataobject

A set of custom metadata that the plugin uses and attaches to the route, this is meant specifically for the plugin to use.

descriptionTypeValue

The description of the route as a human readable string or a localizable asset.

manufacturerTypeValue

The manufacturer of the route as a human readable string or a localizable asset.

modelTypeValue

The model of the route as a human readable string or a localizable asset.

serialNumberTypeValue

The serial number of the route as a human readable string or a localizable asset.

errorsarray<BatchItemError>Required

Error for one operation of an atomic batch, correlated by the operation's `requestId`. `status` is the HTTP status the operation would have returned on its own.

requestIdstringRequired

Client-chosen identifier for one operation in a batch request. It must be unique within the request and is echoed in the matching result or error so items are correlated by ID, never by position.

minLength: 1

maxLength: 64

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

statusintegerRequired

HTTP-equivalent status code of the item failure.

minimum: 400

maximum: 599

messagestringRequired

Plain-language description of the failure and the suggested next action.

resourceIdstring

The resource the failure applies to, when it is not the operation's primary target.

errorsarray<SynchronizationItemError>

Typed validation failures inside this operation when one report contains several rejected routes, interfaces or relationships.

One rejected discovery item of a `SynchronizationRequest`, keyed by the plugin-owned identity of the rejected item: `pluginRouteId` for a route or group route, or `relationshipExternalId` for a relationship. Exactly one of the two is set. It shares the `code`, `family`, `status` and `message` fields of `BatchItemError`; discovery items are keyed by plugin-owned identity because they carry no `requestId`. A request with any rejected item is rejected as a whole and lists every rejected item.

pluginRouteIdstring

Plugin-owned identifier of the rejected route or group route. Set unless the item is a relationship.

relationshipExternalIdstring

Plugin-owned `externalId` of the rejected relationship. Set only for relationship items.

interfacestring

Canonical capability interface name the failure applies to, when the failure is interface-specific.

versionstring

Declared capability interface version the failure applies to, when the failure is interface-specific.

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

statusintegerRequired

HTTP-equivalent status code of the item failure.

minimum: 400

maximum: 599

messagestringRequired

Plain-language description of the failure and the suggested fix.

Errors

400

Invalid request or missing Idempotency-Key.

Check the request fields and any validation details, then correct the payload.

409

Idempotency key in flight.

Check the device’s current mode or state. Retry only after the conflict is resolved.

422

Idempotency key payload conflict.

Correct the rejected value using the constraints in the error details or request schema.