Skip to main content
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.
Create a portal for one keyspace or one app in your workspace. Each keyspace or app can have only one portal. A second portal for the same one, or a slug that’s already taken, returns 409 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

Your root key needs unkey:v1:<workspace_id>:projects/<project_id>/portals/*#write for the project that owns the app or keyspace. A grant scoped to a specific portal ID does not authorize creation. You also need read permission on the resource the portal serves:
  • unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#read for a keyspace
  • unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>#read for an app
Broader grants that cover these resources and actions also authorize the request. Without the read permission, the call fails with 403 and “You do not have permission to point a portal at that resource.” A missing portal-write permission also returns 403, not 404. An app or keyspace outside your workspace returns 404, the same as a resource that does not exist. See Root key permissions.

Examples

Keyspace portal
Branded app portal
Or send the whole request as JSON:
Raw body

Developer portal

What a portal is and how your users reach it.

create-session

Mint the session that lets one end user in.
Last modified on November 12, 2026