shadwshadw/Docs
GuidesAPIGetting Started
Dashboard
shadw REST APIOverviewErrors
  • POSTCreate an API key
  • GETList API keys
  • DELRevoke an API key
  • POSTMint a token
APIs & SDKs/shadw REST API/Mint a token

Mint a token

POSThttps://api.shadw.cloud/v1/token

Mint a short-lived (8 h) JWT bearer token scoped to a team + role. Requires HIVE_JWT_SECRET to be configured on the node (returns 400 otherwise). When JWT auth is enforced, mutating requests must present a JWT.

Authentication

AuthorizationbearerToken

A platform API key (hive_…, created under Settings → API Keys) or a short-lived JWT minted with POST /v1/token. An API key scopes the request to the team it was created under.

Body parameters

substringOptional

Subject / user id embedded in the token (default "user").

tenantstringOptional

Team slug the token is scoped to (default "default").

role"owner" | "member" | "service"Optional

Role embedded in the token (default "owner").

ts
const response = await fetch('https://api.shadw.cloud/v1/token', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY', // hive_… (Settings → API Keys)
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "sub": "sub",
    "tenant": "tenant",
    "role": "owner"
  }),
});

const data = await response.json();
console.log(data);
Response
json
{ "token": "eyJhbGciOiJIUzI1NiJ9…", "expires_in": 28800 }