Create a root key with the permissions listed on this page under Root Keys in the dashboard sidebar. CLI commands can instead use a session from unkey login with the required permissions. See Permission reference for every permission.
err:unkey:data:portal_already_exists. Calls POST /v2/portal.createPortal.
Usage
Flags
string
required
Portal handle, unique in your workspace. 3 to 64 lowercase letters, digits, and hyphens, not starting or ending with a hyphen. You pass it as
--portal to the other portal commands. End users never see it.string
required
Name shown to end users in the portal header, up to 64 characters. You can change it later.
string
Keyspace this portal serves. Pass exactly one of
--keyspace-id or --app-id.string
App this portal serves. Pass exactly one of
--keyspace-id or --app-id.boolean
default:"true"
Whether you can create sessions for the portal. Pass
--enabled=false to create it turned off.string
Absolute HTTPS URL of the logo shown in the portal header, up to 500 characters.
string
Six-digit hex color used for primary actions, for example
#6366f1.Shared flags
Every resource command takes these. See CLI output and shared flags.string
Root key used for the request. Falls back to
UNKEY_ROOT_KEY, then stored credentials, including a CLI session. See CLI authentication for the full precedence order.string
default:"https://api.unkey.com"
Base URL of the API. Falls back to
UNKEY_API_BASE_URL. You don’t normally need to set it.string
default:"~/.unkey/config.toml"
Path of the TOML config file. Falls back to
UNKEY_CONFIG. An explicit --config takes precedence over a stored CLI session. Browser login stores a session, not a root key in this file. See CLI authentication.enum
default:"human"
Use
human (default) for name-first summary tables and single-response trees, or json for the unchanged full response envelope, including all fields and pagination. Trees wrap long values without truncation. Terminal tables use relative timestamps and may shorten display names and descriptions, but never identifiers, slugs, or credentials. Redirected human output keeps complete values and uses RFC3339 UTC timestamps. Falls back to UNKEY_OUTPUT; other values are rejected. --json also selects JSON output. Add --debug to print the request ID to stderr. See Output formats.boolean
Print the successful response’s request ID to stderr, separate from stdout.
boolean
Print the full response as JSON. Takes precedence over a valid
--output or UNKEY_OUTPUT value.string
Send this JSON as the whole request body instead of using the command’s flags. You can’t combine it with them.
Required permissions
portal.*.create_portal, plus read on the resource the portal will serve: api.*.read_api or api.<apiId>.read_api for a keyspace, app.*.read_app or app.<appId>.read_app for an app. Without the read permission, the call fails with 403 and “You do not have permission to point a portal at that resource.” Unlike the other portal commands, a missing portal.*.create_portal returns 403, not 404. See Root key permissions.
Examples
Keyspace portal
Branded app portal
Raw body
Related
Developer portal
What a portal is and how your users reach it.
create-session
Mint the session that lets one end user in.