Check a Client token
const url = 'https://app.caprid.com/v1/namespaces/acme/tokens/verify';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"token":"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://app.caprid.com/v1/namespaces/acme/tokens/verify \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Verifies a token against this Namespace’s Signing keys and returns its claims. Use it to debug a token a relay refuses. A token signed by any other Namespace’s key gets a 401.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A Namespace’s name, which is the root of every path signed for it.
It never changes. Use lowercase letters, digits and hyphens, and start
and end with a letter or digit. Some names, like admin and
default, are reserved, and so is every name that starts with
trial-, which only Trial Organizations get.
Example
acmeRequest Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "token": "example"}Responses
Section titled “Responses”The token is valid.
object
A Client token’s payload. root is absolute and starts with your
Namespace. put (publish) and get (subscribe) are prefixes relative
to root.
object
When the token expires. Absent for a token that never expires.
When the token was issued.
Seconds left. Absent for a token that never expires.
Example
{ "claims": { "root": "acme/room/42", "get": [ "" ] }}The request is malformed or a field is invalid. The message says which.
object
Example
{ "error": "the requested grants exceed the key's scope"}The token is malformed, expired, has a bad signature, or wasn’t signed by one of this Namespace’s keys. Also returned when the caller isn’t authenticated.
object
Example
{ "error": "the requested grants exceed the key's scope"}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"}