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

# Organization scope

> Understand how OAuth and API keys limit Moshi MCP operations to an organization.

Every Moshi MCP operation runs in an organization context.
The context controls products, flows, knowledge, conversations, and results.

## OAuth connections

The consent page lists organizations that your Moshi account can access.
You select one organization before you approve the client.
Moshi records the selection for that user and MCP client.

The selected organization becomes the default scope for later tool calls.
Moshi checks your organization membership on each request.
Removed membership stops access without a new client connection.

## API-key connections

A customer API key is bound to an organization.
The key owner must keep access to that organization.
Moshi rejects the key after the owner loses organization membership.

`MOSHI_ORGANIZATION_ID` sets the local server context when your issued key requires it.
Use the organization identifier supplied with the key.

## Change the organization

For hosted OAuth, remove the MCP connection and add it again.
Select the new organization during consent.

For a local connection, use credentials issued for the required organization.
Do not reuse a key from another organization.

> [!WARNING]
>
> Do not set `MOSHI_ORGANIZATION_ID` on the shared hosted server. Hosted OAuth resolves organization scope for each session.

## Scope errors

Reconnect when Moshi reports that the connection has no organization binding.
Choose an organization during the consent step.

Ask an organization owner to restore access when membership was removed.


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