{
"id": "com.fedproxy.temp.xrpc.subscribe",
"defs": {
"main": {
"type": "subscription",
"errors": [
{
"name": "InvalidRequest",
"description": "Malformed or missing registration."
},
{
"name": "Unauthorized",
"description": "Registration signatures do not verify against the issued nonce or did:key, or the nonce is unknown/expired."
}
],
"message": {
"schema": {
"refs": [
"#registered",
"#request",
"#response"
],
"type": "union"
}
},
"parameters": {
"type": "params",
"required": [
"registration"
],
"properties": {
"registration": {
"type": "string",
"description": "The full com.fedproxy.temp.xrpc.registration object as URL-encoded JSON, signing the nonce from getRegistrationNonce. Sent inline (not an AT-URI) so the subscriber needs no PDS to host the record."
}
}
},
"description": "Open a relay channel. The subscriber presents a com.fedproxy.temp.xrpc.registration: a record signed (network.attested.signature) over the nonce previously issued by com.fedproxy.temp.xrpc.getRegistrationNonce. The relay verifies the registration's signatures against the issued nonce and the did:key, then binds the WebSocket to that key. On connect the relay sends a #registered frame with the assigned serviceId/proxyRef; subsequent #request frames carry inbound XRPC calls the subscriber answers with #response frames."
},
"request": {
"type": "object",
"required": [
"requestId",
"method",
"nsid",
"params",
"callerDid"
],
"properties": {
"body": {
"type": "unknown"
},
"nsid": {
"type": "string",
"format": "nsid"
},
"method": {
"type": "string"
},
"params": {
"type": "unknown",
"description": "Query params as a map of string keys to string values."
},
"callerDid": {
"type": "string",
"format": "did"
},
"requestId": {
"type": "string"
}
},
"description": "An inbound XRPC call relayed to the subscriber to handle."
},
"response": {
"type": "object",
"required": [
"requestId",
"status"
],
"properties": {
"body": {
"type": "unknown"
},
"status": {
"type": "integer"
},
"requestId": {
"type": "string"
},
"contentType": {
"type": "string"
}
},
"description": "The subscriber's reply to a #request, keyed by the same requestId."
},
"registered": {
"type": "object",
"required": [
"serviceId",
"proxyRef"
],
"properties": {
"proxyRef": {
"type": "string",
"description": "did:web:HOST#serviceId value callers pass as the atproto-proxy header to route XRPC calls to this subscriber."
},
"serviceId": {
"type": "string",
"description": "Opaque id the relay assigns to this subscriber for the connection lifetime."
}
},
"description": "First frame sent by the relay on connect, assigning this subscriber a serviceId."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}