# Key Types & Scopes

#### Master Key (`g_master_`)

* One per user. Creating a new one revokes the previous (and cascade-revokes all agent keys).
* Full access to all endpoints and all agents owned by the user.

#### Agent Key (`g_agent_`)

* One per agent. Tied to a single agent by `agent_id`.
* Cannot access other agents (returns `403`).
* Access controlled by **scopes** assigned at creation time.

#### Scopes

| Scope          | Description                                              | Default         |
| -------------- | -------------------------------------------------------- | --------------- |
| `agent:read`   | View agent details and status                            | Always included |
| `agent:manage` | Start, stop, pause, reload. Manage sessions and archives | No              |
| `channels`     | Manage Telegram pairing (list, approve, revoke, reject)  | No              |
| `files`        | Upload files to the agent                                | No              |
| `chat`         | Send messages to the agent via API                       | No              |

A master key implicitly has all scopes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.guayaba.run/documentation/api-reference/key-types-and-scopes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
