Home / Docs / API reference

/v1/policy

GET /v1/policy

Authentication relay key (bearer)

Example request

curl
curl https://api.massrelay.ai/v1/policy \
  -H "Authorization: Bearer $RELAY_KEY"
Python
import os, requests

r = requests.get(
    "https://api.massrelay.ai/v1/policy",
    headers={"Authorization": f"Bearer {os.environ['RELAY_KEY']}"},
)
r.raise_for_status()
print(r.json())
TypeScript
const r = await fetch("https://api.massrelay.ai/v1/policy", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.RELAY_KEY}` },
});
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
console.log(await r.json());

Response

FieldTypeDescription
error requiredstring Always "not_ported".
route requiredstring Always "GET /v1/policy".
Example response (shape)
{
  "error": "not_ported",
  "route": "GET /v1/policy"
}

Common errors

  • 401 invalid_api_key
  • 403 insufficient_scope
  • 429 over the request rate; read Retry-After

Every error has the same JSON shape; see Errors and Limits.

Full schema (JSON)

Response schema

{
  "description": "Today the door authenticates the key and then answers 501; it returns no policy document. The shape below is that 501 body, stated so a caller does not expect more.",
  "type": "object",
  "required": [
    "error",
    "route"
  ],
  "properties": {
    "error": {
      "const": "not_ported"
    },
    "route": {
      "const": "GET /v1/policy"
    }
  },
  "x-massrelay-status": 501
}