-
This is already available. OneDev ships a
SettingResourceat/~api/settingswith GET/POST for individual admin setting objects. All operations require administrator permission, same as the corresponding Administration pages. JSON bodies follow the setting beans the UI already edits.Endpoints that match what you listed:
- System settings:
GET/POST/~api/settings/system - Authentication source:
GET/POST/~api/settings/authenticator - Mail:
GET/POST/~api/settings/mail-service - SSO providers: separate resource
/~api/sso-providers(list/get/create/update/delete)
Other admin settings on the same resource:
/settings/backup/settings/build/settings/groovy-scripts/settings/issue/settings/job-executors/settings/service-desk/settings/notification-template/settings/project/settings/pull-request/settings/workspace/settings/security/settings/ssh/settings/contributed-settings(plugin-contributed admin settings)
Branding is the notable exception among the items you mentioned: it is stored as an admin setting but is not currently exposed on
SettingResource. A few other settings (alert, performance, AI, GPG, agent, pack, cluster, audit, workspace provisioners) are also UI-only today.Interactive schema and example payloads are generated on each instance at
https://<your-onedev-server>/~help/api(seeio.onedev.server.rest.resource.SettingResource). Authenticate with an administrator access token, same as other/~apicalls. Official docs: https://docs.onedev.io/restful-apiA PR is not needed for the core
SettingResource— it is already there. If branding (or another missing setting) is required for your provisioning flow, say so and we can treat that as a feature request. - System settings:
-
Thank you — confirmed, and apologies for the noise: verified on our instance that
/~api/settings/system,/~api/settings/securityand the/~api/sso-providersresource all work exactly as you describe. Our earlier probing used wrong path guesses (/settings/system-settingstyle), and we drew the wrong conclusion from the 404s.One follow-up on the exception you noted: would a PR exposing
BrandingSettingonSettingResource(and potentially some of the other currently UI-only settings such as alert/performance, at your discretion on scope) be welcome? We provision instances declaratively and branding is now the one piece we cannot set over the API. Happy for this issue to be closed either way. -
Thanks for confirming.
A branding REST API is a reasonable follow-up for declarative provisioning. One design constraint:
BrandingSettingcurrently stores only the instance name. Light/dark logos are PNG files in the site assets directory and are replicated to every cluster node (the same path Administration → Branding uses). A GET/POST of that bean alone would not cover logos.Please keep any first change scoped to branding rather than also adding the other UI-only settings (alert, performance, and the rest).
@robin does OneDev want an external PR for this, and should the payload include the logos (base64 data URLs, matching the admin page) as well as the name?
-
Confirmed working as described — closing. Thanks for the fast and precise answer.
-
Previous Value Current Value Open
Closed
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
Currently every entity that automation needs is available over
/~api— projects, users, access tokens, issues, iterations, pull requests, roles — with one exception: admin settings (Administration → System Settings, Authentication sources / SSO, Branding, Mail, …), which can only be changed through the web UI.We run OneDev as the primary forge for a fleet of AI coding agents and provision instances with configuration management. We would like to manage settings the same way we manage everything else: over the REST API. Today we work around the gap by driving the admin UI with a headless browser, which is fragile across releases.
Proposal
SettingResourcefollowing the existing resource conventions: GET/POST endpoints for individual admin setting objects (for example/settings/system,/settings/sso-providers,/settings/branding), gated on admin permission exactly like the corresponding UI pages.Offer
We are happy to contribute the implementation as a PR if the feature is welcome — and would gladly take direction first on preferred scope (all settings generically vs an explicit whitelist to start) and on the serialization shape you would want.