# manage_organization (/mcp/tools/manage_organization)

`manage_organization` · Changes data

Create and change organizations and manage their people. Admins only, except `create`, open to anyone.

Set `action` to one of these:
- `create` (needs `body`): Create an organization with its first product, for a new company (to add a product to an existing organization: `manage_product` with action `create`). The person becomes its Admin. It also starts the product's knowledge base read: `meta.ingestionRun`, or null when it could not start (then `manage_knowledge_base` with action `start_read`). The read takes minutes: check `read_knowledge_base` with action `read` every 30 seconds; it is done when its status is completed, failed or stopped. Not safe to retry: each call creates another organization. Counts toward the lower limit on calls that start AI runs or knowledge base reads.
- `update` (needs `organizationId`, `body`): Send `name`, `reportingCurrency` (what ARR is shown in: EUR or a code from `read_crm` with action `currencies`) or both. The same values again change nothing, so a retry is safe. Clearing `allowKeysWithoutExpiry` while keys without expiry exist can't be undone, so Heuristic asks the person first then (see `confirm`).
- `invite` (needs `organizationId`, `body`): Invite up to 20 email addresses with one role (trimmed, lower-cased, repeats merged). One after another, each is emailed an invitation link valid for 7 days, or added at once when it has a Heuristic account, with its own `outcome`: invited, added, already_member, or not_sent (the email failed; nothing saved for it). Any other error stops the call; addresses handled before it stay done.
- `update_member` (needs `organizationId`, `userId`, `body`): Change another member's `role` (admin or user), `status` (active or disabled), or both; never the person's own. At least one active Admin must stay (`last_admin`). A disabled member can't sign in until enabled. Product access stays stored: an Admin made a User again keeps the access they had. The same values again change nothing, so a retry is safe.
- `remove_member` (needs `organizationId`, `userId`): Remove another member, active or disabled: ends their membership and their access to every product of the organization, and their apps lose it at once; only a new invitation brings them back. What they made stays, shown as by a former member. To pause someone, disable them with `manage_organization` with action `update_member`. Not the person themselves (`forbidden`): they leave with `update_me` with action `leave_organization`. A non-member is not found. This can't be undone, so Heuristic asks the person first (see `confirm`).
- `resend_invitation` (needs `organizationId`, `invitationId`): Send an open invitation again: a new link valid for 7 days, same role; the old link stops working. An address with a Heuristic account by now is added (`outcome` added), a member answers `already_member`, an accepted, cancelled or unknown invitation is not found, and when the email can't be sent nothing changes (`service_unavailable`).
- `cancel_invitation` (needs `organizationId`, `invitationId`): Cancel an open invitation: its link stops working at once. The person can be invited again.
- `revoke_api_key` (needs `organizationId`, `keyId`): Revoke any API key in the organization, a member's or an organization key: anything using it stops at once. Not found: already revoked or expired. This can't be undone, so Heuristic asks the person first (see `confirm`).

## Actions (set `action`)

### `create`

- Who can use it: Anyone signed in
- Hints: Changes data, Reaches outside Heuristic
- Runs: [`create_organization`](/api/organizations/create_organization)
- Inputs:
  - `body` (object, required): The organization and its first product.
    - `name` (string, required): The organization's name, usually the company's, 1 to 100 characters.
    - `product` (object, required): Its first product.
      - `name` (string, required): The product's name, 1 to 100 characters, on one line.
      - `knowledgeBaseUrl` (string, required): The product's public documentation site, an http or https address such as https://docs.example.com; never a local or private address. Heuristic reads it to find the product's features.
      - `description` (string): What the product is, up to 500 characters. Empty when left out.

### `update`

- Who can use it: Admins
- Hints: Changes data, Can remove data, Safe to repeat
- Asks the person to confirm before it runs.
- Runs: [`update_organization`](/api/organizations/update_organization)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `body` (object, required): Send the fields to change. Fields left out stay as they are.
    - `name` (string): The organization's new name, 1 to 100 characters.
    - `reportingCurrency` (string): The currency ARR is shown in: EUR or a three-letter code from `read_crm` with action `currencies`, in any case.
    - `allowKeysWithoutExpiry` (boolean): Whether members' own API keys may never expire (organization keys always may). False gives each such key without expiry an expiry 90 days from now (true doesn't undo it).
  - `confirm` (boolean): True only after the person said yes to the question a first call answered with `confirmation_required`. Ignored when your app can show the person questions: Heuristic then asks them itself.

### `invite`

- Who can use it: Admins
- Hints: Changes data, Reaches outside Heuristic
- Runs: [`invite_members`](/api/invitations/invite_members)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `body` (object, required): Up to 20 distinct addresses with one role; each is handled as a single invite.
    - `emails` (array of string, required): The email addresses to invite: up to 20 distinct ones (at most 100 entries before repeats merge).
    - `role` (string, required): The role for all of them. `admin` manages the organization and owns every product; `user` opens only the products they are given. Allowed values: `admin`, `user`.
    - `products` (array of objects): Products of this organization the person gets when they join (Users only; Admins own every product).
      - `productId` (string, required): An id (a uuid), from an earlier result.
      - `access` (string, required): `owner` reads and changes the product's data; `viewer` only reads it. Allowed values: `owner`, `viewer`.

### `update_member`

- Who can use it: Admins
- Hints: Changes data, Safe to repeat
- Runs: [`update_member`](/api/members/update_member)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `userId` (string, required): The member's user id, from `read_organization` with action `members` or `read_product` with action `access`.
  - `body` (object, required): Send a role, a status, or both. The organization must keep at least one active Admin.
    - `role` (string): `admin` manages the organization and owns every product; `user` opens only the products they are given. Allowed values: `admin`, `user`.
    - `status` (string): `disabled` stops the member from signing in, keeping their access for later; `active` lets them in again. Allowed values: `active`, `disabled`.

### `remove_member`

- Who can use it: Admins
- Hints: Changes data, Can remove data
- Asks the person to confirm before it runs.
- Runs: [`remove_member`](/api/members/remove_member)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `userId` (string, required): The member's user id, from `read_organization` with action `members` or `read_product` with action `access`.
  - `confirm` (boolean): True only after the person said yes to the question a first call answered with `confirmation_required`. Ignored when your app can show the person questions: Heuristic then asks them itself.

### `resend_invitation`

- Who can use it: Admins
- Hints: Changes data, Reaches outside Heuristic
- Runs: [`resend_invitation`](/api/invitations/resend_invitation)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `invitationId` (string, required): The invitation's id, from `read_organization` with action `invitations`.

### `cancel_invitation`

- Who can use it: Admins
- Hints: Changes data
- Runs: [`cancel_invitation`](/api/invitations/cancel_invitation)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `invitationId` (string, required): The invitation's id, from `read_organization` with action `invitations`.

### `revoke_api_key`

- Who can use it: Admins
- Hints: Changes data, Can remove data
- Asks the person to confirm before it runs.
- Runs: [`revoke_organization_api_key`](/api/organizations/revoke_organization_api_key)
- Inputs:
  - `organizationId` (string, required): From `get_me`.
  - `keyId` (string, required): The API key's id, from `read_organization`'s `api_keys` action.
  - `confirm` (boolean): True only after the person said yes to the question a first call answered with `confirmation_required`. Ignored when your app can show the person questions: Heuristic then asks them itself.
