AI AdminPanel Documentation

Authentication API

Use Keycloak OIDC for browser sign-in and panel API keys for automation. These are panel interfaces, separate from Partner Center's OIDC login and pcp_ tokens.

The earlier password login is switched off wherever Keycloak is configured, which is every installed panel. POST /api/v1/auth/login, /auth/refresh, /auth/register and /auth/totp/verify then answer 404 with the error code not_found, and tokens that login once issued are not accepted as a Bearer credential. Scripts that used /auth/login must use a panel API key instead. The OpenAPI document and the SDKs still list these four operations until they are removed; on an installed panel they do not work.

The panel's own two-factor routes POST /api/v1/auth/totp/setup, /enable and /disable answer 404 (not_found) there too. Sign-in on an installed panel is Keycloak's and never checked the panel's own two-factor, so they could only report "enabled" for a second factor nothing asked for. Two-factor is Keycloak's; see Two-factor authentication below (AI-1438).

OIDC Login Flow

The browser opens GET /api/v1/auth/oidc/login, which redirects to Keycloak using Authorization Code with PKCE and a random state value. The panel remembers both in one short-lived cookie (__Host-aap_oidc_flow, 5 minutes). Keycloak returns to GET /api/v1/auth/oidc/callback with code and state. The callback first checks that the cookie is present and that its state equals the one in the URL; if not, it redirects to the frontend callback with error=invalid_state and does not contact Keycloak. This stops a login that someone else started from being completed in your browser. Otherwise the panel exchanges the code, creates a session, sets the session cookie __Host-aap_session, and redirects to its configured frontend callback. The login handler does not implement a caller-selected redirect query parameter.

EndpointPurpose
GET /api/v1/auth/oidc-configFrontend OIDC configuration
GET /api/v1/auth/oidc/loginBrowser sign-in redirect; 503 if OIDC is unconfigured. ?action=configure-totp adds Keycloak's two-factor setup to the sign-in, ?action=delete-totp&credential=<id> its two-factor removal, ?action=configure-recovery-codes its recovery-codes page, ?action=update-password its password page, ?action=reauth a fresh sign-in before a support action (AI-1458); any other action answers 400
GET /api/v1/auth/oidc/callbackProvider callback, not a direct integration call; requires the state issued by the login redirect
POST /api/v1/auth/oidc/logoutClears the cookie, attempts session-row deletion (which also ends the session's app sign-ons), returns redirect_url for the browser to complete Keycloak logout. When the session holds its ID token, redirect_url carries it as id_token_hint and Keycloak ends its login without asking "Do you want to log out?"
POST /api/v1/auth/logoutWith the session cookie: the same sign-out and the same answer as POST /api/v1/auth/oidc/logout (200 with redirect_url). Up to v2.14.3 it answered 204 and left the session valid. An API key cannot sign out: a personal key gets 400, an organization-bound key 404; revoke the key instead
GET /api/v1/auth/meAuthenticated identity, wrapped in user

Example identity response (synthetic UUID and email):

{
  "user": {
    "id": "10000000-0000-4000-8000-000000000001",
    "email": "admin@example.test",
    "role": "admin",
    "scope": "organization",
    "orgRole": "Reseller"
  }
}

role is the coarse account kind, not a grant. It is admin for every login on the panel side, including the staff of a reseller or another organization, and customer for a portal login. What the login can reach is given by scope:

  • platform: the whole panel.
  • organization: only its own organization and the organizations below it. Platform routes such as /settings and /roles answer 404 to these logins.
  • customer: a portal login.

orgRole is the login's role in its home organization (its oldest organization-wide membership), for example Reseller, Owner or Admin. It is left out when the login has no such membership, or when the role cannot be read. The example above is a reseller's owner.

Logout's JSON response alone does not complete the browser's Keycloak logout; the browser follows redirect_url. Do not assume it revokes every other session. redirect_url can contain the session's ID token (personal data such as the email address): do not log it. Proxy access logs for the Keycloak host may record the query string; only the panel's own origin can read the response from a browser.

Permission Metadata

GET /api/v1/auth/permissions returns the request's permissions array, an optional organization, and a required boolean isPlatformScope. Only the authenticated server permission scope sets this boolean. A platform member with an organization still receives true; a constrained principal without an organization receives false. Missing scope also reports false. Query parameters, request bodies and headers cannot choose platform authority.

Use the boolean together with each action's real permission when deciding what to show. A role label or the presence of an organization is not a substitute. This metadata does not authorize an operation: platform-only routes and action checks still enforce their existing server rules.

The Go SDK's ReadAuthPermissions(ctx) returns typed metadata. Its existing GetAuthPermissions(ctx) error method keeps its signature and discards the body. An older panel without the field decodes to false in the typed reader. The TypeScript PermissionsService.getAuthPermissions() response exposes the boolean in its generated type; runtime consumers must accept only literal true.

API Keys

Create a key in Settings → Security → API Keys, or call POST /api/v1/api-keys using an already authenticated session or authorized key. The full secret is returned once. Keep it in a secrets manager and revoke it if lost or exposed.

Creating an API Key

curl -X POST https://panel.example.com/api/v1/api-keys \
  -H "Authorization: Bearer ${PANEL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{"name":"inventory","role":"admin","rateLimitRpm":60}'
FieldContract
nameRequired
roleadmin or customer; defaults to the caller's role. A customer cannot mint an admin key.
scopesOptional string array; specialized tenant MCP keys use the MCP surface below. provisioning is reserved for billing integration keys: asking for it here is 400 validation_failed and no key is created.
permissionsDenyOptional array of known permission names. A key that has its own deny list passes it on: the new key gets the requested list plus the caller's, and metadata.permissionsDeny shows that combined list. A key denied secrets.manage cannot create keys: an admin-role key gets 404, as for any denied permission; a customer-role key gets 403 insufficient_role, because the Customer role it would mint includes secrets.manage.
expiresAtOptional future RFC3339 timestamp; omitted means no expiry
rateLimitRpmPositive requests/minute; defaults to 60
isServiceAccount, descriptionOptional metadata

201 Created returns key and metadata, rather than a flat key-record object:

{
  "key": "REDACTED_PANEL_API_KEY",
  "metadata": {
    "name": "inventory",
    "scopes": null,
    "role": "admin",
    "permissionsDeny": null,
    "rateLimitRpm": 60,
    "expiresAt": null,
    "isServiceAccount": false,
    "description": ""
  }
}

The redacted value above is not usable. Customer callers also go through the api_keys capability, organization attachment, and key-count policy; successful customer minting includes orgId in metadata. Admin-created keys remain platform-scoped on this route, including admin-created customer-role keys. A role label alone does not select a tenant.

A customer caller must hold, in its organization, every permission of the key's role; otherwise the response is 403 with the code insufficient_role and no key is created. A key bound to an organization works only for that organization and the ones below it, with the key's own role, cut down to what its creator holds there now, and answers 404 for everything else. Called with such a key, POST /api-keys creates keys only for the same organization, and GET /api-keys and DELETE /api-keys/{id} see only the creator's keys bound to it. /secrets* and /portal/* take the customer from the key as well, never from the key's creator. See API Keys.

Using an API Key

curl https://panel.example.com/api/v1/services \
  -H "Authorization: Bearer ${PANEL_API_KEY}"

Choose the role and endpoint for the intended account. Admin service/template routes require admin; customer integrations use the portal API. Permission-deny settings affect every route that names a permission, platform-only routes included (a key that denies templates.view gets 404 on GET /templates, one that denies services.deploy on POST /services/git). They remove permissions; they are not a read-only role, so pick the permissions to deny rather than relying on a short list. A restricted key cannot shed its restrictions by minting a fresh key: the deny list is inherited, as described above. Keys created before this rule keep the list they were given.

Listing API Keys

GET /api/v1/api-keys returns {"keys": [...]} for the authenticated user. Each record includes its UUID id, name, prefix, role, scopes, policy metadata, and timestamps; the full key is not returned. Use that UUID when revoking.

Listing and revoking keys on /api-keys need the same permission as creating them, secrets.manage. A key whose deny list contains it gets 404 on GET /api-keys and DELETE /api-keys/{id}, and cannot create, reveal or revoke keys through the portal either. It can still see key names and prefixes, never secrets, in the portal lists (GET /portal/api-keys, GET /portal/mcp), which need only secrets.view; whether that should change is a separate policy decision (AI-1304). Browser sessions and keys without that entry are not affected.

Revoking an API Key

DELETE /api/v1/api-keys/{id} revokes a key owned by the authenticated user and returns 204 No Content. Subsequent authentication with the revoked key fails.

Billing Integration Keys

A billing system such as WHMCS gets its own key, which opens the provisioning API under /api/v1/provisioning/ and nothing else. A platform admin creates the integration and mints its keys while signed in to the panel; an API key cannot do it (403). Billing integrations need the Power User or Web Host edition; on Free the create and mint routes answer 403 edition_required.

Method and pathWhoDoes
GET /api/v1/integrationsplatform adminLists integrations; editionAllowed and behindCloudflare tell the UI what it may offer
POST /api/v1/integrationsplatform admin, signed inCreates one: name, kind (whmcs), allowedCidrs, allowClientSso (default true), terminationGraceDays (default 7, 0 to 365)
PATCH /api/v1/integrations/{id}platform admin, signed inChanges those fields; enabled: false stops every key of the integration at once
GET /api/v1/integrations/{id}/keysplatform adminPrefix, name, expiry, last use and revocation of each key
POST /api/v1/integrations/{id}/keysplatform admin, signed inMints a key (name, optional expiresAt); the key is in the response once
DELETE /api/v1/integrations/{id}/keys/{keyId}platform admin, signed inRevokes it immediately
GET /api/v1/provisioning/whoamiintegration keyIntegration, panel version, apiVersion, edition, writesAllowed, ssoAllowed
GET /api/v1/provisioning/plansintegration keyEvery customer plan with its limits (0 = unlimited)

An integration key works like this, and only like this:

  • It is stored like every other key: the panel keeps a salted hash, never the key.
  • Every other route, /mcp and /mcp/tenant answer 401 to it, as to an unknown key. The provisioning routes answer 401 to every other credential, including a platform admin key and a browser session.
  • An integration holds at most two active keys, so you can rotate: mint the second, put it into the billing system, test the connection, then revoke the first.
  • An optional source-address allow-list (allowedCidrs) limits where the key may be used from; a request from elsewhere gets 403 ip_not_allowed. When the panel is reached through the Cloudflare proxy, the panel sees Cloudflare's address instead of the billing system's, so an allow-list is refused there until AI-797 is fixed.

Upgrading to this version revokes any existing key that already carried the provisioning scope (scopes were free-form before). None should exist; any that did is listed in the audit log as api_key.revoked with migration: 000170.

Session Management

Session Storage

OIDC sessions are stored in PostgreSQL's identity_sessions table. It holds the session identifier, the user and the expiry; the panel does not keep Keycloak's access or refresh tokens. It also holds the session's ID token, encrypted with its own key and bound to that one session (it opens for no other row and as no other kind of secret), used only to end the Keycloak login at sign-out. It is checked against the realm's signing keys before use; a token that does not pass is not sent, and sign-out then shows Keycloak's confirmation page. It is deleted with the session: at sign-out, "sign out everywhere", suspension, and at most one hour after the session expired (a job deletes expired sessions every 15 minutes). The browser receives an opaque session identifier in the __Host-aap_session cookie. Its attributes are:

  • HttpOnly — not accessible via JavaScript
  • Secure — only sent over HTTPS
  • SameSite=Lax — limits when browsers send the cookie across sites
  • Path=/ and no Domain — the cookie is valid for the panel hostname only

The __Host- prefix is a browser rule, not decoration: a cookie with that name can only be set by the exact hostname, over HTTPS, without a Domain. So the browser never sends the panel session to a deployed service at <name>.<your domain>, and a service cannot plant a session cookie for the panel. A panel reached over plain http (the CI setup on localhost) uses the name aap_session, because browsers refuse the prefix there.

Earlier releases named the cookie oidc_session and issued it for the whole panel domain, so every deployed service received it with each request and could act as the signed-in user (AI-1181). That name is no longer accepted anywhere. A script that sends oidc_session by hand gets 401; use an API key instead. Sign-in and sign-out delete the old cookie from the browser.

Writes from other websites are refused

A browser sends the panel cookie with every request to the panel, including a form or script another website fires at it. So that a page a signed-in user happens to visit cannot change anything in their name (cross-site request forgery), the panel refuses POST, PUT, PATCH and DELETE requests that carry a cookie and that the browser marks as coming from another site (Sec-Fetch-Site: cross-site or same-site, or an Origin that is not the panel's own address). They get 403 with code forbidden (AI-1354).

Not affected: reads, requests without any cookie (API keys and bearer tokens, including browser-based integrations on another origin), clients that send neither Origin nor Sec-Fetch-Site (curl, scripts, server-to-server calls), and the signed webhook trigger POST /api/v1/webhooks/{id}/trigger. A script that sends a cookie together with an API key from a browser on another site is refused, because the cookie would be used first; drop the cookie and use the key alone.

Two-factor authentication

Two-factor is a Keycloak credential (type otp), because Keycloak is where sign-in checks it (AI-1438). The profile page (/account, /portal/profile) manages it for the signed-in user only:

ActionHow
StatusGET /api/v1/account/profile returns totpEnabled: whether the user has an otp credential in Keycloak, and totpCredentialId, that credential's id (omitted without one). If Keycloak cannot be read, the call fails (502 provider_unreachable) instead of reporting "off".
Turn onThe browser opens GET /api/v1/auth/oidc/login?action=configure-totp. This is the usual sign-in with Keycloak's own setup step (kc_action=CONFIGURE_TOTP); Keycloak shows the QR code, checks the first code and returns through the usual callback. After kc_action_status=success the callback continues to ?action=configure-recovery-codes (one flow, AI-2236) when Keycloak's recovery-code step is active and the user has no codes yet; otherwise, and after a cancel, it ends on the panel.
Turn offThe browser opens GET /api/v1/auth/oidc/login?action=delete-totp&credential=<totpCredentialId>, with the id from the profile. This is the usual sign-in with Keycloak's delete step (kc_action=delete_credential:<id>): Keycloak asks for the password and a code, asks to confirm, and deletes the credential only if it belongs to the user signing in. credential must be one UUID; anything else answers 400. After Keycloak reports success, the panel also removes the user's recovery codes if no authenticator is left; otherwise Keycloak would ask for a recovery code at every sign-in.
Recovery codesThe browser opens GET /api/v1/auth/oidc/login?action=configure-recovery-codes: the usual sign-in (password and code asked again when the last sign-in is older than 5 minutes) with Keycloak's page that shows 12 new single-use codes once (kc_action=CONFIGURE_RECOVERY_AUTHN_CODES, AI-1457). New codes replace the old. Only for a browser signed in to the panel whose user has an authenticator: without a valid session 401, without an authenticator 400 (codes alone would make Keycloak ask for one at every sign-in), Keycloak unreadable 502; nothing goes to Keycloak then. The profile returns recoveryCodesSet and recoveryCodesLeft (unused codes; omitted without codes). Needs Keycloak's preview feature recovery-codes; see the upgrade guide.
Reset (support)POST /api/v1/customers/{id}/reset-2fa with {"reason": "…", "userId": "…"} (userId optional: one of the customer's own logins, default the primary login). Admins, and resellers for their own customers (others get 404). Removes the user's authenticator and recovery codes, requires two-factor setup at the next sign-in, ends all of the user's Keycloak and panel sessions, writes the audit entry customer.user_2fa_reset and emails the user when email is configured. Answers {"reset": true, "emailSent": …}. The caller must have authenticated at Keycloak within 10 minutes: the panel reads auth_time from the caller's own session's ID token (it adds an auth_time mapper to its login client at start), not the session's age, because a silent sign-in inside a live Keycloak session makes a new panel session without asking for anything. Otherwise 403 reauth_required; ?action=reauth sends prompt=login&max_age=0, so Keycloak authenticates again. If the client already has a mapper named auth_time for another claim, Keycloak refuses the panel's (409): the panel logs one ERROR, keycloak auth_time claim cannot be added, with the fix (rename or delete that mapper, then restart the panel), and resets ask to sign in again until then. An API key always gets 403. Without Keycloak admin access (no KEYCLOAK_ADMIN_PASSWORD) the answer is 400 identity_not_configured, before the step-up. A reason is required (400). Once started, the reset runs to the end, email and audit entry included, even if the browser disconnects. Order: two-factor setup is required first, then the authenticator and codes are deleted, then sessions end; if a step fails the answer is 502 with the user's exact state and the audit entry has outcome: failed, failed_at and completed_steps (AI-1458).

When Keycloak asks for the password again (AI-2236). Turn off (and the password change below) send prompt=login: Keycloak always asks for the password (and code), even inside a recent session; without it Keycloak 26 skips straight to "Confirm deletion". Turn on and recovery codes send max_age=300: Keycloak asks again only when the user last typed the password more than 5 minutes ago (Keycloak's own default for credential actions); without it Keycloak 26 never asks inside a session. So the second step of the one-flow setup does not ask again.

The user is always the one signed in; a user id in the request is ignored. An API key cannot call these routes (404), like the rest of /account/….

Signing out other sessions

The account page (/account, /portal/profile) ends sessions in three ways. Each one deletes the user's panel session rows, so the matching cookies get 401 on their next request instead of working until they expire (AI-1187).

ActionEndpointPanel sessions endedKeycloak sessions ended
Sign out everywherePOST /api/v1/account/sessions/logout-allall of the user's, this browser included; the page then opens /loginall
Sign out one session in the listDELETE /api/v1/account/sessions/{id}all of the user's except this browserthe one listed
Change passwordthe browser opens GET /api/v1/auth/oidc/login?action=update-password (see below)all of the user's except this browser, once Keycloak reports the changeall of the user's except this browser's, so other devices must type the new password

The session list shows Keycloak sessions, and their IDs are unrelated to the panel's own sessions, so a single revoke cannot pick out "the matching" panel session. After a revoke, the user's other browsers therefore pass once through Keycloak again; while their Keycloak session is still alive that takes no password. A session ID that is not in the caller's own list returns 404 and ends nothing. When one of these calls is made with an API key instead of the browser cookie, there is no "this browser" to keep: all of the user's panel sessions end.

Changing the password

GET /api/v1/auth/oidc/login?action=update-password is the usual sign-in with Keycloak's password page (kc_action=UPDATE_PASSWORD, prompt=login). Keycloak asks for the current password (and the two-factor code when it is on), then the new password twice, and offers "Sign out from other devices". It returns through the usual callback with kc_action_status=success. Only then, and only for a sign-in this browser started as a password change, does the panel end the user's other panel sessions and other Keycloak sessions (through Keycloak's admin API, whatever the box said); this browser keeps the panel session the sign-in created and its own Keycloak session (the ID token's sid). Without a sid all Keycloak sessions end and this browser signs in again the next time it needs Keycloak. If either step fails, the password is still changed and the panel logs password changed but panel sessions not ended or ... keycloak sessions not ended (AI-1451).

The earlier POST /api/v1/account/password is gone. It checked the current password with Keycloak's password grant, which installed realms leave switched off for the account-console client, so it always answered 502. KEYCLOAK_VERIFY_CLIENT_ID is no longer read.

WebSocket connections that are already open (live logs, metrics, terminal) end with their session: the panel checks each open connection's session again every 15 seconds and closes the connection (close code 1008, "session ended") once the session was signed out, ended by one of the actions above, or expired (AI-2602).

Not covered: a password reset by an administrator (Customers page or the panel command line) is not ended by these actions.

Sign-on to locked services

Templates that set ssoEnabled (Hermes, IronClaw and Skyvern) sit behind a lock: before the proxy passes a request to the service, it asks the panel at GET /api/v1/auth/sso/verify whether this visitor may open that hostname. Because the panel session cookie no longer reaches service hostnames, each locked service gets its own cookie, __Host-aap_app_sso, valid for that one hostname. It is like a key for one rack instead of the key to the server room: the panel API never reads it, and it is refused on any other hostname.

How the browser gets it, on the first visit to a locked service:

  1. The service hostname answers 302 to GET /api/v1/auth/sso/start on the panel hostname and sets a short-lived one-time value (__Host-aap_sso_nonce, 120 seconds).
  2. The panel, where the session cookie is present, checks that the signed-in user may open that service. If nobody is signed in it redirects to the panel login page; if the user may not open the service it answers 403. Otherwise it redirects back to https://<service>/_aap/sso with a single-use ticket that is valid for 60 seconds, for that hostname and for the browser that started the sign-on. The redirect always goes to the bare service hostname on port 443: a host with a port or a trailing dot is answered with 403, so the ticket cannot be sent to another listener on the same name.
  3. The service hostname exchanges the ticket for the __Host-aap_app_sso cookie and redirects to the page that was asked for.

That is two quick redirects, once per service and panel session. After that every request is checked as before: the user must still be allowed to open the service, and signing out of the panel, or suspending the customer, ends the sign-on at once. Requests that are not a page load (background requests, API clients) are never redirected; they get 401 until the page has been opened once.

These checks do not count against the panel's general limit of 60 requests per minute per address: the proxy asks about every file a page loads, so one busy page would otherwise lock its owner out for a minute. What is limited is failure: a client address that sends 60 sign-on cookies or tickets the panel never issued within a minute gets 429 with Retry-After: 60 until the minute is over. The allowance is taken before the value is checked, so requests sent in parallel cannot get past it, and a value that turns out valid gives it back. A browser that still holds a cookie from before sign-out is told to delete it, so an open tab does not use up that allowance (AI-1240).

Right after the panel restarts or updates, a page that loads many files at once sends the same sign-on cookie with all of them. Requests from one address share its first check while that check runs. A request arriving after it finishes checks the grant again, but a recently valid cookie does not take another place in the failure allowance. This also applies to a request that began before the first check finished but reached the shared check later (AI-1667). The panel still checks the live grant, session and hostname access; remembering a valid cookie never grants access by itself. A cookie the panel never issued is still checked, and counted, every time (AI-1273).

One narrow exception to "ends at once": when the panel removes a service's sign-on without ending the panel session (an operator starts acting as a customer), a request from the same address with the same cookie that arrives while that cookie's check is still running receives that check's answer, and can be let through. The check is limited to half a second, so this lasts at most that long; every request after it gets 401. Signing out, and suspending the customer, are re-checked on every request and are not affected. When the panel cannot check a cookie within that half second, the request is not let through, the cookie is kept, and the attempt counts against the allowance, like any check whose answer was not a valid cookie: a slow database must not let one address query it without limit. After a database stall long enough to fail more than 60 checks, that address can therefore see 429 for up to a minute once the database has recovered.

The allowance belongs to an address, not a person: everyone behind one shared address (an office NAT, a carrier-grade NAT, or one Cloudflare edge address on a Cloudflare-proxied install, AI-797) shares it, and while it is used up a visitor there who has not opened the service recently is refused too. When the panel cannot reach its Valkey store, such checks are refused rather than let through unlimited.

A visitor who was not signed in lands on the panel login page and, after signing in, opens the service again; the panel does not return there automatically. The path /_aap/sso on a locked service is answered by the panel and never reaches the service.

Not covered: a page on a service hostname can still make the browser send form posts to the panel with the user's session cookie attached, because both are on the same site (cross-site request forgery). Run only services you trust under the panel domain.

Session Expiry

The login callback sets the cookie lifetime and server-side session expiry from Keycloak's token response (expires_in). The request middleware checks that stored expiry; it does not extend it on each request. Sign in again when the session expires.

Role-Based Access

The main services and templates routes in this reference belong to the admin-only router group. Customer access is served by /api/v1/portal routes with customer/organization checks. There is no operator or viewer grant for these admin routes. Do not infer tenant isolation from an optional customerId field on an admin request: that field assigns a resource's customer.

MCP Server describes the separate admin and tenant MCP endpoints and the credentials each accepts.

Custom role permissions

In Roles & Permissions, edit a custom role and deselect every permission to remove its final grant, then choose Save. The role remains available, with zero permissions. Cancelling the dialog makes no change. Existing assignments remain attached to that role; the permission cache checks its updated version.

For authorized role administrators, PUT /api/v1/roles/{id} distinguishes these request bodies:

RequestResult
{"description":"Support role"}Change metadata and keep the current grants
{"permissionIds":[]}Remove every grant
{"permissionIds":["10000000-0000-4000-8000-000000000001"]}Replace the set with the supplied registry IDs; the UUID here is an example, not a built-in permission ID

permissionIds: null retains grants for compatibility. Omitted or empty name and description strings keep their current values. Invalid permission UUIDs are rejected before writing. A missing permission or a failure before commit rolls back the metadata, grants and role version together. Success is returned after the transaction commits. If the save response is lost, reload the role to check the stored result before retrying. Role creation also commits its initial permissions together, so a rejected create leaves no orphan role.

Use IDs returned by GET /api/v1/permissions; permission names are not IDs. In the Go SDK, a nil CreateRoleRequest.PermissionIds omits the field, and a nonnil empty slice sends []. TypeScript callers can send permissionIds: [] directly. Role-management authorization still applies on the server; clearing permissions does not grant a customer access to role administration.