Scopes
Bu içerik henüz dilinizde mevcut değil.
A scope is a permission string that a Kit requests in its manifest: bot scopes in bot.scopes, user scopes in
userScopes. The two sets are separate. A token holds the scopes granted when it was issued, limited to what the
installed manifest version still requests; GET /auth/test shows them.
- A scope never bypasses membership. A bot token sees only channels the Kit bot was added to. A user token sees only what its member can see.
- Own messages only.
messages:writeedits and deletes only messages the token’s actor posted. - Missing scope:
403with codemissing_scopeand the headerX-Ketvia-Required-Scope: <scope>. - Wrong token type:
403with codeforbidden. In v1, Kit bots cannot add or remove reactions or upload files; use a user token for those even if the bot holds the scope.GET /runs/{id}takes user tokens only. - Least privilege. Request only what the Kit uses. Every scope is shown to the admin who installs the Kit, and
users:read.emailis shown as sensitive.
Catalogue
Section titled “Catalogue”The method column is generated from the Web API route table. Methods without a scope (GET /auth/test,
POST /auth/rotate, GET /users/me, GET /installation) work with any valid token of the right type.
| Scope | Bot | User | Grants | Web API methods |
|---|---|---|---|---|
conversations:read | Yes | Yes | List conversations the actor is in and read their metadata and members. | GET /conversationsGET /conversations/{id}GET /conversations/{id}/members |
messages:read | Yes | Yes | Read message history and threads in those conversations. Private assistant results are never included. | GET /conversations/{id}/messagesGET /messages/{id}GET /messages/{id}/replies |
messages:write | Yes | Yes | Post messages (with Blocks), and edit and delete the actor’s own messages. | POST /messagesPATCH /messages/{id}DELETE /messages/{id} |
messages:write.ephemeral | Later phase (no v1 method) | – | Post messages visible to one member only. | POST /messages/ephemeral |
reactions:read | Yes | Yes | Read reactions. | None in v1 |
reactions:write | Yes (method refused for bots in v1) | Yes | Add and remove the actor’s own reactions. | POST /reactionsDELETE /reactions |
files:read | Yes | Yes | Read file metadata and content in visible conversations. | GET /files/{id}GET /files/{id}/content |
files:write | Yes (method refused for bots in v1) | Yes | Upload files. | POST /files |
users:read | Yes | Yes | Read the member directory: id, display name and role. | GET /usersGET /users/{id} |
users:read.email | Yes | Yes | Adds email addresses to member records. Shown as sensitive at install. | Adds email to the users:read methods |
commands | Later phase | – | Register the manifest’s slash commands. | None in v1 |
incoming-webhook | Yes | – | Incoming webhooks into channels chosen by an admin. | Incoming webhook URLs |
assistant:tools | Later phase | – | Expose the manifest’s tools to Ketvia assistants. | None in v1 |
feeds:publish | Yes | – | List the declared feeds with their connected-room counts and publish an event of a feed once; Ketvia posts it into every room the feed is connected to (none connected: 202, nothing posted). | GET /feedsPOST /feeds/{type}/events |
external-token:read | Yes | – | Fetch the installation’s current external access token (30 per minute). | POST /installation/external-token |
assistant-records:read | Yes | – | Read the notes linked to the Kit’s own records, in channels the Kit bot was added to. | GET /installation/records/{type}/{id}/notes |
assistant-records:write | Yes | – | Add a note linked to one of the Kit’s own records, shown as written by the Kit. | POST /installation/records/{type}/{id}/notes |
runs:read | – | Yes | Read the member’s assistant runs (private runs only for their requester). | GET /runs/{id} |
Private Kits in this phase may request these bot scopes: conversations:read, messages:read, messages:write,
reactions:read, reactions:write, files:read, files:write, users:read, users:read.email and
incoming-webhook, commands and messages:write.ephemeral, plus any user scope. assistant:tools is rejected
until a later phase. messages:write.ephemeral is the scope of POST /messages/ephemeral.
feeds:publish is bot-only and required by every Kit whose manifest declares feeds (a manifest with feeds but
without the scope, or the scope without feeds, is rejected). The Kit publishes an event once with
POST /feeds/{type}/events; it never learns which rooms the people of a workspace connected the feed to, and Ketvia
posts the Kit bot’s message into each of them. The admin sees this scope at install time as “Posts events from the Kit
to the channels you connect”. See Event feeds; 202 with subscriptions: 0 (nobody connected the
feed) is not an error.
external-token:read is bot-only and may be requested only by a Kit that declares externalAuth and sets
tools.auth to signature+externalToken. It hands the Kit the connected external account’s current access token
(refreshed when it is about to expire) through POST /installation/external-token, so scheduled work and webhook-driven
cards can run without a user request. It gives the Kit nothing the signed tool calls do not already carry. Calls are
limited to 30 per minute per installation; each one, and each refusal, is audited with ids and the expiry (never the
token), and the response is Cache-Control: no-store. 409 external_auth_required means the external account must be
reconnected: skip the work and post nothing. 503 external_auth_unavailable with Retry-After: 30 means the account is
temporarily unavailable: retry later, do not reconnect. Never keep the
token beyond its expiresAt; the SDK’s installation.externalToken() does not retry after a 5xx.
assistant-records:read and assistant-records:write are bot-only. They let a Kit read and add notes linked to its
own records (the types its manifest declares under records), through
GET|POST /installation/records/{type}/{id}/notes. A note is always a plain note shared with one channel the Kit bot
was added to; members see it beside their own notes of that record, marked as written by the Kit. A Kit never reads
private notes, notes in channels it was not added to, or notes linked by another Kit. See Records.
The admin sees them at install time as “Reads notes linked to its own records” and “Adds notes linked to its own
records”.
GET /installation/settings needs no scope (bot tokens only): it returns the installation settings an
admin saved.
No admin scopes
Section titled “No admin scopes”There are deliberately no admin scopes: no scope lets a Kit manage members or channels, read the audit log, change assistant permissions, or create, approve or reject approvals.