Settings & folders

Namespaces settings and folders plus the settings blueprint (actionstools_app/settings/), table em_actions_settings (_staging outside production), key (instance_id, config_key). Settings are global: every route uses INSTANCE_ID = 1 (settings/services.py), regardless of the request’s instance header.

Settings

Method Path Behaviour

GET

/settings/

All settings, every page fetched server-side. The caller must have the required permission in the Payability internal API (PermissionCheckingValidator). ?q= filters are supported.

POST

/settings/

Create {config_key, config_type, config_value}. config_type must be one of the types below and config_value is validated by that type’s helper.

GET

/settings/<config_key>/

Single setting. Also accepts instance-token auth (Authorization: Token … + instance header) — this is the route other services call.

PUT

/settings/<config_key>/

Replace config_value, validated against the stored type.

DELETE

/settings/<config_key>/

Soft delete.

GET

/settings/<config_type>/items

All settings of one type (instance_id-config_type-index), with meta.count.

config_type values (settings/models.py): string, number, html, list, nested_list, task_template, dict, json, unified_email_config, email_config, email_frontend_automatic_config, email_frontend_batch_config, email_frontend_config, email_frontend_template, email_base_template. Types mapped to plain ConfigType accept any value.

Complex values are stored in DynamoDB’s marshalled form and unmarshalled on read (the M/L checks in the views).

Folders

Email template folders are a single list setting whose key is config.TEMPLATES_FOLDER_SETTINGS_KEY (template_folders).

Method Path Behaviour

GET

/folders/

The folder setting; config_value is [] if it does not exist yet.

POST

/folders/

{"folder_name": "…​"} appends a folder. 400 if the setting is not a list.

DELETE

/folders/<folder_name>/

Removes a folder.