> ## Documentation Index
> Fetch the complete documentation index at: https://www.unkey.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Unkey is two separate products. Compute builds, deploys, and runs apps behind a gateway. API Management issues API keys, enforces rate limits, manages identities and permissions, and reports usage. Say which product a page belongs to; a reader can use either without the other.
> Every Unkey API endpoint is an HTTP POST to https://api.unkey.com/v2/{service}.{procedure} with a root key in the Authorization: Bearer header. Root keys are workspace scoped.
> Error codes have the form err:{system}:{category}:{specific} and each has a page at /errors/{system}/{category}/{specific}.
> The word environment means production or preview in Compute. Rate limiting has four meanings on this site; the glossary lists them.

# portal_key_creation_unavailable

> The portal can't create keys for this end user until the workspace configuration is fixed.

> [!CAUTION]
>
> `err:unkey:application:portal_key_creation_unavailable`

An end user tried to create a key in the Customer Portal, but the key-creation settings on their portal session no longer match your workspace. No key was created. You get HTTP 412.

The end user only sees that key creation is unavailable. The message names no permission, role, or keyspace, so check the causes below yourself.

```json Example response theme={"system"}
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "Key creation is unavailable right now.",
    "status": 412,
    "title": "Precondition Failed",
    "type": "/errors/unkey/application/portal_key_creation_unavailable"
  }
}
```

## Likely causes

* A permission or role the session's policy names was deleted after the session was created. The portal never creates permissions on the end user's behalf.
* The end user's identity has a rate limit with the same name as one of the policy's rate limits. A key rate limit takes precedence over an identity one of the same name, so the new key would escape the identity's limit.
* The keyspace or its API was deleted.
* An identity with the end user's `externalId` already exists in a different project.

## How to fix

1. Recreate the missing permission or role, or rename the conflicting identity rate limit.
2. If the policy itself is wrong, create a new portal session with a corrected policy.

## Related errors

* [`err:unkey:application:portal_key_limit_reached`](https://www.unkey.com/docs/errors/unkey/application/portal_key_limit_reached): the end user already holds as many keys as the session allows.
* [`err:unkey:data:permission_not_found`](https://www.unkey.com/docs/errors/unkey/data/permission_not_found): the same missing permission, reported to a root key caller.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.