List your Nodes
const url = 'https://app.caprid.com/v1/nodes';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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://app.caprid.com/v1/nodes \ --header 'Authorization: Bearer <token>'GET /v1/organizations/{id}/nodes for the API key’s Organization.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The Nodes.
object
The URL the Node’s peers dial, as it was enrolled.
The URL in the normalized form Switchboard uses to tell Nodes apart.
The Organization’s oldest Namespace, kept from before
Organizations. The Node belongs to the whole Organization and
carries all of its Namespaces. null when the Organization has no
Namespaces.
The Client URL, which is where Clients, such as a player page,
reach this relay when that isn’t url. On a private network, url is often
a name no Client can resolve, so whatever hands relay addresses to
Clients reads this instead. It is fixed when the Node is enrolled,
and omitted when the Node has none. Relays never see it, because
peer discovery hands out only url.
Whether the Node came from a Relay enrollment token, so its relay has a Node key.
When its relay last polled, or when it enrolled if it hasn’t polled since.
Whether its relay has polled in the last 90 seconds.
Example
[ { "source": "poll" }]Sent with a session, which may belong to several Organizations. Use the route the message names instead. This route also returns 400 for anything that route would refuse with 400.
object
Example
{ "error": "this route is for API keys; use /v1/organizations/{id}/api-keys"}No valid credential. Missing, expired and revoked credentials all get the same response, and so does an API key whose trial has lapsed. An Agent token from before a claim gets a 401 too, once the claim has made the trial a person’s, with a message saying to get a new token.
object
Example
{ "error": "the requested grants exceed the key's scope"}Headers
Section titled “Headers”Example
Bearer realm="switchboard"Sent with an API key limited to some Namespaces, to a Namespace outside its limit, or to a route that acts on the Organization as a whole. A limited key can never create API keys.
object
Example
{ "error": "this API key is limited to the Namespaces acme-staging, and acme isn't one of them"}