<< Back to GForge REST API

Entity: Setting

GET

getAiconfig

Returns AI/LLM configuration for a project or the site.

Parameters (1)

Name Type Description
id int Project id. Use 0 for site-level config (requires site admin). Project-level requires project admin.

Return: object

AI config with fields: ai_enabled, llm_provider, llm_model, llm_key.

getKnowledgeindexconfig

Returns the knowledge index configuration for a project or the site.

Parameters (1)

Name Type Description
id int Project id. Use 0 for site-level defaults (requires site admin). Project-level requires project admin.

Return: object

Knowledge index config with one boolean per section key: project, trackeritem, wikipage, scmcommit, forummessage.

getSetting

Searches for settings matching criteria, or retrieves a specific setting by database ID.

Parameters (5)

Name Type Description
id int Unique identifier for the setting record. ThisIf this value is specified, others will be ignored.
section string Section to filter results with. Examples are "project", "tracker", "trackeritem"
refId int Unique identifier for the $section being referenced. For $section = "project", $refId would be the project ID. Unixnames are not allowed.
settingName string Name of the setting to be retrieved.
defaultValue string If a record is not found, return this value instead. If none is specified, the method will return 404 (Not Found). Note: If $defaultValue is specified and no record is found, the response data will not include the id or project values.
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \gforge\core\models\api\SettingBasic

Zero or more SettingBasic records for a search. Zero or one SettingBasic record for an id retrieval.

Name Type Description
section string Section or Object type to which the setting belongs to
refId int ID of the referenced item
settingName string Name of the setting
settingValue mixed Value of the setting. If it was stored serialized variable contains unserialized object.
api_url \API URL to obtain this Setting record

Example 1

Find a setting by database ID:
  GET http://api.mygforge.tld/setting/125

{
   "id":125,
   "refId":"43",
   "section":"tracker",
   "settingName":"some_setting",
   "settingValue":"1"
}

Example 2

Fetch a setting by refId, Section and Setting Name:
  GET http://api.mygforge.tld/setting?refId=43§ion=tracker&settingName=some_setting

{
   "id":125,
   "refId":"43",
   "section":"tracker",
   "settingName":"some_setting",
   "settingValue":"1"
}

POST

postAiconfig

Creates or updates AI/LLM configuration for a project or the site.

Parameters (5)

Name Type Description
id int Project id. Use 0 for site-level (requires site admin). Project-level requires project admin.
ai_enabled bool Enable or disable AI for this scope. Pass an empty string to clear.
llm_provider string LLM provider name (e.g. openai). Pass an empty string to clear.
llm_model string LLM model name. Pass an empty string to clear.
llm_key string LLM API key. Pass an empty string to clear.

Return: object

Updated AI config with fields: ai_enabled, llm_provider, llm_model, llm_key.

postKnowledgeindexconfig

Creates or updates the knowledge index configuration for a project. Site-level is read-only.

Parameters (6)

Name Type Description
id int Project id. Must be greater than 0 (site-level not permitted). Requires project admin.
project bool Master enable/disable toggle. Optional.
trackeritem bool Index tracker items. Optional.
wikipage bool Index wiki pages. Optional.
scmcommit bool Index SCM commits. Optional.
forummessage bool Index forum messages. Optional.

Return: object

Updated knowledge index config.

postSetting

Creates or updates a Setting record. Only project admins or site admins can POST.

Parameters (4)

Name Type Description
section string Section identifying the object type (e.g. tracker, project). Required.
refId int Id of the referenced object. Required.
settingName string Name (key) of the setting. Required.
settingValue string Value for the setting. Required.

Return: array

Associative array with key location containing the URL of the setting record.

PUT

putSetting

Updates a Setting record. Identical to postSetting.

Parameters (4)

Name Type Description
section string Section identifying the object type. Required.
refId int Id of the referenced object. Required.
settingName string Name (key) of the setting. Required.
settingValue string Value for the setting. Required.

Return: array

Associative array with key location containing the URL of the setting record.

DELETE

deleteSetting

Deletes a Setting record. Requires project admin or site admin access.

Parameters (3)

Name Type Description
section string Section identifying the object type. Required.
refId int Id of the referenced object. Required.
settingName string Name (key) of the setting. Required.

Return: int

1 on success.