Let a site call an API with a secret
manage_connectionsUse when the site's JavaScript must call an outside API: save a connection (name, https base URL, which secret, how it's sent), and the page calls fetch("/_ginta/api//"); Ginta adds the key and forwards to that base URL only. list shows connections and this month's calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auth | No | How the key is sent: "bearer" (Authorization: Bearer, default), "header" (auth_name = the header, e.g. X-API-Key) or "query" (auth_name = the parameter, e.g. appid). | |
| name | No | Connection name, e.g. "weather" (save, delete). | |
| action | Yes | What to do: list the connections, save (add or change) one, or delete one. | |
| secret | No | Name of the secret to attach (from manage_secrets). Omit for public APIs. | |
| methods | No | Allowed methods (default GET and POST). | |
| site_id | Yes | The site id: the first part of the site URL, e.g. "bella-roma" for https://bella-roma.ginta.page (see list_sites). | |
| base_url | No | The API's https base URL, e.g. "https://api.openweathermap.org/data/2.5". | |
| auth_name | No | Header or query parameter name for auth header/query. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | save/delete: the connection's name. | |
| site_id | Yes | The site id. | |
| connections | No | list: the connections. | |
| usage_this_month | No | list: calls this month. |