Documentation menuManagement API

Management API

Automate sites, settings and server keys from CI or infrastructure as code with scoped workspace API keys, route by route.

On this page

API keys #

Owners and admins create management API keys in the console (API keys). A key belongs to one workspace, is shown once, is stored only as a hash and expires after 7, 30, 90 or 365 days, or never. Revoke it at any time; requests with a revoked or expired key get 401 invalid_api_key. Creating and revoking keys needs a fresh second factor, and workspace owners get an email each time.

A key never outlives its creator's rights: it works only while the person who created it is an owner or admin of the workspace. Removing that person, making them a member, their leaving the workspace or deleting their account revokes the keys they created; give automation that must survive staff changes a key created by a long-term admin, and rotate it when people leave.

Scopes #

ScopeAllows
readSites, their settings, health, decision log, refusals, analytics and usage, their CSV exports, and the workspace name
sites:writeCreate sites, save drafts, publish settings, verify domains, rename sites and set their alert rules
keys:writeCreate, revoke and name site server keys
billing:readWallet, ledger, orders, receipts, statements and billing CSV exports

Pausing, locking down or resuming protection (also publishing a version that pauses or locks down), deleting sites, top-ups and the warning threshold, notification destinations, members, invitations, ownership, the audit log, API keys, the export and deletion are console-only: they concern people, money, secrets or switching protection off. A key gets 403 session_required for them, and 403 scope_required for a route whose scope it lacks. A console route added later stays console-only until it is listed here. A key with keys:write creates and revokes server keys without a fresh second factor (the key is the credential for that automation); the same changes from a console session ask for one.

RouteWhat it doesAPI key
GET /v1/console/sitesList sites with their setup healthread
POST /v1/console/sitesCreate a site (returns its first secret key)sites:write
GET /v1/console/sites/{id}A site with keys, hostnames and versionsread
POST /v1/console/sites/{id}/draftSave a settings draftsites:write
POST /v1/console/sites/{id}/publishPublish a settings versionsites:write
POST /v1/console/sites/{id}/stateResume, pause or lock down protectionConsole only
POST /v1/console/sites/{id}/verify-domainCheck a hostname's DNS TXT recordsites:write
POST /v1/console/sites/{id}/keysCreate a server key (shown once)keys:write
POST /v1/console/sites/{id}/revoke-keyRevoke a server keykeys:write
POST /v1/console/sites/{id}/key-labelName a server keykeys:write
POST /v1/console/sites/{id}/renameRename a sitesites:write
POST /v1/console/sites/{id}/deleteDelete a siteConsole only
POST /v1/console/sites/{id}/alertsSet the site's alert rulessites:write
GET /v1/console/sites/{id}/liveInstallation check: recent verificationsread
GET /v1/console/sites/{id}/eventsDecision log (seven days)read
GET /v1/console/sites/{id}/refusalsRefusals counted per minute (seven days): browser side, or phase=verificationread
GET /v1/console/sites/{id}/analyticsDaily decision countsread
GET /v1/console/sites/{id}/events.csvDecision log as CSVread
GET /v1/console/sites/{id}/analytics.csvDaily decision counts as CSVread
GET /v1/console/sites/{id}/usageAccepted verifications per dayread
GET /v1/console/sites/{id}/ledgerLedger rows of one site (legacy)billing:read
POST /v1/console/sites/{id}/topupsTop up from a site page (legacy)Console only
GET /v1/console/billingWallet, plan, usage and forecastbilling:read
GET /v1/console/billing/statusBilling state for banners and badgesbilling:read
GET /v1/console/billing/ledgerCredit ledgerbilling:read
GET /v1/console/billing/ordersTop-up ordersbilling:read
GET /v1/console/billing/orders/{id}A top-up receiptbilling:read
GET /v1/console/billing/statementsMonths with a statementbilling:read
GET /v1/console/billing/statementA month's statementbilling:read
GET /v1/console/billing/exportLedger or usage as CSVbilling:read
POST /v1/console/billing/topupsStart a top-up (WayCash checkout)Console only
POST /v1/console/billing/thresholdSet the low-balance warningConsole only
GET /v1/console/workspaceThe workspace's name and your roleread
POST /v1/console/workspaceRename the workspaceConsole only
GET /v1/console/membersList membersConsole only
GET /v1/console/invitationsList pending invitationsConsole only
POST /v1/console/invitationsInvite someoneConsole only
POST /v1/console/invitations/revokeRevoke an invitationConsole only
POST /v1/console/accept-invitationAccept an invitationConsole only
POST /v1/console/members/removeRemove a memberConsole only
POST /v1/console/members/roleChange a member's roleConsole only
POST /v1/console/leaveLeave the workspaceConsole only
POST /v1/console/transfer-ownershipTransfer ownership to an adminConsole only
GET /v1/console/auditAudit logConsole only
GET /v1/console/audit/actorsPeople and keys in the audit logConsole only
GET /v1/console/exportExport the workspace as JSONConsole only
POST /v1/console/workspace/deleteAsk to delete the workspace (emails a link)Console only
GET /v1/console/api-keysList management API keysConsole only
POST /v1/console/api-keysCreate a management API key (shown once)Console only
POST /v1/console/api-keys/revokeRevoke a management API keyConsole only
GET /v1/console/notificationsNotification destinations and deliveryConsole only
POST /v1/console/notificationsAdd a notification destination (webhook secret shown once)Console only
POST /v1/console/notifications/{id}/toggleEnable or disable a destinationConsole only
POST /v1/console/notifications/{id}/deleteDelete a destinationConsole only
POST /v1/console/notifications/testSend a test notificationConsole only

Requests #

Send the key as a bearer token. No cookie, Origin header or CSRF token is involved, and the key's workspace is used (an X-Workspace-Id header, if sent, must match it).

Shell
curl -sS https://blockalt.click/v1/console/sites \
  -H "Authorization: Bearer $BLOCKALT_API_KEY"
Shell
# Rotate a site's server key from CI (scope keys:write)
curl -sS -X POST https://blockalt.click/v1/console/sites/$SITE_ID/keys \
  -H "Authorization: Bearer $BLOCKALT_API_KEY" \
  -H "Content-Type: application/json" -d '{}'

Every route, with its request schema, is in the OpenAPI document under the managementKey security scheme. Changes made with a key appear in the audit log under the key's name.

Limits #

Each key can make about 10 requests a second (bursts of 600); writes also count toward the workspace's limits. Over the limit, the answer is 429 rate_limited with Retry-After.

Something unclear or missing on this page? Write to support@blockalt.click.