{"openapi":"3.0.3","info":{"title":"KukGit Public REST API","version":"0.2.0","description":"The Git collaboration platform and developer operating system API for repositories, pull requests, issues, projects, discussions, workflows, and search.","contact":{"name":"KukGit Engineering","email":"support@kukgit.local"},"license":{"name":"MIT"}},"servers":[{"url":"http://localhost:3000","description":"Current KukGit instance"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"kgp_* Personal Access Token","description":"Authenticate using a Personal Access Token created under Account Settings -> Tokens."},"cookieAuth":{"type":"apiKey","in":"cookie","name":"kukgit_session","description":"Session cookie from web browser authentication."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"code":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"Organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string","enum":["free","pro","enterprise"]},"role":{"type":"string"}}},"Repository":{"type":"object","properties":{"id":{"type":"string"},"orgSlug":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"visibility":{"type":"string","enum":["public","private"]},"defaultBranch":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"stars":{"type":"integer"}}},"Issue":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer"},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PullRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer"},"title":{"type":"string"},"body":{"type":"string"},"baseBranch":{"type":"string"},"headBranch":{"type":"string"},"status":{"type":"string","enum":["open","closed","merged"]},"draft":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","closed"]},"itemCount":{"type":"integer"}}}}},"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"paths":{"/api/openapi.json":{"get":{"summary":"Get OpenAPI Specification","description":"Returns the OpenAPI 3.0 specification document for the KukGit instance.","responses":{"200":{"description":"OpenAPI JSON document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/user":{"get":{"summary":"Get Authenticated User Profile","responses":{"200":{"description":"Current user profile and organizations","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orgs":{"get":{"summary":"List User Organizations","responses":{"200":{"description":"List of organizations the authenticated user belongs to","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}}}}}}},"/api/v1/orgs/{org}/repos":{"get":{"summary":"List Organization Repositories","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of accessible repositories in the organization","content":{"application/json":{"schema":{"type":"object","properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Repository"}}}}}}}}},"post":{"summary":"Create Repository in Organization","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"visibility":{"type":"string","enum":["public","private"],"default":"public"},"defaultBranch":{"type":"string","default":"main"}}}}}},"responses":{"201":{"description":"Repository created"}}}},"/api/v1/repos/{org}/{repo}":{"get":{"summary":"Get Repository Details","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Repository details"},"404":{"description":"Repository not found"}}}},"/api/v1/repos/{org}/{repo}/issues":{"get":{"summary":"List Issues","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","closed"]}}],"responses":{"200":{"description":"List of issues"}}},"post":{"summary":"Create Issue","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"body":{"type":"string"}}}}}},"responses":{"201":{"description":"Issue created"}}}},"/api/v1/repos/{org}/{repo}/pulls":{"get":{"summary":"List Pull Requests","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","closed","merged"]}}],"responses":{"200":{"description":"List of pull requests"}}},"post":{"summary":"Create Pull Request","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","headBranch","baseBranch"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"headBranch":{"type":"string"},"baseBranch":{"type":"string"},"draft":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Pull request created"}}}},"/api/search":{"get":{"summary":"Global Search","description":"Search across code, repositories, issues, pull requests, and users.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string","enum":["all","code","issues","repos","users"],"default":"all"}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Search results"}}}},"/api/v1/repos/{org}/{repo}/contents":{"get":{"summary":"Read a file at a ref","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":true,"schema":{"type":"string"}},{"name":"ref","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/tree":{"get":{"summary":"List a directory tree","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","schema":{"type":"string"}},{"name":"ref","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/branches":{"get":{"summary":"List branches","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/commits":{"get":{"summary":"List commits","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"ref","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/tags":{"get":{"summary":"List tags","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/releases":{"get":{"summary":"List releases","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/dependency-graph":{"get":{"summary":"Dependency graph","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"ref","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repos/{org}/{repo}/issues/{number}":{"patch":{"summary":"Update (close/reopen/rename) an issue","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["open","closed"]},"title":{"type":"string"}}}}}}}},"/api/v1/repos/{org}/{repo}/issues/{number}/comments":{"post":{"summary":"Add an issue comment","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string"}}}}}}}},"/api/v1/repos/{org}/{repo}/pulls/{number}/merge":{"post":{"summary":"Merge a pull request","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["merge","squash","rebase"]}}}}}}}}}}