List your Nodes
const url = 'https://app.caprid.com/v1/organizations/4/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/organizations/4/nodes \ --header 'Authorization: Bearer <token>'Every Node the Organization has enrolled, running or not.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The Organization’s id, from GET /v1/organizations.
Example
4Responses
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" }]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"}No such thing, or not yours. Another customer’s Organization or Namespace is a 404 too, so nobody can tell which ones exist.
object
Example
{ "error": "the requested grants exceed the key's scope"}