Data API базы: доступ к методу
data_api_grantWho may call a method of a table or a function: shows the SQL and applies it after consent.
OPENS DATA TO THE INTERNET. Call it without `apply` first: the platform
returns the commands and warnings (for example "row-level security is
off — a visitor will get every row"). Show them to the person. With
apply=true a client with forms asks the person itself; without forms get
consent in the chat and pass confirmed=true together with expected_sql
from the preview.
Methods you do not name keep their current level. Exactly the shown
commands are applied: if the grants changed meanwhile, the platform
refuses — show the new ones. Needs a token with the admin scope, for the
preview too.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"object": "<object>"
},
"name": "data_api_grant"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| get | No | Reading the table. closed — nobody; visitor — any site visitor; user — people signed in to the app; server — only a server holding the secret key. | |
| call | No | Calling the function. closed — nobody; visitor — any site visitor; user — people signed in to the app; server — only a server holding the secret key. | |
| post | No | Inserting rows into the table. Same levels as `get`. | |
| apply | No | false (default) — only show the commands. true — apply them after the person's consent. | |
| patch | No | Updating rows of the table. Same levels as `get`. | |
| delete | No | Deleting rows of the table. Same levels as `get`. | |
| object | Yes | A table `schema.name` or a function `schema.name`; for an overloaded function — `schema.name(types)`. As listed by data_api_methods. | |
| database | No | The database: name, slug or id. Without it — the organization's only database with the Data API enabled. | |
| confirmed | No | true — the person has already agreed in the chat after seeing what will change. A client with forms does not need it: the server asks the person itself. Never set it without the person's explicit consent. | |
| expected_sql | No | The `sql` commands from the preview answer that the person saw. Required with confirmed=true: only these are applied. | |
| organization | No | Organization slug. Without it — the only one, or the personal one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| next | Yes | ||
| object | Yes | ||
| applied | Yes | ||
| current | Yes | ||
| database | Yes | ||
| warnings | No | ||
| next_action | Yes | ||
| organization | Yes |