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 apis delete api

    Permanently delete an API namespace and immediately invalidate all associated keys. Use this for cleaning up development environments, retiring deprecated services, or removing unused resources. All keys in the namespace are immediately marked as deleted and will fail verification with `code=NOT_FOUND`. **Important**: This operation is immediate and permanent. Verify you have the correct API ID before deletion. If delete protection is enabled, disable it first through the dashboard or API configuration. **Required Permissions** Your root key must have one of the following permissions: - `api.*.delete_api` (to delete any API) - `api.<api_id>.delete_api` (to delete a specific API)

  • Unkey v2 apps delete app

    Delete an existing app, identified by its id. Deletion is asynchronous and eventually consistent. The app and all of its associated resources (environments, deployments, custom domains) are torn down by a background workflow. A successful response indicates the deletion was enqueued, not that every resource has already been removed. Apps with delete protection enabled cannot be deleted until protection is disabled. **Required Permissions** Your root key must have one of the following permissions: - `app.*.delete_app` (to delete any app) - `app.<app_id>.delete_app` (to delete a specific app)

  • Unkey v2 domains delete domain

    Delete a custom domain from your workspace. Address the domain by its id or by its name. Names are unique per workspace, so `api.acme.com` is enough. Unkey stops serving the domain. Later requests fail with a certificate error. The DNS records at your provider stay in place. **Required Permissions** Your root key must have `delete` permission on the domain: `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>/environments/<environment_id>/domains/<domain_id>#delete`. Use `*` in place of resource IDs to grant access to all matching domains in your workspace.

  • Unkey v2 environments remove environment variables

    Remove environment variables from an environment in a single atomic request. This operation only deletes keys by name. Keys in the payload that exist are removed; keys that are not present are ignored, since their absence already matches the requested state. To replace or update values, use `setEnvironmentVariables` instead. The whole operation is atomic: if any part fails the environment is left unchanged. Duplicate keys in the payload collapse to a single removal. Values are never read or returned. **Required Permissions** Your root key must have `delete` permission on the environment's variable collection: `unkey:v1:{workspace_id}:projects/{project_id}/apps/{app_id}/environments/{environment_id}/variables/*#delete`. Replace the placeholders with resource IDs, not names or slugs. A broader permission that covers this collection also grants access.

  • Unkey v2 environments set environment variables

    Create or update environment variables for an environment in a single atomic request. By default this is an upsert: each variable in the payload is created if new or fully overwritten if the key already exists, and any variable not in the payload is left untouched. This lets you change one variable without re-sending the others, which matters for write-only secrets you can no longer read back. Set `prune: true` to make it a full replace instead: after upserting, every variable not in the payload is deleted. Sending `prune: true` with an empty `variables` list resets the environment by deleting every variable. Each variable is written exactly as sent, never merged, so omitted optional fields fall back to their defaults rather than the previous value. Values are always encrypted at rest. Set `kind: recoverable` to allow a value to be read back; it defaults to `writeonly`, which can never be read back through the API. **Required Permissions** Your root key must have `write` on the environment's variable collection: `unkey:v1:{workspace_id}:projects/{project_id}/apps/{app_id}/environments/{environment_id}/variables/*#write`. When `prune` is true, it must also have `delete` on the same collection: `unkey:v1:{workspace_id}:projects/{project_id}/apps/{app_id}/environments/{environment_id}/variables/*#delete`.

  • Unkey v2 gateway set policies

    Replace an environment's gateway policies in a single atomic request. Policies run at the edge before requests reach your app: verify API keys, rate limit, block requests outright, or validate them against your OpenAPI spec. Policies are an ordered list: the gateway evaluates them top to bottom and the first rejection short-circuits the request. Each policy sets exactly one of `keyauth`, `ratelimit`, `firewall` or `openapi`, plus optional `match` expressions restricting which requests it applies to. Every call is a full replace: the environment's policies become exactly the request list in the given order, and the server generates a fresh id for each one. An empty list removes all policies. The operation is atomic: if any policy is invalid, nothing is written. **Required Permissions** Your root key must have both permissions on the target environment's gateway policies: - `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>/environments/<environment_id>/gateway/policies/*#write` - `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>/environments/<environment_id>/gateway/policies/*#delete` Replace the placeholders with resource IDs. Wildcard grants can cover multiple resources, but access remains limited to the root key's workspace.

  • Unkey v2 identities delete identity

    Permanently delete an identity. This operation cannot be undone. Use this for data cleanup, compliance requirements, or when removing entities from your system. > **Important** > Requires `identity.*.delete_identity` permission > Associated API keys remain functional but lose shared resources > External ID becomes available for reuse immediately

  • Unkey v2 keys delete key

    Delete API keys from user accounts or for cleanup purposes. Use this for user-requested key revocation, account deletion workflows, or cleaning up unused keys. Keys are immediately invalidated. Two modes: soft delete (default, preserves audit records) and permanent delete. **Important**: For temporary access control, use `updateKey` with `enabled: false` instead of deletion. **Required Permissions** Your credential must have one of the following permissions: - `unkey:v1:<workspace_id>:projects/*/keyspaces/*/keys/*#delete` (to delete keys in any project) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/*/keys/*#delete` (to delete keys in a specific project) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#delete` (to delete keys in a specific keyspace) - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/<key_id>#delete` (to delete a specific key)

  • 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 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 projects delete project

    Delete an existing project in your workspace, identified by its id. Deletion is asynchronous and eventually consistent. The project and all of its associated resources (apps, environments, deployments, custom domains) are torn down by a background workflow. A successful response indicates the deletion was enqueued, not that every resource has already been removed. Projects with delete protection enabled cannot be deleted until protection is disabled. **Required Permissions** Your root key must have one of the following permissions: - `unkey:v1:<workspace_id>:projects/*#delete` (to delete any project in the workspace) - `unkey:v1:<workspace_id>:projects/<project_id>#delete` (to delete a specific project)

  • Unkey v2 ratelimit delete namespace

    Delete a rate limit namespace and all of its overrides, identified by the namespace ID or name. **Important**: A deleted name cannot be reused. `ratelimit.limit` and `ratelimit.multiLimit` return 410 for it instead of creating a new namespace, so a deleted namespace does not turn into unlimited traffic. Other API nodes can take up to a minute to see the deletion. **Required Permissions** Your root key must have one of the following permissions: - `unkey:v1:<workspace_id>:projects/*/ratelimits/namespaces/*#delete` (to delete any namespace) - `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>#delete` (to delete a specific namespace)

  • Unkey v2 ratelimit delete override

    Permanently remove a rate limit override. Affected identifiers immediately revert to the namespace default. Use this to remove temporary overrides, reset identifiers to standard limits, or clean up outdated rules. **Important:** Deletion is immediate and permanent. The override cannot be recovered and must be recreated if needed again. **Permissions:** Requires `unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>/overrides/<override_id>#delete`, or a wildcard URN permission that includes this override and action. Without read access to the override, insufficient permissions return 404. With read access but no delete permission, the response is 403.