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 keys verify key

    Verify an API key's validity and permissions for request authentication. Use this endpoint on every incoming request to your protected resources. It checks key validity, permissions, rate limits, and usage quotas in a single call. **Important**: Returns HTTP 200 for all verification outcomes — check the `valid` field in response data to determine if the key is authorized. A 429 may be returned if the workspace exceeds its API rate limit. **Common use cases:** - Authenticate API requests before processing - Enforce permission-based access control - Track usage and apply rate limits **Required Permissions** Your credential needs one of: - `unkey:v1:<workspace_id>:projects/*/keyspaces/*/keys/*#verify` (verify keys in any project in your workspace) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/*/keys/*#verify` (verify keys in a specific project) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#verify` (verify keys in a specific keyspace) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/<key_id>#verify` (verify a specific key) Use the keyspace's project ID and keyspace ID, not its API ID. The workspace must match your credential's authorized workspace. **Note**: If your credential lacks permission to verify this key, the response is HTTP 200 with `valid: false` and `code: NOT_FOUND`. This does not distinguish a missing key from an inaccessible key.

  • 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 revoke session

    Revoke every live session an end user holds on a portal. Unreleased and subject to change without notice. Sessions that were created but not yet opened are revoked too, so their portal URLs stop working. Revocation is not instantaneous: session lookups are cached briefly, so a request already in flight may still succeed. Revoking ends existing sessions only. To keep the end user out, also stop calling `portal.createSession` for them. Calling this again for the same end user is safe and revokes nothing. **Required Permissions** Your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/sessions/*#write` or a broader grant that includes it. Dashboard roles can grant this permission. Unlike `portal.createSession`, a dashboard session with this permission can also call this endpoint. A root key that cannot read the portal's sessions gets **404**. One that can read them but lacks the permission gets **403**.

  • Unkey v2 portal 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>#read` for a keyspace. - `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>#read` for an app. A root key that cannot read the portal gets **404**. One that can read it but lacks the permission gets **403**.

  • Unkey v2 portal verify domain

    Restart verification for a portal domain. Call this after you correct the DNS records of a domain that shows `failed`, or to give a `pending` domain a new 24-hour verification period. The endpoint returns when Unkey accepts the retry. Poll `portal.getDomain` for the result. A domain that is already `verified` returns a 202 and starts nothing. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/<domain_id>#write`. Use `portals/<portal_id>/domains/*#write` to manage every domain on the portal. Without the permission this returns **404**, not 403, unless the key can read the portal or the domain.

  • Unkey v2 projects update project

    Update an existing project in your workspace, identified by its id. The project name, slug, and delete protection setting can be changed. Omitted fields are left unchanged. Changing the slug affects the deployment domains generated for this project. **Required Permissions** Your root key must have one of the following permissions: - `unkey:v1:<workspace_id>:projects/*#write` (to update any project in the workspace) - `unkey:v1:<workspace_id>:projects/<project_id>#write` (to update a specific project)

  • Unkey v2 ratelimit limit

    Check and enforce rate limits for any identifier (user ID, IP address, API client, etc.). Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides. **Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded — check the `success` field in the response to determine if the request should be allowed. A 429 may be returned if the workspace exceeds its API rate limit. Other 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors. **Required Permissions** Your root key must have one of the following permissions: - `ratelimit.*.limit` (to check limits in any namespace) - `ratelimit.<namespace_id>.limit` (to check limits in a specific namespace)

  • Unkey v2 ratelimit multi limit

    Check and enforce multiple rate limits in a single request for any identifiers (user IDs, IP addresses, API clients, etc.). Use this to efficiently check multiple rate limits at once. Each rate limit check is independent and returns its own result with a top-level `passed` indicator showing if all checks succeeded. **Response Codes**: Rate limit checks return HTTP 200 regardless of whether limits are exceeded — check the `passed` field to see if all limits passed, or the `success` field in each individual result. A 429 may be returned if the workspace exceeds its API rate limit. Other 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors. **Required Permissions** Your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>#limit` for every namespace in the request. Use `*` for the namespace ID to cover all namespaces in a project. To create missing namespaces automatically, your root key must also have `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/*#write` for the workspace's default project. The `#limit` permission must cover each created namespace.

  • Unkey v2 ratelimit set override

    Create or update a custom rate limit for specific identifiers, bypassing the namespace default. Use this to create premium tiers with higher limits, apply stricter limits to specific users, or implement emergency throttling. **Important:** Overrides take effect immediately and completely replace the default limit for matching identifiers. Use wildcard patterns (e.g., `premium_*`) to match multiple identifiers. **Permissions:** Requires `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>/overrides/*#write` to create overrides. To update an override, you can replace `*` with its override ID.

  • Unkey v2 ratelimit update namespace

    Rename a rate limit namespace, identified by its ID or current name. Renaming to the current name returns the namespace without a write. **Important**: Overrides stay with the namespace. Requests that pass the namespace by name, such as `ratelimit.limit`, must use the new name. A `ratelimit.limit` call with the old name can create a new, empty namespace with that name. A name that is in use or was deleted returns 409. Other API nodes can take up to a minute to see the new name. **Required Permissions** Your root key must have one of the following permissions: - `unkey:v1:<workspace_id>:projects/*/ratelimits/namespaces/*#write` (to rename any namespace) - `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>#write` (to rename a specific namespace)

  • Unkey v2 workspace update flag

    Enable or disable a flag for your workspace. Use `workspace.getFlags` to find flag slugs and check whether they can be enabled or disabled. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:flags#write`

PreviousPage 2 / 2