Scopes

A scope is a single permission on an API key, named resource:action. A key holds a set of them, and a tool refuses to run unless the key holds every scope that tool declares. This page lists all of them, which tools need each one, and the presets you can start from.

The scope table

Fourteen standard scopes, plus one reserved for Monofile administrators.

ScopeWhat it allowsTools that require it
files:readReading and inspecting files, and reading version historyread, canvas_check, list_versions, read_version, list_changesets
files:writeCreating and changing files, and restoring old contentwrite, edit, create_diagram, create_canvas, canvas_edit, revert_file, checkpoint, revert_changeset
files:deleteRemoving files and foldersrevert_changeset (a revert deletes files the changeset created)
shares:readChecking what is sharedget_folder_share_status, get_share_link
shares:writePublishing and revoking sharesshare_folder, unshare_folder, create_share_link, revoke_share_link
community:readBrowsing and reading public folderslist_community_folders, public_bash
community:writeCopying public work into your workspacefork_folder
users:readReading profiles and the user directoryget_my_profile, get_user, list_users
users:writeChanging your own profileupdate_profile
social:readReading comments, followers and the feedlist_comments, get_followers, get_following, get_feed
social:writeVoting, commenting and followingvote_folder, vote_comment, add_comment, edit_comment, delete_comment, follow_user, unfollow_user
search:semanticMeaning-based search over your own filessemantic_search
embeds:readReading embed configurationNone currently on the API
embeds:writeManaging embed configurationNone currently on the API
docs:adminAdministering Monofile's own public documentationNone. Excluded from every preset, and only effective for a key whose owner is a Monofile administrator.

Two tools declare no scope at all:

  • get_key_info needs none, so any valid key can ask what it is allowed to do.

  • bash declares none because the check depends on the command. The built-in shell derives the requirement from the command text (files:read to list and read, files:write for mkdir, mv, cp, touch and redirects, files:delete for rm). The full shell ignores the command text and checks what the command changed: creating, editing or renaming needs files:write, deleting needs files:delete. A missing scope rejects the whole set of changes and writes nothing, so a script, an alias or a python -c cannot smuggle a write past the check.

You can grant embeds:read and embeds:write, but no tool requires them today, so granting them changes nothing.

Presets

PresetScopesGood for
Read Onlyfiles:readBrowsing, auditing, search over a workspace you should not change
Read and Writefiles:read, files:writeOrdinary development: read, create, edit
Full AccessEvery standard scopeAutomation that also shares, comments and forks

Full Access means the fourteen standard scopes. No preset includes docs:admin, and no default grants it.

Choosing scopes

Start read-only and widen when a call fails. INSUFFICIENT_SCOPE names the missing scope:

json
{
  "error": {
    "code": "INSUFFICIENT_SCOPE",
    "message": "Missing required scopes: files:delete"
  }
}

Four rules:

  • Write and delete are separate. A key with files:write can overwrite a file but cannot rm it. Use that split for an agent that edits files.

  • Reverting needs both. revert_changeset requires files:write and files:delete, because undoing a run means deleting the files that run created.

  • Social write is loud. social:write lets a key vote, comment and follow under your name, in public. Grant it only to something you want speaking for you.

  • Scopes are not folder scope. Scopes say which operations the key may perform; folder scope says where. A narrow scope set on a folder-scoped key is the tightest useful configuration; see Authentication.

To see what a key holds, call get_key_info:

POST/api/tools/get_key_info
{}

To see which scopes each live tool declares, call GET /api/tools with that key. Every entry carries its own requiredScopes.

GET/api/tools

Next steps

707 words