Scopes and repository access
Every tool requires one of three access levels. The levels are hierarchical:admin includes write, and write includes read.
| Scope | Grants |
|---|---|
read | View repositories, changes, commits, content, and diffs. |
write | Everything in read, plus creating changes, writing files, and creating, moving, merging, and deleting bookmarks. |
admin | Everything in write, plus API key and webhook management. |
- OAuth tokens are granted to your user within an organization and carry full access to that organization.
- API keys can additionally be scoped to specific repositories. Tool calls targeting any other repository are rejected. This is the way to give an agent least-privilege access. See Auth & Permissions for key management.
Errors
A missing or invalid credential returns401 Unauthorized with a WWW-Authenticate header pointing back at the metadata, so a client can re-discover and re-authenticate:

