Skip to main content
POST
Go (SDK)

Authorizations

Authorization
string
header
required

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. Legacy permissions use tuple strings like api.*.create_key; resource permissions use Unkey Resource Names plus actions, like unkey:v1:ws_123:keyspaces/*#create_key. 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

application/json
portal
string
required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

Required string length: 3 - 255
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"proj_1234abcd"

slug
string

New handle for this portal. Omit to leave unchanged.

Required string length: 3 - 64
Pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
Example:

"acme-portal"

displayName
string

New human-readable name shown to your end users. Omit to leave unchanged.

Required string length: 1 - 64
Pattern: ^\S(.*\S)?$
Example:

"Acme"

keyspaceId
string

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.

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"ks_1234abcd"

appId
string

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.

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"app_1234abcd"

enabled
boolean

Whether new sessions can be minted. Omit to leave unchanged.

Disabling also revokes the portal's live sessions. Re-enabling does not restore them.

Example:

false

logoUrl
string<uri> | null

Absolute https:// URL of the portal logo. Omit to leave unchanged, or set null to remove the logo.

Required string length: 1 - 500
Pattern: ^https://
Example:

"https://cdn.example.com/logo.svg"

primaryColor
string | null

Six-digit hex colour for primary actions. Omit to leave unchanged, or set null to fall back to default styling.

Pattern: ^#[0-9a-fA-F]{6}$
Example:

"#6366f1"

Response

The portal as it now stands.

meta
object
required

Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The requestId is particularly important when troubleshooting issues with the Unkey support team.

data
object
required

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.