Settings API
The app's settings, as the dashboard's Settings shows them. All endpoints are for superusers.
Read the settings
GET /api/settings
{
"meta": { "appName": "Acme", "appURL": "https://acme.example.com", "senderName": "Support", "senderAddress": "[email protected]", "hideControls": false, "accentColor": "#1055c9" },
"smtp": { "enabled": true, "host": "smtp.example.com", "port": 587, "username": "acme", "authMethod": "", "tls": false, "localName": "" },
"s3": { "enabled": false, "bucket": "", "region": "", "endpoint": "", "accessKey": "", "forcePathStyle": false },
"backups": { "cron": "", "cronMaxKeep": 3, "s3": { "enabled": false, "bucket": "", "region": "", "endpoint": "", "accessKey": "", "forcePathStyle": false } },
"batch": { "enabled": false, "maxRequests": 50, "timeout": 3, "maxBodySize": 0 },
"rateLimits": { "enabled": false, "rules": [] },
"trustedProxy": { "headers": [], "useLeftmostIP": false },
"logs": { "maxDays": 5, "minLevel": 0, "logIP": true, "logAuthId": false, "maxDataSize": 0 },
"superuserIPs": []
}
Secrets (smtp.password, the s3 secrets) are never sent back; send them only to change them.
Change the settings
PATCH /api/settings
Send only the sections and keys you change; the answer is the full settings:
curl -X PATCH http://127.0.0.1:8090/api/settings -H "Authorization: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"meta": {"appName": "Acme"}, "batch": {"enabled": true}}'
Send a test email
POST /api/settings/test/email
| Body | |
|---|---|
email |
where to send it |
template |
verification, password-reset, email-change, otp or login-alert |
collection |
optional: the auth collection whose template to use (default _superusers) |
Answers 204 once the mail server took it.
Check S3
POST /api/settings/test/s3 with {"filesystem": "storage"} (or "backups") tries the saved S3 settings for files
or backups; 204 if they work, 400 with the reason if not.
Apple sign-in secret
POST /api/settings/apple/generate-client-secret makes the client secret Sign in with Apple needs, from clientId,
teamId, keyId, privateKey and duration (seconds), and answers {"secret": "..."}.
Next
- Logs API, Backups API: what some of these settings control.
- pocketone.yaml: PocketOne's own settings, kept in a file.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.