Update portal
Change a portal’s slug, display name, the resource it serves, its enabled state, or its branding.
Unreleased and subject to change without notice.
Only the fields you send change. Omitting a field leaves it as it is, and for
branding, sending null clears it. Send at most one of keyspaceId or appId.
Two changes affect your end users immediately:
- Re-pointing at a different resource revokes the portal’s live sessions, because a session carries the scope it was minted with.
- Disabling stops new sessions and revokes the live ones. Re-enabling does not restore them.
Required Permissions
Your root key must have write permission on
unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>.
A broader grant, such as unkey:v1:<workspace_id>:**#write, also permits updates.
To change the mapped resource, your root key must also have read permission
on the target:
unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#readfor a keyspace.unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>#readfor an app.
A root key that cannot read the portal gets 404. One that can read it but lacks the permission gets 403.
Authorizations
Unkey uses bearer tokens for authentication. Public integrations use root keys, while the dashboard proxy uses short-lived JWTs. To authenticate, include the token in the Authorization header of each request:
Root keys have specific permissions attached to them, controlling what operations they can perform. Resource permissions use Unkey Resource Names plus actions, like unkey:v1:ws_123:projects/*/keyspaces/*/keys/*#write.
Security best practices:
- Keep root keys secure and never expose them in client-side code
- Use different root keys for different environments
- Rotate keys periodically, especially after team member departures
- Create keys with minimal necessary permissions following least privilege principle
- Monitor key usage with audit logs.
Body
Re-point the portal at a different keyspace. Omit to leave the resource it serves alone.
Re-pointing revokes the portal's live sessions, because a session carries the keyspace scope it was minted with and would otherwise keep reaching the resource the portal no longer serves.
The new keyspace must belong to the same project as the portal's current resource. A portal cannot move between projects, because its permissions are addressed under the project it belongs to. Re-pointing across projects returns 412; create a portal in the target project instead.
1 - 255^[a-zA-Z0-9_-]+$"ks_1234abcd"
Re-point the portal at a different app. Omit to leave the resource it serves alone.
Re-pointing revokes the portal's live sessions, for the same reason as
keyspaceId.
The same project restriction applies, and it is easy to hit when switching between an app and a keyspace: keyspaces are created in the workspace's default project, while an app belongs to the project you created it in.
1 - 255^[a-zA-Z0-9_-]+$"app_1234abcd"
Response
The portal as it now stands.
A portal you expose to your end users so they can manage their own keys.
Exactly one of keyspaceId or appId is present, naming the single resource
the portal serves. Neither is in the required list because which one appears
depends on the portal, so a reader checks for the one it cares about.