Skip to content
This page View Markdown Open in ChatGPT Open in Claude

API settings

The settings of one API of a table, for example the get all of products : the most specific level. A key set here wins over the table and the database.

Page API Info → DB API → select the table → the API → Add API Settings.
Type T.IInstanceApiSettingsTypesForAPI
Applies to This API only. Caching is not set here : it belongs to the table or the database.
Make one read public, keep the writes behind tokens
1
2
3
4
5
6
7
8
import * as T from 'types';

// Remove properties which you want to apply from parent level
let instanceColSetting: T.IInstanceApiSettingsTypesForAPI = {
    acceptOnlyEncryptedData: false,
    apiAccessType: T.EAPIAccessType.IS_PUBLIC,
};
module.exports = instanceColSetting;

The keys

Key Values Meaning
apiAccessType TOKEN_ACCESS (default), IS_PUBLIC, NO_ACCESS Who may call : with the token of an API user, anybody, or only your own code and the admin panel.
authProviders names of auth providers The person tokens the call must carry. Absent : common.authProviders of the secret. [] : the API user token alone.
acceptOnlyEncryptedData true / false Refuse plain bodies and query strings : see encrypted payloads.
  • A setting is used when it is present : leave a key out to inherit it. The order is API settings → table settings → database settings → secret → default.

  • NO_ACCESS hides an API from HTTP while your custom APIs keep using it through g.sys.db : a way to expose a narrow custom API instead of the raw table.