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/Create an API key

Create an API key

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

Create a long-lived platform API key (hive_…) bound to the active team. The plaintext token is returned exactly once — only its SHA-256 hash is stored. Present it as `Authorization: Bearer hive_…` to scope requests to the key's team.

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

namestringRequired

A label for the key (e.g. "ci").

role"owner" | "member"Optional

Role bound to the key (default "member").

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

const data = await response.json();
console.log(data);
Response
json
{
  "id": "key_9f2a1c7b04d14e3e",
  "name": "ci",
  "prefix": "hive_0f3a62b…",
  "team": "acme",
  "role": "member",
  "created_ms": 1781906630000,
  "last_used_ms": 0,
  "token": "hive_…"
}