Developer Tools · IT & Security

Unkey MCP

Unkey MCP lets agents manage API keys, identities, permissions and roles, rate limits, deployments, domains, portals and workspace settings, and query analytics and logs through Unkey's hosted MCP server.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Unkey v2 permissions create permission

    Create a new permission to define specific actions or capabilities in your RBAC system. Permissions can be assigned directly to API keys or included in roles. Use hierarchical naming patterns like `documents.read`, `admin.users.delete`, or `billing.invoices.create` for clear organization. **Important:** Permission slugs must be unique within the workspace. Names do not need to be unique. Once created, permissions are immediately available for assignment. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/*#write` Use your workspace ID and its default project ID. A wildcard project grant also authorizes this operation.

  • Unkey v2 permissions create role

    Create a new role to group related permissions for easier management. Roles enable consistent permission assignment across multiple API keys. Permission slugs supplied in `permissions` are attached during creation. Missing permissions are created automatically. **Important:** Role names must be unique within the workspace. Once created, roles are immediately available for assignment. **Required Permissions** Your root key must always have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/roles/*#write` When any requested permission slug does not exist, it must also have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/*#write` Both grants must cover the authenticated workspace and its default project. Attaching existing permissions requires only role write access.

  • Unkey v2 permissions delete permission

    Remove a permission from your workspace. This also removes the permission from all API keys and roles. **Important:** This operation cannot be undone and immediately affects all API keys and roles that had this permission assigned. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/<permission_id>#delete`

  • Unkey v2 permissions delete role

    Remove a role from your workspace. This also removes the role from all assigned API keys. **Important:** This operation cannot be undone and immediately affects all API keys that had this role assigned. **Required Permissions** Your root key must have `unkey:v1:{workspaceId}:projects/{projectId}/rbac/roles/{roleId}#delete` for the role. A wildcard grant that covers the role also authorizes deletion.

  • Unkey v2 permissions get permission

    Retrieve details about a specific permission including its name, description, and metadata. **Required Permissions** Your root key must have the following permission: - `rbac.*.read_permission`

  • Unkey v2 permissions get role

    Retrieve details about a specific role including its assigned permissions. **Required Permissions** Your root key must have the following permission: - `rbac.*.read_role`

  • Unkey v2 permissions list permissions

    Retrieve all permissions in your workspace. Results are paginated and sorted by their id. **Required Permissions** Your root key must have the following permission: - `rbac.*.read_permission`

  • Unkey v2 permissions list roles

    Retrieve all roles in your workspace including their assigned permissions. Results are paginated and sorted by their id. **Required Permissions** Your root key must have the following permission: - `rbac.*.read_role`

  • Unkey v2 permissions set role permissions

    Atomically replaces all permissions directly assigned to a role. An empty `permissions` array removes every permission from the role. Permissions that do not exist are created when the caller has permission to create them. **Required Permissions** Your root key must have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/roles/<role_id>#write` When any requested permission slug does not exist, it must also have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/*#write` Use the role's workspace, project, and role IDs in these permissions.

  • Unkey v2 permissions update permission

    Update the name, slug, or description of a permission, identified by its ID or slug. Omitted fields keep their current values. A request with no fields to update returns the stored permission without a write. **Important**: Keys and roles reference the permission by ID, so they keep the permission after a slug change. Key verification can return the old slug for a short time while caches refresh. A slug that another permission in your workspace already uses returns 409. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/<permission_id>#write`

  • Unkey v2 permissions update role

    Update the name or description of a role, identified by its ID or name. Omitted fields keep their current values. A request with no fields to update returns the stored role without a write. This endpoint does not change the role's permissions or keys. Use `permissions.setRolePermissions`, `keys.addRoles`, and `keys.removeRoles` for those. **Important**: Keys keep the role after a rename. Requests that name the role, such as `keys.addRoles`, must use the new name. Key verification can return the old name for a short time while caches refresh. A name that another role in your workspace already uses returns 409. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/roles/<role_id>#write`

  • Unkey v2 portal create domain

    Attach a custom domain to a portal and start verifying it. The domain is created in the `pending` state and does not serve the portal until verification succeeds. The response returns `dnsRecords`: create every entry exactly as given. Verification runs in the background; poll `portal.getDomain` for the result. A name already attached to one of your portals or environments returns a 409. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/*#write`. Use `portals/*/domains/*#write` to attach domains to any portal in the project. Without the permission this returns **404**, not 403, unless the key can read the portal or its domains.

  • Unkey v2 portal create portal

    Create a portal for one app or keyspace in your workspace. Unreleased and subject to change without notice. Send exactly one of `keyspaceId` or `appId`. That resource must belong to your workspace, and it can back only one portal, so a second portal for the same resource is a **409**. `displayName` is what your end users see. It is yours to set and change independently of the resource the portal serves. **Required Permissions** Your root key must have `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, because the ID does not exist yet. You must also have read permission on the resource the portal serves: - `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>#read` for an app. - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#read` for a keyspace. Broader grants that cover these resources and actions also authorize the request. A missing permission returns **403**. An app or keyspace outside your workspace returns **404**, the same as a resource that does not exist.

  • Unkey v2 portal create session

    Create a portal session for an end user and get the URL to redirect them to. The URL carries a single-use exchange code valid for 15 minutes, which the portal redeems exactly once for a 24-hour access token via `portal.exchangeCode`. **Required Permissions** Authorization runs in two stages, and both must pass. First, your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/sessions/*#write`. Write permission on the portal itself does not grant permission to mint sessions. Second, a session can never carry a capability your root key does not itself hold. Each requested scope additionally requires the equivalent permission on every keyspace the portal resolves to: - `keys:read` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#read` and `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#read`. - `keys:reroll` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write`, including when the keyspace stores encrypted keys. - `keys:create` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write`, the same permission creating a key with `keys.createKey` requires. - `analytics:read` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/logs#read`. Broader URN grants that cover these resources and actions are also accepted. A grant on one concrete key cannot satisfy the `keys/*` requirement. Requesting a scope you do not hold returns 403 for the whole request rather than minting a reduced session, so a missing grant is visible instead of surfacing later as a broken portal. Missing the portal permission itself returns **404** when your root key cannot read the portal or its sessions, so a caller who cannot see a portal is not told whether it exists. A root key that can read the portal but lacks the permission gets **403**. Your root key must also be associated with a workspace that has an enabled portal.

  • Unkey v2 portal delete domain

    Detach a custom domain from a portal. A verified domain stops serving the portal. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/<domain_id>#delete`. Use `portals/<portal_id>/domains/*#delete` to delete any domain on the portal. Without the permission this returns **404**, not 403, unless the key can read the portal or the domain.

  • Unkey v2 portal delete portal

    Delete a portal and revoke the sessions it minted. Unreleased and subject to change without notice. Its end users lose access rather than keeping it until their tokens expire. Revocation is not instantaneous: session lookups are cached briefly, so a request already in flight may still succeed. The app or keyspace it served is untouched, and its slug becomes free for a new portal. Its custom domains are deleted with it: they stop serving and their DNS records can be removed. Their certificates are not revoked. **Required Permissions** Your root key must have `delete` permission on `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>`. A broader grant, such as `unkey:v1:<workspace_id>:**#delete`, also permits deletion. A root key that cannot read the portal gets **404**. One that can read it but lacks the permission gets **403**.

  • Unkey v2 portal get domain

    Read one custom domain attached to a portal, with its verification status and DNS records. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/<domain_id>#read`. Use `portals/<portal_id>/domains/*#read` to read every domain on the portal. Without the permission this returns **404**, not 403, unless the key can read the portal itself.

  • Unkey v2 portal get portal

    Read one portal, by its id or slug, or by the resource it serves. Unreleased and subject to change without notice. Send exactly one of `portal`, `keyspaceId`, or `appId`. Sending more than one is a **400**. **Required Permissions** Your root key must have one of: - `portal.*.read_portal` (to read any portal in the workspace) - `portal.<portal_id>.read_portal` (to read a specific portal) Without the permission this returns **404**, not 403.

  • Unkey v2 portal list domains

    List the custom domains attached to a portal, with their verification status and DNS records. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/*#read`. Without the permission this returns **404**, not 403, unless the key can read the portal itself.

  • Unkey v2 portal list sessions

    List the end users holding a revocable session on a portal, with each end user's sessions. Unreleased and subject to change without notice. A session is revocable until it expires or is revoked. That includes sessions whose portal URL was created but not opened yet. Pass an end user's `externalId` to `portal.revokeSession` to end their sessions. **Required Permissions** Your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/sessions/*` with `#read` or `#write`. Reading the portal itself is not enough. Without the permission this returns **404**, not 403.

PreviousPage 4 / 6Next