/api/v1/config

Administrators can define base configuration using this API. fylr has a basic set of configuration items which are in the core system, such as the name of the instance, administrator's main address, language definitions and so on.

Frontends are required to implement a generic form editor for base configuration items. The list of items can be retrieved using the config/list API.

This list is not stable and can be changed without API change in any new version of fylr. Plugins can extend the list of configuration items. So, depending on the list of loaded plugins in fylr, the list has a various number of items.

GET /config — Get all base configuration

Get all base configuration

get

Any authenticated user may read the config; items the session is not permitted to read are filtered out of the response rather than causing a 403. The request itself is never rejected for lack of system.config.

Differs from easydb 5: reading the config does not require the system.config system right (in easydb 5 the GET config call requires system.config); fylr instead filters out the items the session may not read.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Responses
200

The response contains the base configuration values. Items the session is not permitted to read are omitted.

application/json
pluginobjectOptional

POST /config — Write all base configuration

Write all base configuration

post
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
savestring · enumOptional

If set to ignore_errors, the save persists the config despite recoverable ("savable") errors in the base config, such as an LDAP connection that fails to dial. A non-savable error still aborts the save. Implied when confirm=yes.

Possible values:
confirmstring · enumOptional

Set to yes to acknowledge a pending confirmation (HTTP 202) task and proceed with the save. When confirm=yes, config errors are also ignored (equivalent to save=ignore_errors).

Possible values:
reindexstring · enumOptional

Answer to the re-index confirmation raised when the frontend or database languages change (system.languages). skip = no re-index; reindex = re-index in the background; reindex_block = re-index and temporarily lock the frontend. Omitted = no re-index requested.

Possible values:
Body
pluginobjectOptional
Responses
200

The response contains the base configuration values.

application/json
pluginobjectOptional

GET /config/{path} — Read a single base-config item or nested value

Read a single base-config item or nested value

get

Returns the config sub-tree addressed by the path — a config item object, or a scalar when the path reaches a leaf value. Like GET /config, any authenticated user may read; items the session is not permitted to read are filtered out. The request is never rejected for lack of system.config.

Differs from easydb 5: reading the config does not require the system.config system right (in easydb 5 the GET config call requires system.config).

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
pathstringRequired

Slash-separated config path, either system/config/<name>/... or plugin/<plugin>/config/<name>/.... The leading segments select the config item; any further segments address a nested value inside it. A segment may itself contain a / encoded as %2F. Examples: system/config/name, system/config/name/title/de-DE, plugin/fylr_example/config/custom/data.

Responses
200

The config sub-tree (an object) or the scalar value addressed by the path.

application/json
anyOptional

The config item object, or the scalar value at the addressed leaf.

Example: {"title":{"de-DE":"FYLR apitest [DE]","en-US":"FYLR apitest [EN]"}}

POST /config/{path} — Set a single base-config item or nested value

Set a single base-config item or nested value

post

Sets the JSON value sent in the body at the addressed path, using an sjson patch on the current stored value, then re-validates and re-saves the whole affected config item. Because the whole item is re-saved, this can raise the same 400 / 202 flows as POST /config. An empty body is rejected. Requires system.config (system.root always satisfies it).

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
pathstringRequired

Slash-separated config path, either system/config/<name>/... or plugin/<plugin>/config/<name>/.... The leading segments select the config item; any further segments address a nested value inside it. A segment may itself contain a / encoded as %2F. Examples: system/config/name, system/config/name/title/de-DE, plugin/fylr_example/config/custom/data.

Body
anyOptional

The JSON value to set at the path. May be an object, array or scalar. Must not be empty.

Example: {"a":"b"}
Responses
200

The patched config sub-tree (the value now stored at the path).

application/json
anyOptional

The value stored at the addressed path after the patch.

Example: {"a":"b"}

DELETE /config/{path} — Remove a single base-config item or nested value

Remove a single base-config item or nested value

delete

Removes the value at the addressed path (an sjson delete on the current stored value), then re-saves the affected config item through the same path as POST /config, so it can raise the same 400 / 202 flows. Sending a request body is rejected (400, code ServerGeneric). A DELETE on bare /config (no sub-path) always returns 404. Requires system.config (system.root always satisfies it).

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
pathstringRequired

Slash-separated config path, either system/config/<name>/... or plugin/<plugin>/config/<name>/.... The leading segments select the config item; any further segments address a nested value inside it. A segment may itself contain a / encoded as %2F. Examples: system/config/name, system/config/name/title/de-DE, plugin/fylr_example/config/custom/data.

Responses
200

The value at the path was removed. The body is the value at the path after deletion — null for a removed leaf.

application/json
anyOptional

The value at the addressed path after deletion.

No content

Last updated