# API Keys

An API key allows a script or AI assistant to work within your organization, with your permissions, without going through the interface.

## Create a key

1. Open your user settings from your profile.
2. In **API keys and AI assistants**, select the relevant organization.
3. Give a name to the key (e.g., "Claude Desktop"), choose its access level, duration, and authorized project(s), then click **Create key**.
4. Copy the key: it starts with `vyse_` and **is shown only once**.

Test it:

```bash
curl https://api.vyse.cloud/api/v1/context -H "Authorization: Bearer vyse_..."
```

## Access levels

| Access | Scopes | Authorizes |
|---|---|---|
| **Read** | `read` | Read projects, hierarchy, assets, textures, settings. |
| **Read & write** | `read`, `write` | Also create, modify, and delete categories, folders, assets, textures, Bedrock settings. |
| **Read, write & manage** | `read`, `write`, `manage` | Also change project configuration and create projects. |

Scopes are cumulative: `write` includes `read`, `manage` includes both.

## A key acts with your permissions, never more

A key belongs to **you** and **an organization**. On each call, Vyse checks the key's scope **and** your actual role within the project. Therefore, a `manage` key created by a simple member cannot change project configuration: it requires the **MANAGER** role.

A key is limited to projects checked by default. Check **All projects I can access** only if the assistant must be able to work in all your accessible projects. A limited key cannot create a project.

> **Note:** If you leave the organization, your keys stop working immediately. If your role decreases, your keys lose corresponding rights at the same time.

## Duration, revocation, tracking

- Durations: 7 days, 30 days, 90 days (default), 1 year, or no expiration.
- **Revoke** cuts the key off immediately.
- The list shows the start of the key (`vyse_k1a2b3c4…`), its access level, its projects, its owner, its last use, and its expiration.
- In your user settings, you see and revoke your own keys. The API also allows managers and owners to see and revoke organization keys.
- Vyse keeps only the key fingerprint, never the key itself.

## Via API (with an application session)

```bash
# List
GET    /api/organizations/<orgId>/api-keys
# Create: response contains "token", shown once
POST   /api/organizations/<orgId>/api-keys
       {"name": "CI", "scopes": ["write"], "projectIds": [], "expiresInDays": 30}
# Revoke
DELETE /api/organizations/<orgId>/api-keys/<keyId>
```

These routes serve the application and require a user session. An API key cannot create other keys.

> **Important:** the **plugin token** (section **Organization Plugin Token**) is something else: it serves only the Minecraft plugin and does not open the v1 API.

## Next steps

- [The API](/automate/the-api)
- [The MCP server](/automate/the-mcp-server)
- [Permissions](/reference/permissions)
