# API keys (/guides/api-keys)

Your AI agent can list and revoke your keys for you. Once it's connected to Heuristic ([Connect an AI
agent](/mcp/connect)), ask it in your own words, for example "Revoke my API key named Weekly report." [Ask your
agent](#ask-your-agent) has more requests to start from. Creating an API key is done in the web app only, in the steps
below.

Everyone can create an API key for their own scripts, and Admins manage the organization's keys.

## Create an API key [#create-an-api-key]

An API key lets your own scripts and tools use the Heuristic API as you. Any member can create one.

1. Open **Settings → Personal → My API keys**.
2. Choose **Create API key**. The form opens in the box, above your keys.
3. Under **Name**, say what the key is for, so you know which one to revoke. If you belong to more than one
   organization, choose the **Organization** the key works in.
4. Under **Access**, choose **Read only** (can see what you can see; changes nothing) or **Full access** (can see and
   change what you can).
5. Under **Expires**, choose **30 days**, **90 days** or **1 year**. **No expiry** is offered only where your
   organization's Admins allow members' keys without expiry.
6. Choose **Create key**, then copy the key where the form was. You won't be able to see it again. Choose **Done**
   when you have it.

A key works only in its organization and can never reach more than you can: when your access shrinks, so does the
key's. You can have up to 10 active keys in each organization. Keys work only with the Heuristic API, not with AI
agents, which connect by signing in. Heuristic emails you 14 days before a key expires. During a support sign-in no
key can be created. [Authentication](/api/authentication#an-api-key-for-a-script-or-another-tool) says how a script
sends its key.

## Revoke an API key [#revoke-an-api-key]

1. In **Settings → Personal → My API keys**, choose **Revoke** in the key's row.
2. Choose **Revoke** to confirm.

Anything using the key stops working at once. This can't be undone.

## Manage your organization's API keys [#manage-your-organizations-api-keys]

Admins see every API key in the organization in **Settings → Organization → API keys**.

- **Organization keys** belong to the organization, not to a person, and keep working when the Admin who made one
  leaves. Choose **Create organization key**, then the **Name**, **Access** and **Expires** as for your own key.
  An organization key can always have **No expiry**, whatever the setting for members' keys says.
  A **Read only** organization key can see what an Admin can see; a **Full access** one can see and change every
  product and its feedback, as an Admin can. No organization key can manage people, product access, the
  organization's CRM or its settings, or delete a product. An organization can have up to 25 active organization
  keys. **Created by** names the Admin who made each one.
- **Members' keys** lists every API key a member created, with the person it belongs to. Your own keys are created
  in **My API keys**: **Create my API key** in this box opens it with the form ready. Its switch **Allow members'
  keys without expiry** decides whether members can create keys with **No expiry**. When you turn it off, members'
  new keys must expire, and their keys without expiry stop working once 90 more days have passed. **Organization keys**
  aren't affected. The change saves at once.
- A key that no one has used for 90 or more days shows **Unused**, a hint that it can go.

To revoke a key, choose **Revoke** in its row, then **Revoke** to confirm. It stops working at once.

## Common questions [#common-questions]

### What happens to my API keys when I leave an organization? [#what-happens-to-my-api-keys-when-i-leave-an-organization]

Your keys for that organization are revoked for good and leave the lists. Rejoining never brings one back: create a
new key. While an Admin has disabled you, your keys there are refused, and they work again once you are enabled.

## Ask your agent [#ask-your-agent]

Once your AI agent is connected to Heuristic ([Connect an AI agent](/mcp/connect)), you can ask it to do these jobs
for you, in your own words:

- "Which API keys do I have?" ([who you are](/mcp/tools/get_me))
- "Revoke my API key named Weekly report." ([update my account](/mcp/tools/update_me))
- "Which of Acme's API keys are unused? Revoke the one named Old export." ([read the
  organization](/mcp/tools/read_organization), [manage the organization](/mcp/tools/manage_organization))
- "Stop allowing members' keys without expiry in Acme." ([manage the organization](/mcp/tools/manage_organization))

Your agent asks you before it revokes a key or stops members' keys without expiry. It can't create an API key: you do that in
the Heuristic web app.