Your tenant (limits, relay scope, public key, this month's spend)
secretKeyAuthorizationBearer <token>sk_...
the tenant
application/json- response
id?stringname?stringscope?|the relay URL path (/tn_...); null for the default tenant
relays?array<string>issuer?stringaudience?stringpublic_key_pem?stringsecret_keys?array<>publishable_keys?array<string>limits?set by the operator; every field has a value
spend_cap_usd?number|nullwebhook_url?string|nullstreams?integermonth?secret_key?stringon create only
webhook_secret?stringwhen a webhook is set, once
curl -X GET 'https://api.nearglass.com/v1/tenant'{ "id": "string", "name": "string", "scope": "string", "relays": [ "string" ], "issuer": "string", "audience": "string", "public_key_pem": "string", "secret_keys": [ { "hint": "string", "created_at": "string" } ], "publishable_keys": [ "string" ], "limits": { "viewer_cap": 0, "max_streams": 0, "max_sessions": 0, "max_publishers": 0, "max_egress_mbps": 0, "max_spend_cap_usd": 0 }, "spend_cap_usd": 0, "webhook_url": "string", "streams": 0, "month": { "month": "string", "viewer_hours": 0, "gib": 0, "bytes": 0, "free_viewer_hours": 0, "free_gib": 0, "prices": { "per_gib_usd": 0, "per_viewer_hour_usd": 0 }, "spend_usd": 0, "spend_cap_usd": 0, "percent_of_cap": 0, "cap_reached": true, "alerts": [ { "percent": 50, "at": "2019-08-24T14:15:22Z" } ] }, "secret_key": "string", "webhook_secret": "string"}A new publishable key for your tenant (at most 4; revoke_others rotates) POST
Publishable keys are public by design (pages carry them) and are listed in `GET /v1/tenant`. With `revoke_others` the new key is the only one: pages with an old key are refused new seats (401), and seats already held keep working (a seat id is its own bearer). The default tenant's keys are the environment's (409 `default_tenant`).
Set your monthly spending cap or webhook PATCH
`spend_cap_usd` up to the tenant's `limits.max_spend_cap_usd`. At the cap, new viewers are refused (402 `spend_cap_reached`) and viewers already in keep watching; alerts go out at 50, 80 and 100 %. A new cap re-arms the alerts. Setting `webhook_url` answers a new `webhook_secret` once; `null` removes the webhook. Name and limits are the operator's (403).