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

Collection settings

The settings of a table apply to every API of the table. They override the settings of the database, and an API can override them in turn.

Page API Info → DB API → select the table → Add Collection Settings.
Type T.IInstanceApiSettingsTypes
Applies to The APIs of this table.
Collection settings
import * as T from 'types';

// Remove properties which you want to apply from parent level
let instanceColSetting: T.IInstanceApiSettingsTypes = {
    enableCaching: true,                 // the reads of this table are cached until a write
    acceptOnlyEncryptedData: false,
    apiAccessType: T.EAPIAccessType.TOKEN_ACCESS,
    authProviders: ['users_tg'],         // every API of the table needs a person of users_tg
};
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.
enableCaching true / false Cache the answers of the reads in Redis until a write of the table : see automatic caching. Table and database level only.
  • 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.