> ## Documentation Index
> Fetch the complete documentation index at: https://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_changed

> The portal was pointed at a different app or keyspace while the session was being created.

<Danger>`err:unkey:data:portal_changed`</Danger>

`portal.createSession` was working out the session's access from the portal's app or keyspace when the portal was pointed somewhere else. The session was not created, because it would have carried access to the old app or keyspace. You get HTTP 409.

```json Example response theme={"system"}
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The portal changed while the session was being created. Try again.",
    "status": 409,
    "title": "Conflicting Resource",
    "type": "/errors/unkey/data/portal_changed"
  }
}
```

## Likely causes

* Someone called `portal.updatePortal` with a new `keyspaceId` or `appId` at the same moment you called `portal.createSession`.

## How to fix

1. Retry `portal.createSession`. The new session uses the portal's current app or keyspace.


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