Redeem an approved pairing request for a plugin credential
const url = 'https://example.com/api/plugins/pairing/example/redemption';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"codeVerifier":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/plugins/pairing/example/redemption \ --header 'Content-Type: application/json' \ --data '{ "codeVerifier": "example" }'Unknown, expired, unapproved, already-redeemed and wrong-verifier request/verifier combinations all answer 401 indistinguishably, deliberately - the same oracle argument as registration authentication.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginPairingRedemptionRequest.
object
Examplegenerated
{ "codeVerifier": "example"}Responses
Section titled “Responses”The pairing request was redeemed. The secret is shown exactly once.
Mirrors MacroDeck.Plugin.Protocol.Handshake.PluginRegistrationResponse.
object
Shown exactly once. The host stores only its hash.
Examplegenerated
{ "pluginId": "example", "pluginSecret": "example"}The request body does not match the expected shape.
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"}Authentication failed. An unknown id and a wrong secret are indistinguishable in the response, the same oracle argument as device login.
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"}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"}Too many requests.
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"}