{
  "components": {
    "schemas": {
      "AddCommentBody": {
        "properties": {
          "body": {
            "description": "Plain-text / markdown body (adapter-compatible alias for body_html).",
            "nullable": true,
            "type": "string"
          },
          "body_html": {
            "nullable": true,
            "type": "string"
          },
          "body_json": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "AddPrCommentBody": {
        "properties": {
          "body": {
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "AddSshKeyBody": {
        "properties": {
          "public_key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "public_key"
        ],
        "type": "object"
      },
      "ApiError": {
        "description": "Standard API error response.\n`{ \"error\": \"not_found\", \"code\": 404, \"message\": \"Repository not found\" }`",
        "properties": {
          "code": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "details": {},
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "code",
          "message"
        ],
        "type": "object"
      },
      "CompleteRequest": {
        "properties": {
          "job_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "job_id",
          "success"
        ],
        "type": "object"
      },
      "CreateAgentBody": {
        "properties": {
          "adapter_type": {
            "type": "string"
          },
          "budget_monthly_cents": {
            "format": "int64",
            "type": "integer"
          },
          "heartbeat_interval_secs": {
            "format": "int64",
            "type": "integer"
          },
          "instructions_path": {
            "nullable": true,
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug",
          "role",
          "adapter_type",
          "model"
        ],
        "type": "object"
      },
      "CreateBranchBody": {
        "properties": {
          "from_ref": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "from_ref"
        ],
        "type": "object"
      },
      "CreateIssueBody": {
        "properties": {
          "body": {
            "nullable": true,
            "type": "string"
          },
          "body_html": {
            "nullable": true,
            "type": "string"
          },
          "body_json": {
            "nullable": true,
            "type": "string"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CreateLabelBody": {
        "properties": {
          "color": {
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "color"
        ],
        "type": "object"
      },
      "CreatePageBody": {
        "properties": {
          "body_json": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "emoji_icon": {
            "nullable": true,
            "type": "string"
          },
          "parent_id": {
            "nullable": true,
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "slug"
        ],
        "type": "object"
      },
      "CreateReleaseBody": {
        "properties": {
          "body": {
            "nullable": true,
            "type": "string"
          },
          "draft": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "prerelease": {
            "type": "boolean"
          },
          "tag_name": {
            "type": "string"
          }
        },
        "required": [
          "tag_name",
          "name"
        ],
        "type": "object"
      },
      "CreateRepoBody": {
        "properties": {
          "description": {
            "nullable": true,
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "visibility": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateRuleBody": {
        "properties": {
          "branch_pattern": {
            "type": "string"
          },
          "disallow_force_push": {
            "type": "boolean"
          },
          "require_ci_pass": {
            "type": "boolean"
          },
          "require_linear_history": {
            "type": "boolean"
          },
          "require_review_count": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "required_status_checks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "branch_pattern"
        ],
        "type": "object"
      },
      "CreateTokenBody": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateWebhookBody": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "nullable": true,
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "type": "object"
      },
      "LogsRequest": {
        "properties": {
          "job_id": {
            "type": "string"
          },
          "lines": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "job_id",
          "lines"
        ],
        "type": "object"
      },
      "MergePrBody": {
        "properties": {
          "commit_body": {
            "nullable": true,
            "type": "string"
          },
          "commit_title": {
            "nullable": true,
            "type": "string"
          },
          "strategy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "NewPullRequest": {
        "properties": {
          "body": {
            "type": "string"
          },
          "source_branch": {
            "type": "string"
          },
          "target_branch": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "body",
          "source_branch",
          "target_branch"
        ],
        "type": "object"
      },
      "NewReview": {
        "properties": {
          "body": {
            "nullable": true,
            "type": "string"
          },
          "commit_sha": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "commit_sha"
        ],
        "type": "object"
      },
      "StartRequest": {
        "properties": {
          "job_id": {
            "type": "string"
          }
        },
        "required": [
          "job_id"
        ],
        "type": "object"
      },
      "StepUpdateRequest": {
        "properties": {
          "exit_code": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "step_id": {
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "step_id",
          "status"
        ],
        "type": "object"
      },
      "UpdateLabelsBody": {
        "properties": {
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "labels"
        ],
        "type": "object"
      },
      "UpdatePageBody": {
        "properties": {
          "body_json": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "emoji_icon": {
            "nullable": true,
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdatePrBody": {
        "properties": {
          "body": {
            "nullable": true,
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpsertSubscriptionBody": {
        "properties": {
          "level": {
            "description": "One of: `watching`, `participating`, `ignore`.",
            "type": "string"
          }
        },
        "required": [
          "level"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer_token": {
        "bearerFormat": "PAT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Nucel Platform REST API v1. Authenticate via `Authorization: Bearer <personal-access-token>`.",
    "license": {
      "name": ""
    },
    "title": "Nucel API",
    "version": "1.0.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/v1/ci/runner/complete": {
      "post": {
        "operationId": "runner_complete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Job marked complete"
          },
          "401": {
            "description": "Invalid runner token"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/ci/runner/complete",
        "tags": [
          "Internal"
        ]
      }
    },
    "/api/v1/ci/runner/logs": {
      "post": {
        "operationId": "runner_logs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Log lines accepted"
          },
          "401": {
            "description": "Invalid runner token"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/ci/runner/logs",
        "tags": [
          "Internal"
        ]
      }
    },
    "/api/v1/ci/runner/start": {
      "post": {
        "operationId": "runner_start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Job marked running"
          },
          "401": {
            "description": "Invalid runner token"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/ci/runner/start",
        "tags": [
          "Internal"
        ]
      }
    },
    "/api/v1/ci/runner/step": {
      "post": {
        "operationId": "runner_step",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Step status updated"
          },
          "401": {
            "description": "Invalid runner token"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/ci/runner/step",
        "tags": [
          "Internal"
        ]
      }
    },
    "/api/v1/notifications": {
      "get": {
        "operationId": "list_notifications",
        "parameters": [
          {
            "description": "Return only unread notifications",
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by notification kind",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items (default 50)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Offset for pagination",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Notifications for the authenticated user"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/notifications",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/api/v1/notifications/read-all": {
      "post": {
        "operationId": "mark_all_read",
        "responses": {
          "204": {
            "description": "All notifications marked as read"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/notifications/read-all",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/api/v1/notifications/{id}/read": {
      "post": {
        "operationId": "mark_read",
        "parameters": [
          {
            "description": "Notification id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Marked as read"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Notification not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/notifications/{id}/read",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/api/v1/orgs": {
      "get": {
        "operationId": "list_user_orgs",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Organizations the user is a member of"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs",
        "tags": [
          "Users"
        ]
      }
    },
    "/api/v1/orgs/{org}/agents": {
      "get": {
        "operationId": "list_agents",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Platform agents for the org"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not an org member"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Org not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/{org}/agents",
        "tags": [
          "Agents"
        ]
      },
      "post": {
        "operationId": "create_agent",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Agent created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not an org member"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Org not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/orgs/{org}/agents",
        "tags": [
          "Agents"
        ]
      }
    },
    "/api/v1/orgs/{org}/agents/stats": {
      "get": {
        "operationId": "dashboard_stats",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Dashboard stats"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not an org member"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Org not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/{org}/agents/stats",
        "tags": [
          "Agents"
        ]
      }
    },
    "/api/v1/orgs/{org}/agents/{slug}": {
      "get": {
        "operationId": "get_agent",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Agent slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Agent details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not an org member"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Agent or org not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/{org}/agents/{slug}",
        "tags": [
          "Agents"
        ]
      }
    },
    "/api/v1/orgs/{org}/agents/{slug}/sessions": {
      "get": {
        "operationId": "list_sessions",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Agent slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max sessions (default 50)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Recent agent sessions"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not an org member"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Agent or org not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/{org}/agents/{slug}/sessions",
        "tags": [
          "Agents"
        ]
      }
    },
    "/api/v1/orgs/{owner}/repos": {
      "get": {
        "operationId": "list_repos",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of repositories"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/:owner/repos",
        "tags": [
          "Repositories"
        ]
      },
      "post": {
        "operationId": "create_repo_handler",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRepoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Repository created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/orgs/:owner/repos",
        "tags": [
          "Repositories"
        ]
      }
    },
    "/api/v1/orgs/{slug}": {
      "get": {
        "operationId": "get_org",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Organization details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/:slug",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/v1/orgs/{slug}/members": {
      "get": {
        "operationId": "list_members",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Organization members"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/orgs/:slug/members",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}": {
      "get": {
        "operationId": "get_repo",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Repository details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo",
        "tags": [
          "Repositories"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/blob/{path}": {
      "get": {
        "operationId": "get_blob",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Path to file (URL-encoded)",
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Git ref (default: HEAD)",
            "in": "query",
            "name": "ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "File contents"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "File not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/blob/:path?ref=main",
        "tags": [
          "Files"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/branch-protection": {
      "get": {
        "operationId": "list_rules",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of branch protection rules"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/{owner}/{repo}/branch-protection",
        "tags": [
          "Branch Protection"
        ]
      },
      "post": {
        "operationId": "create_rule",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRuleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Rule created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not repo owner"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/{owner}/{repo}/branch-protection",
        "tags": [
          "Branch Protection"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/branch-protection/{id}": {
      "delete": {
        "operationId": "delete_rule",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Protection rule id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Rule deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not repo owner"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/repos/{owner}/{repo}/branch-protection/{id}",
        "tags": [
          "Branch Protection"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/branches": {
      "get": {
        "operationId": "list_branches",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of branches"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/branches",
        "tags": [
          "Repositories"
        ]
      },
      "post": {
        "operationId": "create_branch",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBranchBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Branch created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/branches",
        "tags": [
          "Repositories"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/commits/{sha}/status": {
      "get": {
        "operationId": "get_commit_status",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Commit SHA",
            "in": "path",
            "name": "sha",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Combined commit status"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/commits/:sha/status",
        "tags": [
          "Repositories"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/compare/{spec}": {
      "get": {
        "operationId": "compare_branches",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Compare spec in the form 'base...head'",
            "in": "path",
            "name": "spec",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Branch diff"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Invalid spec format"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/compare/:spec  (spec = \"base...head\")",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues": {
      "get": {
        "operationId": "list_issues",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Items per page (max 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Filter by state: open, closed",
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of issues"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/issues",
        "tags": [
          "Issues"
        ]
      },
      "post": {
        "operationId": "create_issue",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIssueBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Issue created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/issues",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues/{number}": {
      "get": {
        "operationId": "get_issue",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Issue number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Issue details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/issues/:number",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues/{number}/close": {
      "post": {
        "operationId": "close_issue",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Issue number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Issue closed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/issues/:number/close",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues/{number}/comments": {
      "post": {
        "operationId": "add_comment",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Issue number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCommentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Comment added"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/issues/:number/comments",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues/{number}/labels": {
      "put": {
        "operationId": "update_labels",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Issue number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabelsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Labels updated"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "PUT /api/v1/repos/:owner/:repo/issues/:number/labels",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/issues/{number}/labels/{label}": {
      "delete": {
        "operationId": "remove_label",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Issue number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Label name",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Label removed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/repos/:owner/:repo/issues/:number/labels/:label",
        "tags": [
          "Issues"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/labels": {
      "get": {
        "operationId": "list_labels",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of labels"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/labels",
        "tags": [
          "Labels"
        ]
      },
      "post": {
        "operationId": "create_label",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabelBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Label created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/labels",
        "tags": [
          "Labels"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pipelines": {
      "get": {
        "operationId": "list_pipelines",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Filter by git ref / branch",
            "in": "query",
            "name": "ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of pipelines"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pipelines",
        "tags": [
          "Pipelines"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pipelines/{number}": {
      "get": {
        "operationId": "get_pipeline",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pipeline number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pipeline details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pipelines/:number",
        "tags": [
          "Pipelines"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pipelines/{number}/cancel": {
      "post": {
        "operationId": "cancel_pipeline",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pipeline cancelled"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/pipelines/:number/cancel",
        "tags": [
          "Pipelines"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pipelines/{number}/logs": {
      "get": {
        "operationId": "get_pipeline_logs",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pipeline logs (per-job)"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pipelines/:number/logs",
        "tags": [
          "Pipelines"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls": {
      "get": {
        "operationId": "list_pulls",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of pull requests"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pulls",
        "tags": [
          "Pull Requests"
        ]
      },
      "post": {
        "operationId": "create_pull",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPullRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pull request created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Validation error"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/pulls",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}": {
      "get": {
        "operationId": "get_pull",
        "parameters": [
          {
            "description": "Organization slug",
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repository slug",
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pull request number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pull request details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pulls/:number",
        "tags": [
          "Pull Requests"
        ]
      },
      "put": {
        "operationId": "update_pull",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pull request number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pull request updated"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "PUT /api/v1/repos/:owner/:repo/pulls/:number",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}/comments": {
      "post": {
        "operationId": "add_pr_comment",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPrCommentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Comment added"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/pulls/:number/comments",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}/diff": {
      "get": {
        "operationId": "get_pull_diff",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Full PR diff"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pulls/:number/diff",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}/files": {
      "get": {
        "operationId": "list_pull_files",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Files changed in PR"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/pulls/:number/files",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}/merge": {
      "post": {
        "operationId": "merge_pull",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pull request number",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergePrBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Pull request merged"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Merge conflict"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/pulls/:number/merge",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/pulls/{number}/reviews": {
      "post": {
        "operationId": "submit_review",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewReview"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Review submitted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Validation error"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/pulls/:number/reviews",
        "tags": [
          "Pull Requests"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/raw/{path}": {
      "get": {
        "operationId": "get_raw",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Path to file",
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Git ref",
            "in": "query",
            "name": "ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Raw file bytes"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "File not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/raw/:path?ref=main",
        "tags": [
          "Files"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/releases": {
      "get": {
        "operationId": "list_releases",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of releases"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/releases",
        "tags": [
          "Releases"
        ]
      },
      "post": {
        "operationId": "create_release",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReleaseBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Release created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/releases",
        "tags": [
          "Releases"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/releases/{tag}": {
      "delete": {
        "operationId": "delete_release",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tag",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Release deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/repos/:owner/:repo/releases/:tag",
        "tags": [
          "Releases"
        ]
      },
      "get": {
        "operationId": "get_release",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Release tag name",
            "in": "path",
            "name": "tag",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Release details"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/releases/:tag",
        "tags": [
          "Releases"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/subscription": {
      "get": {
        "operationId": "get_subscription",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Current subscription (null if not subscribed)"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/{owner}/{repo}/subscription",
        "tags": [
          "Notifications"
        ]
      },
      "put": {
        "operationId": "upsert_subscription",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSubscriptionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Subscription set"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Invalid level"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "PUT /api/v1/repos/{owner}/{repo}/subscription",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/tree": {
      "get": {
        "operationId": "get_tree",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Git ref (default: HEAD)",
            "in": "query",
            "name": "ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Subdirectory path",
            "in": "query",
            "name": "path",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Directory listing"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "tags": [
          "Files"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/webhooks": {
      "get": {
        "operationId": "list_webhooks",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of webhooks"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/:owner/:repo/webhooks",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "operationId": "create_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Webhook created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/:owner/:repo/webhooks",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/webhooks/{id}": {
      "delete": {
        "operationId": "delete_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Webhook deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Webhook not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/repos/:owner/:repo/webhooks/:id",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/wiki/pages": {
      "get": {
        "operationId": "list_pages",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "List of wiki pages"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/{owner}/{repo}/wiki/pages",
        "tags": [
          "Wiki"
        ]
      },
      "post": {
        "operationId": "create_page",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePageBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Page created"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/repos/{owner}/{repo}/wiki/pages",
        "tags": [
          "Wiki"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/wiki/pages/{id}": {
      "delete": {
        "operationId": "delete_page",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Page deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/repos/{owner}/{repo}/wiki/pages/{id}",
        "tags": [
          "Wiki"
        ]
      },
      "patch": {
        "operationId": "update_page",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePageBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Page updated"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Page or repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "PATCH /api/v1/repos/{owner}/{repo}/wiki/pages/{id}",
        "tags": [
          "Wiki"
        ]
      }
    },
    "/api/v1/repos/{owner}/{repo}/wiki/pages/{slug}": {
      "get": {
        "operationId": "get_page",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "repo",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page slug",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Wiki page"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Page or repository not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/repos/{owner}/{repo}/wiki/pages/{slug}",
        "tags": [
          "Wiki"
        ]
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "search",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per category (default 20)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Matched repos, users, pull requests"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Empty query"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/search?q=...",
        "tags": [
          "Search"
        ]
      }
    },
    "/api/v1/user": {
      "get": {
        "operationId": "get_current_user",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Current authenticated user"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/user",
        "tags": [
          "Users"
        ]
      }
    },
    "/api/v1/user/ssh-keys": {
      "get": {
        "operationId": "list_ssh_keys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "SSH keys for the authenticated user"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/user/ssh-keys",
        "tags": [
          "SSH Keys"
        ]
      },
      "post": {
        "operationId": "add_ssh_key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSshKeyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "SSH key added"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Invalid key format"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Key already registered"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/user/ssh-keys",
        "tags": [
          "SSH Keys"
        ]
      }
    },
    "/api/v1/user/ssh-keys/{id}": {
      "delete": {
        "operationId": "delete_ssh_key",
        "parameters": [
          {
            "description": "SSH key id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/user/ssh-keys/{id}",
        "tags": [
          "SSH Keys"
        ]
      }
    },
    "/api/v1/user/tokens": {
      "get": {
        "operationId": "list_tokens",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Tokens belonging to the authenticated user"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "GET /api/v1/user/tokens",
        "tags": [
          "Personal Access Tokens"
        ]
      },
      "post": {
        "operationId": "create_token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTokenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Token created. The plaintext token is returned once and cannot be retrieved later."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Invalid body"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "POST /api/v1/user/tokens",
        "tags": [
          "Personal Access Tokens"
        ]
      }
    },
    "/api/v1/user/tokens/{id}": {
      "delete": {
        "operationId": "delete_token",
        "parameters": [
          {
            "description": "Token id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "Not found"
          }
        },
        "security": [
          {
            "bearer_token": []
          }
        ],
        "summary": "DELETE /api/v1/user/tokens/{id}",
        "tags": [
          "Personal Access Tokens"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Repository operations",
      "name": "Repositories"
    },
    {
      "description": "Issue tracking",
      "name": "Issues"
    },
    {
      "description": "PR management",
      "name": "Pull Requests"
    },
    {
      "description": "CI/CD pipelines",
      "name": "Pipelines"
    },
    {
      "description": "Release management",
      "name": "Releases"
    },
    {
      "description": "Issue and PR labels",
      "name": "Labels"
    },
    {
      "description": "File browsing (tree, blob, raw)",
      "name": "Files"
    },
    {
      "description": "Org and member management",
      "name": "Organizations"
    },
    {
      "description": "Authenticated user info",
      "name": "Users"
    },
    {
      "description": "Webhook management",
      "name": "Webhooks"
    },
    {
      "description": "Internal CI runner endpoints (not for public use)",
      "name": "Internal"
    },
    {
      "description": "Per-user notifications and repo subscriptions",
      "name": "Notifications"
    },
    {
      "description": "Manage the authenticated user's SSH keys",
      "name": "SSH Keys"
    },
    {
      "description": "Manage the authenticated user's PATs",
      "name": "Personal Access Tokens"
    },
    {
      "description": "Branch protection rules per repository",
      "name": "Branch Protection"
    },
    {
      "description": "Cross-resource search (repos, users, PRs)",
      "name": "Search"
    },
    {
      "description": "Platform AI agents and session history",
      "name": "Agents"
    },
    {
      "description": "Per-repository wiki pages",
      "name": "Wiki"
    }
  ]
}