Skip to content

Settings API

Read and update per-repository maintainer settings.

Get Settings

bash
curl https://gitwire.yourdomain.com/api/maintainer/owner/repo/settings \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

json
{
  "repo_id": 12345,
  "stale_issue_days": 60,
  "stale_pr_days": 30,
  "stale_warn_days": 7,
  "cleanup_branches": true,
  "enabled": true
}

Update Settings

bash
curl -X PATCH https://gitwire.yourdomain.com/api/maintainer/owner/repo/settings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stale_issue_days": 90,
    "stale_pr_days": 45,
    "stale_warn_days": 14,
    "cleanup_branches": true,
    "enabled": true
  }'

Settings Fields

FieldTypeDefaultDescription
stale_issue_daysINT60Days before an issue is considered stale
stale_pr_daysINT30Days before a PR is considered stale
stale_warn_daysINT7Days after warning before closing
cleanup_branchesBOOLEANtrueEnable automatic branch cleanup
enabledBOOLEANtrueEnable all maintainer features for this repo

Default Settings

When a repo is first synced, default settings are created automatically. No manual setup needed — defaults work for most repositories.

Audit Trail

Settings changes are logged in the audit_log table:

json
{
  "actor": "admin",
  "action": "settings.update",
  "target_type": "repo",
  "target_id": "owner/repo"
}

Multi-Repo Insights

Released under the MIT License.