Pre-registration discovery
const url = 'https://example.com/api/plugins/protocol';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/plugins/protocolReports supported versions, capability kinds, limits and timeouts so a plugin can decide whether and how to register before it holds any credential. No authentication required.
Responses
Section titled “Responses”The protocol descriptor.
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginProtocolDescriptor.
object
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginProtocolLimitsDescriptor.
object
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginProtocolTimeoutsDescriptor. Each field is a .NET TimeSpan serialized in its default “c” format (e.g. “00:00:10” for ten seconds).
object
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginPairingDescriptor. Absent from PluginProtocolDescriptor means the host does not support interactive pairing.
object
Whether the host would accept a pairing request right now. Absent on a host that does not report it, which is not the same as false.
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginEnrollmentDescriptor. Absent from PluginProtocolDescriptor means the host does not report anything about enrolment.
object
Whether the host would accept an enrolment right now. Absent on a host that does not report it, which is not the same as false.
Examplegenerated
{ "supportedVersions": [ 1 ], "capabilityKinds": [ "example" ], "limits": { "maxMessageBytes": 1, "maxAssetBytes": 1, "maxAssetChunkBytes": 1, "maxInboundQueueDepth": 1, "maxOutboundQueueDepth": 1, "queueHighWatermark": 1, "queueLowWatermark": 1, "maxConcurrentInvocations": 1, "maxDeclaredCapabilities": 1, "maxIdempotencyKeyLength": 1, "maxErrorMessageLength": 1, "maxErrorDetailEntries": 1, "maxJsonDepth": 1, "maxSessionsPerPlugin": 1 }, "timeouts": { "handshake": "example", "defaultRequest": "example", "capabilityInvoke": "example", "assetUpload": "example", "keepAliveInterval": "example", "keepAliveTimeout": "example", "sessionResumeWindow": "example", "gracefulClose": "example" }, "pairing": { "supported": true, "requestLifetimeSeconds": 1, "pollIntervalSeconds": 1, "developerModeEnabled": true }, "enrollment": { "developerModeEnabled": true }}The caller did not arrive on a loopback remote address. Plugin endpoints are served on both the public and private listeners, but only local processes may reach them. On the pairing endpoints, on POST /api/plugins/registration, and on POST /api/plugins/sessions for a plugin holding a development credential, this status also means Developer Mode is switched off in the desktop app - such a refusal carries “reason”: “developer_mode_disabled” in the error’s details, and GET /api/plugins/protocol reports the switch ahead of time.
Mirrors MacroDeck.Plugin.Protocol.Errors.ProtocolError.
object
One of the codes v1 speaks. Drift anchor - see x-macrodeck-error-codes above.
Default English text keyed by code (MacroDeck.Plugin.Protocol.Errors.ProtocolErrorMessages). The UI localises from the code, not this string.
object
Example
{ "code": "PROTOCOL_VERSION_UNSUPPORTED"}