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.

Base URL
https://api.getentropy.dev

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/tokens with the tokens:write scope.
  • 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-ID header that does not match the token returns 403 tenant_mismatch.
  • No signing keys: api.getentropy.dev never 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.

ScopePermitted Operations
accounts:readList accounts, fetch account details, list enrolment codes
accounts:writeCreate, update, suspend, restore, and schedule account deletion; mint and revoke enrolment codes
seats:readList seats across the tenant or per account; inspect seat hardware components
seats:writeUpdate seat status, trust tier, or entitlements; revoke/release seats; kick live WebSocket sessions
bans:readList active and expired hardware component bans
bans:writeCreate 1–3 year hardware component or TPM EK bans; remove bans
apps:readList apps and inspect epoch or relay settings
apps:writeCreate apps and update app settings
releases:readList releases and inspect builds attached to a release
releases:writeCreate, promote, retire, and delete releases
builds:readList and inspect build metadata
builds:writeKill builds with instant seat disconnect; delete killed or retired build records
logs:readList HPKE-sealed log batch objects stored in R2
tokens:readList tenant API token metadata (never returns plaintext secrets)
tokens:writeMint 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

POST/v1/accountsscope: accounts:write

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
  }'
// 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

POST/v1/accounts/{guid}/enrolment-codesscope: accounts:write
DELETE/v1/accounts/{guid}/enrolment-codes/{code_id}scope: accounts:write

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
  }'

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.

PATCH/v1/accounts/{guid}scope: accounts:write
DELETE/v1/accounts/{guid}?hold_days=28scope: accounts:write
POST/v1/accounts/{guid}/restorescope: accounts:write
PATCH/v1/seats/{install_id}scope: seats:write
DELETE/v1/seats/{install_id}scope: seats:write
POST/v1/seats/{install_id}/kickscope: seats:write
# 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"
Deletion hold: 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.

GET/v1/bansscope: bans:read
POST/v1/bansscope: bans:write
DELETE/v1/bans/{ban_id}scope: bans:write

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"

Releases & Build Kill Operations

Automate release staging, promotion, retirement, and emergency build kills from CI/CD or incident response scripts.

POST/v1/releasesscope: releases:write
PATCH/v1/releases/{id}scope: releases:write
DELETE/v1/releases/{id}?force=truescope: releases:write
POST/v1/builds/{build_id}/killscope: builds:write
DELETE/v1/builds/{build_id}scope: builds:write
# 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"
Force deletion: 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"
  }
}
StatusConditionMeaning
400Bad RequestMalformed JSON, invalid UUID, out-of-range integer, or missing required field.
401UnauthorizedMissing Authorization header, unknown token, expired token, or revoked token.
403ForbiddenToken lacks the required scope (see details.required_scope) or X-Tenant-ID mismatch.
404Not FoundResource does not exist inside the authenticated tenant.
409ConflictDuplicate resource or invalid state transition (for example deleting an active release without ?force=true).
429Too Many RequestsRate limit exceeded. Back off exponentially before retrying.
503Service UnavailableDownstream binding unavailable (for example SIGNER during raw hardware value hashing or R2 for logs).