Management API v1 · OpenAPI 3.1.0
Entropy Management API
Programmatic HTTP interface for connecting billing backends, game panels, and internal ops tools to the Entropy control plane. Manage zero-PII accounts, single-use enrolment codes, hardware seats, bans, releases, builds, and scoped API tokens over HTTPS JSON.
Authentication
Every /v1/* endpoint requires a tenant-scoped Bearer token in theAuthorization header. Tokens use the ent_live_ prefix followed by 43 unpadded base64url characters (256 bits of entropy).
Authorization: Bearer ent_live_...- Create tokens in app.getentropy.dev under Settings → API Tokens (owner/admin), or programmatically via
POST /v1/tokenswith thetokens:writescope. - Shown once: Entropy stores only a SHA-256 hex digest and the 16-character prefix (
ent_live_...). Store the plaintext secret in your secret manager immediately on creation. - Tenant isolation: Each token is bound to a single tenant enforced by Postgres Row-Level Security. Passing an
X-Tenant-IDheader that does not match the token returns403 tenant_mismatch. - No signing keys:
api.getentropy.devnever exposes signing keys, HPKE decryption keys, or lease-minting endpoints.
Scopes
Tokens are denied by default and checked against the exact scope required by each route. Assign the narrowest read/write scopes each integration needs. A token callingPOST /v1/tokens can only grant scopes it already holds.
| Scope | Permitted Operations |
|---|---|
accounts:read | List accounts, fetch account details, list enrolment codes |
accounts:write | Create, update, suspend, restore, and schedule account deletion; mint and revoke enrolment codes |
seats:read | List seats across the tenant or per account; inspect seat hardware components |
seats:write | Update seat status, trust tier, or entitlements; revoke/release seats; kick live WebSocket sessions |
bans:read | List active and expired hardware component bans |
bans:write | Create 1–3 year hardware component or TPM EK bans; remove bans |
apps:read | List apps and inspect epoch or relay settings |
apps:write | Create apps and update app settings |
releases:read | List releases and inspect builds attached to a release |
releases:write | Create, promote, retire, and delete releases |
builds:read | List and inspect build metadata |
builds:write | Kill builds with instant seat disconnect; delete killed or retired build records |
logs:read | List HPKE-sealed log batch objects stored in R2 |
tokens:read | List tenant API token metadata (never returns plaintext secrets) |
tokens:write | Mint scoped API tokens (subset of caller scopes) and revoke tokens |
* | Full tenant access across every endpoint |
Provisioning Accounts & Enrolment Codes
Entropy accounts are zero-PII UUIDs (account_guid). Map each customer record in your billing database to their account_guid — or pass your own canonical UUID in POST /v1/accounts.
Single-call provisioning
Pass create_enrolment_code: true to create the account and mint its first single-use enr_... code atomically in one transaction. The response returnsenrolment_code.code once; subsequent reads only expose code metadata.
curl -X POST https://api.getentropy.dev/v1/accounts \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"seat_limit": 3,
"entitlements": ["pro", "offline"],
"create_enrolment_code": true,
"product_id": "core",
"code_ttl_minutes": 15
}'interface EnrolmentCodeCreated {
id: string;
code: string;
product_id: string;
expires_at: string;
ttl_seconds: number;
created_at: string;
}
interface AccountCreated {
account_guid: string;
tenant_id: string;
seat_limit: number;
entitlements: string[];
status: 'active' | 'suspended' | 'pending_deletion' | 'banned';
enrolment_code?: EnrolmentCodeCreated | null;
}
const res = await fetch('https://api.getentropy.dev/v1/accounts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ENTROPY_API_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
seat_limit: 3,
entitlements: ['pro', 'offline'],
create_enrolment_code: true,
product_id: 'core',
code_ttl_minutes: 15,
}),
});
if (!res.ok) throw new Error(`Entropy API error ${res.status}: ${await res.text()}`);
const created: AccountCreated = await res.json();
// Deliver created.enrolment_code.code once to the customer; store created.account_guid.package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"os"
)
type CreateAccountRequest struct {
SeatLimit int `json:"seat_limit"`
Entitlements []string `json:"entitlements,omitempty"`
CreateEnrolmentCode bool `json:"create_enrolment_code"`
ProductID string `json:"product_id,omitempty"`
CodeTTLMinutes int `json:"code_ttl_minutes,omitempty"`
}
type AccountCreated struct {
AccountGUID string `json:"account_guid"`
SeatLimit int `json:"seat_limit"`
Status string `json:"status"`
EnrolmentCode *struct {
ID string `json:"id"`
Code string `json:"code"`
ProductID string `json:"product_id"`
ExpiresAt string `json:"expires_at"`
} `json:"enrolment_code"`
}
func provisionCustomer(ctx context.Context) (*AccountCreated, error) {
body, _ := json.Marshal(CreateAccountRequest{
SeatLimit: 3,
Entitlements: []string{"pro", "offline"},
CreateEnrolmentCode: true,
ProductID: "core",
CodeTTLMinutes: 15,
})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.getentropy.dev/v1/accounts", bytes.NewReader(body))
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusCreated {
return nil, fmt.Errorf("unexpected status %d", resp.StatusCode)
}
var out AccountCreated
return &out, json.NewDecoder(resp.Body).Decode(&out)
}// 201 Created
{
"account_guid": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "11111111-1111-1111-1111-111111111111",
"seat_limit": 3,
"entitlements": ["pro", "offline"],
"status": "active",
"delete_after": null,
"created_at": "2026-12-02T21:00:00.000Z",
"updated_at": "2026-12-02T21:00:00.000Z",
"enrolment_code": {
"id": "9a7b4f12-0c3d-4e5a-8b9c-1234567890ab",
"code": "enr_0123456789abcdef0123456789abcdef",
"product_id": "core",
"expires_at": "2026-12-02T21:15:00.000Z",
"ttl_seconds": 900,
"created_at": "2026-12-02T21:00:00.000Z"
}
}Minting or revoking additional enrolment codes
Mint additional codes for existing accounts with ttl_minutes (1–1440) orttl_seconds (60–86400, default 600). Unconsumed codes can be deleted before expiry.
# Mint an additional single-use enrolment code for an existing account
curl -X POST "https://api.getentropy.dev/v1/accounts/$ACCOUNT_GUID/enrolment-codes" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_id": "core",
"ttl_minutes": 10
}'const res = await fetch(
`https://api.getentropy.dev/v1/accounts/${accountGuid}/enrolment-codes`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ENTROPY_API_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
product_id: 'core',
ttl_minutes: 10,
}),
},
);
if (!res.ok) throw new Error(`Mint failed: ${res.status}`);
const { id, enrolment_code, expires_at } = (await res.json()) as {
id: string;
enrolment_code: string;
expires_at: string;
};payload := []byte(`{"product_id":"core","ttl_minutes":10}`)
url := fmt.Sprintf("https://api.getentropy.dev/v1/accounts/%s/enrolment-codes", accountGUID)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(payload))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
var minted struct {
ID string `json:"id"`
EnrolmentCode string `json:"enrolment_code"`
ExpiresAt string `json:"expires_at"`
}
if err := json.NewDecoder(resp.Body).Decode(&minted); err != nil {
return err
}Modifying Seats & Account State
Sync subscription upgrades, payment failures, hardware resets, and cancellations directly from your billing webhooks. State changes that revoke access immediately push a kill frame to live client sessions through HeartbeatDO.
# 1. Update seat_limit or suspend an account (suspending disconnects active seats)
curl -X PATCH "https://api.getentropy.dev/v1/accounts/$ACCOUNT_GUID" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"seat_limit": 5, "status": "active"}'
# 2. Restore a suspended or pending_deletion account
curl -X POST "https://api.getentropy.dev/v1/accounts/$ACCOUNT_GUID/restore" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN"
# 3. Kick a live WebSocket session without revoking the seat
curl -X POST "https://api.getentropy.dev/v1/seats/$INSTALL_ID/kick" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason": "billing_sync"}'
# 4. Revoke and release a seat slot immediately (+ instant WS kill)
curl -X DELETE "https://api.getentropy.dev/v1/seats/$INSTALL_ID" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN"const headers = {
Authorization: `Bearer ${process.env.ENTROPY_API_TOKEN}`,
'Content-Type': 'application/json',
};
// Update seat_limit (or set status: 'suspended' to disconnect active sessions)
await fetch(`https://api.getentropy.dev/v1/accounts/${accountGuid}`, {
method: 'PATCH',
headers,
body: JSON.stringify({ seat_limit: 5, status: 'active' }),
});
// Restore a suspended or pending_deletion account
await fetch(`https://api.getentropy.dev/v1/accounts/${accountGuid}/restore`, {
method: 'POST',
headers: { Authorization: headers.Authorization },
});
// Kick a single install's live WebSocket session without removing its seat
await fetch(`https://api.getentropy.dev/v1/seats/${installId}/kick`, {
method: 'POST',
headers,
body: JSON.stringify({ reason: 'billing_sync' }),
});
// Permanently revoke and release the seat slot (+ instant WS kill)
await fetch(`https://api.getentropy.dev/v1/seats/${installId}`, {
method: 'DELETE',
headers: { Authorization: headers.Authorization },
});func updateSeatLimit(ctx context.Context, accountGUID string, seatLimit int) error {
body, _ := json.Marshal(map[string]any{
"seat_limit": seatLimit,
"status": "active",
})
url := fmt.Sprintf("https://api.getentropy.dev/v1/accounts/%s", accountGUID)
req, err := http.NewRequestWithContext(ctx, http.MethodPatch, url, bytes.NewReader(body))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("patch account failed: %d", resp.StatusCode)
}
return nil
}
func revokeSeat(ctx context.Context, installID string) error {
url := fmt.Sprintf("https://api.getentropy.dev/v1/seats/%s", installID)
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, url, nil)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("delete seat failed: %d", resp.StatusCode)
}
return nil
}DELETE /v1/accounts/{guid} returns202 Accepted, disconnects every active seat immediately, and places the account in pending_deletion for 1–28 days (default 28). CallPOST /v1/accounts/{guid}/restore during the hold window to cancel deletion and return the account to active.Hardware Bans & Unbans
Bans are decoupled from accounts and bound to hashed hardware components or a TPM Endorsement Key (smbios, boot_disk, os_id,vol_serial, nic, tpm_ek) with a 365–1095 day TTL.
Pass either a pre-computed 64-hex component_hash_hex (as returned inGET /v1/seats/{install_id}) or a raw_value to hash via per-tenant HMAC. Placeholder values and high-prevalence shared components are filtered and reported under skipped in the response.
# Ban a hardware component (365-1095d TTL) using a hash from GET /v1/seats/{install_id}
curl -X POST https://api.getentropy.dev/v1/bans \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_id": "core",
"reason_code": "tamper",
"ttl_days": 365,
"components": [
{ "component_type": "tpm_ek", "component_hash_hex": "<64-hex-hash>" }
]
}'
# Remove a hardware ban
curl -X DELETE "https://api.getentropy.dev/v1/bans/$BAN_ID" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN"const headers = {
Authorization: `Bearer ${process.env.ENTROPY_API_TOKEN}`,
'Content-Type': 'application/json',
};
const banRes = await fetch('https://api.getentropy.dev/v1/bans', {
method: 'POST',
headers,
body: JSON.stringify({
product_id: 'core',
reason_code: 'tamper',
ttl_days: 365,
components: [
{
component_type: 'tpm_ek',
component_hash_hex: ekHashHex,
},
],
}),
});
if (!banRes.ok) throw new Error(`Ban failed: ${banRes.status}`);
const { ban_id, enforcement, bans, skipped } = await banRes.json();
// Unban later by ban_id
await fetch(`https://api.getentropy.dev/v1/bans/${ban_id}`, {
method: 'DELETE',
headers: { Authorization: headers.Authorization },
});type BanComponentInput struct {
ComponentType string `json:"component_type"`
ComponentHashHex string `json:"component_hash_hex,omitempty"`
RawValue string `json:"raw_value,omitempty"`
}
func createBan(ctx context.Context, productID, ekHashHex string) error {
body, _ := json.Marshal(map[string]any{
"product_id": productID,
"reason_code": "tamper",
"ttl_days": 365,
"components": []BanComponentInput{
{ComponentType: "tpm_ek", ComponentHashHex: ekHashHex},
},
})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.getentropy.dev/v1/bans", bytes.NewReader(body))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusCreated {
return fmt.Errorf("create ban failed: %d", resp.StatusCode)
}
return nil
}
func deleteBan(ctx context.Context, banID string) error {
url := fmt.Sprintf("https://api.getentropy.dev/v1/bans/%s", banID)
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, url, nil)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
return nil
}Releases & Build Kill Operations
Automate release staging, promotion, retirement, and emergency build kills from CI/CD or incident response scripts.
# 1. Create a staged release
curl -X POST https://api.getentropy.dev/v1/releases \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"product_id": "core", "version": "2.4.0", "epoch_id": 4, "status": "staged"}'
# 2. Promote a staged release to active (updates apps.active_epoch_id)
curl -X PATCH "https://api.getentropy.dev/v1/releases/$RELEASE_ID" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "active"}'
# 3. Kill a compromised build and disconnect active seats immediately
curl -X POST "https://api.getentropy.dev/v1/builds/$BUILD_ID/kill" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason": "compromised_binary"}'
# 4. Delete a killed/retired build record (add ?force=true for active builds)
curl -X DELETE "https://api.getentropy.dev/v1/builds/$BUILD_ID" \
-H "Authorization: Bearer $ENTROPY_API_TOKEN"const headers = {
Authorization: `Bearer ${process.env.ENTROPY_API_TOKEN}`,
'Content-Type': 'application/json',
};
// Create a staged release
const relRes = await fetch('https://api.getentropy.dev/v1/releases', {
method: 'POST',
headers,
body: JSON.stringify({
product_id: 'core',
version: '2.4.0',
epoch_id: 4,
status: 'staged',
}),
});
const release = (await relRes.json()) as { id: string };
// Promote staged release to active
await fetch(`https://api.getentropy.dev/v1/releases/${release.id}`, {
method: 'PATCH',
headers,
body: JSON.stringify({ status: 'active' }),
});
// Emergency build kill (+ instant HeartbeatDO WebSocket disconnect)
await fetch(`https://api.getentropy.dev/v1/builds/${buildId}/kill`, {
method: 'POST',
headers,
body: JSON.stringify({ reason: 'compromised_binary' }),
});func promoteRelease(ctx context.Context, releaseID string) error {
url := fmt.Sprintf("https://api.getentropy.dev/v1/releases/%s", releaseID)
req, err := http.NewRequestWithContext(ctx, http.MethodPatch, url, bytes.NewReader([]byte(`{"status":"active"}`)))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("promote release failed: %d", resp.StatusCode)
}
return nil
}
func killBuild(ctx context.Context, buildID, reason string) error {
body, _ := json.Marshal(map[string]any{"reason": reason})
url := fmt.Sprintf("https://api.getentropy.dev/v1/builds/%s/kill", buildID)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(body))
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ENTROPY_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("kill build failed: %d", resp.StatusCode)
}
return nil
}DELETE /v1/releases/{id} rejectsactive releases with 409 unless ?force=true is supplied. Similarly, DELETE /v1/builds/{build_id} requires?force=true unless the build is already killed orretired.Errors & Pagination
All list endpoints return { data, total, limit, offset } (defaultlimit=50, max 200), except GET /v1/logs which uses R2 cursor pagination { data, cursor, truncated }. All timestamps are ISO-8601 UTC.
Error responses return a consistent JSON body with a machine-readable errorcode, a human-readable message, and an optional details object:
{
"error": "insufficient_scope",
"message": "Token lacks required scope: accounts:write",
"details": {
"required_scope": "accounts:write"
}
}| Status | Condition | Meaning |
|---|---|---|
400 | Bad Request | Malformed JSON, invalid UUID, out-of-range integer, or missing required field. |
401 | Unauthorized | Missing Authorization header, unknown token, expired token, or revoked token. |
403 | Forbidden | Token lacks the required scope (see details.required_scope) or X-Tenant-ID mismatch. |
404 | Not Found | Resource does not exist inside the authenticated tenant. |
409 | Conflict | Duplicate resource or invalid state transition (for example deleting an active release without ?force=true). |
429 | Too Many Requests | Rate limit exceeded. Back off exponentially before retrying. |
503 | Service Unavailable | Downstream binding unavailable (for example SIGNER during raw hardware value hashing or R2 for logs). |