feat: implement organization management (create, update, hooks, labels) #9

Open
opened 2026-06-02 06:56:58 +00:00 by a-limasov · 0 comments
Owner

Context

Currently only read operations are implemented for organizations. Full org management
requires creating and updating orgs, managing org-level webhooks for event routing,
and org-level labels that apply across all repositories in the org.

Endpoints to implement

Method Path Tool name Description
POST /orgs create_org Create an organization
PATCH /orgs/{org} update_org Update org settings
DELETE /orgs/{org} delete_org Delete an organization
GET /orgs/{org}/hooks list_org_webhooks List org-level webhooks
POST /orgs/{org}/hooks create_org_webhook Create org webhook
GET /orgs/{org}/hooks/{id} get_org_webhook Get org webhook
PATCH /orgs/{org}/hooks/{id} edit_org_webhook Edit org webhook
DELETE /orgs/{org}/hooks/{id} delete_org_webhook Delete org webhook
GET /orgs/{org}/labels list_org_labels List org-level labels
POST /orgs/{org}/labels create_org_label Create org label
GET /orgs/{org}/labels/{id} get_org_label Get org label
PATCH /orgs/{org}/labels/{id} edit_org_label Edit org label
DELETE /orgs/{org}/labels/{id} delete_org_label Delete org label
POST /orgs/{org}/teams create_team Create team in org

Acceptance Criteria

  • create_org(username, visibility, ...)visibility: public | limited | private
  • update_org accepts: description, website, location, visibility
  • delete_org returns {"success": true} on 204; docstring warns this is irreversible
  • Org webhooks mirror the repo webhook interface (type, config, events, active)
  • Org labels mirror the repo label interface (name, color, description)
  • create_team accepts: name, description, permission, units

Technical Notes

  • POST /orgs body: {"username": "myorg", "visibility": "public", "description": "...", "website": "..."}
  • Org webhook body is identical to repo webhook: {"type": "gitea", "config": {...}, "events": [...], "active": true}
  • delete_org requires admin permission or org ownership
  • Team permission: none | read | write | admin | owner
## Context Currently only read operations are implemented for organizations. Full org management requires creating and updating orgs, managing org-level webhooks for event routing, and org-level labels that apply across all repositories in the org. ## Endpoints to implement | Method | Path | Tool name | Description | |--------|------|-----------|-------------| | POST | `/orgs` | `create_org` | Create an organization | | PATCH | `/orgs/{org}` | `update_org` | Update org settings | | DELETE | `/orgs/{org}` | `delete_org` | Delete an organization | | GET | `/orgs/{org}/hooks` | `list_org_webhooks` | List org-level webhooks | | POST | `/orgs/{org}/hooks` | `create_org_webhook` | Create org webhook | | GET | `/orgs/{org}/hooks/{id}` | `get_org_webhook` | Get org webhook | | PATCH | `/orgs/{org}/hooks/{id}` | `edit_org_webhook` | Edit org webhook | | DELETE | `/orgs/{org}/hooks/{id}` | `delete_org_webhook` | Delete org webhook | | GET | `/orgs/{org}/labels` | `list_org_labels` | List org-level labels | | POST | `/orgs/{org}/labels` | `create_org_label` | Create org label | | GET | `/orgs/{org}/labels/{id}` | `get_org_label` | Get org label | | PATCH | `/orgs/{org}/labels/{id}` | `edit_org_label` | Edit org label | | DELETE | `/orgs/{org}/labels/{id}` | `delete_org_label` | Delete org label | | POST | `/orgs/{org}/teams` | `create_team` | Create team in org | ## Acceptance Criteria - [ ] `create_org(username, visibility, ...)` — `visibility`: `public` | `limited` | `private` - [ ] `update_org` accepts: `description`, `website`, `location`, `visibility` - [ ] `delete_org` returns `{"success": true}` on 204; docstring warns this is irreversible - [ ] Org webhooks mirror the repo webhook interface (`type`, `config`, `events`, `active`) - [ ] Org labels mirror the repo label interface (`name`, `color`, `description`) - [ ] `create_team` accepts: `name`, `description`, `permission`, `units` ## Technical Notes - `POST /orgs` body: `{"username": "myorg", "visibility": "public", "description": "...", "website": "..."}` - Org webhook body is identical to repo webhook: `{"type": "gitea", "config": {...}, "events": [...], "active": true}` - `delete_org` requires admin permission or org ownership - Team `permission`: `none` | `read` | `write` | `admin` | `owner`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: a-limasov/gitea-platform-mcp#9