{
  "components": {
    "headers": {
      "Retry-After": {
        "description": "Whole seconds to wait before retrying. Never on quota_exceeded.",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "X-Request-Id": {
        "description": "The request's ID, in every log line and its Trails event.",
        "schema": {
          "type": "string"
        }
      }
    },
    "parameters": {
      "Cursor": {
        "description": "The previous page's nextCursor.",
        "in": "query",
        "name": "cursor",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "description": "Makes a retry safe: the same key and request get the stored response.",
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "schema": {
          "pattern": "^[\\x21-\\x7e]{1,200}$",
          "type": "string"
        }
      },
      "Limit": {
        "description": "The page size. Out of range is 400, never a clamp.",
        "in": "query",
        "name": "limit",
        "required": false,
        "schema": {
          "default": 20,
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        }
      }
    },
    "responses": {
      "AccessDenied": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "access_denied: the caller's policies don't allow the action; forbidden_origin: a cookie-authenticated write from an origin that isn't allowed; spend_limit_reached.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "Conflict": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "quota_exceeded (an allocation quota, with quota), idempotency_conflict, idempotency_in_progress (with Retry-After), organization_deletion_pending, operation_in_progress, or the endpoint's own 409 codes.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "InternalError": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error: a bug; the details are in the logs, under the request ID.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "InvalidRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_request (with issues), invalid_cursor, or the endpoint's own 400 codes.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found: unknown, malformed, or in an organization the caller isn't in.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "PayloadTooLarge": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "payload_too_large: the body is over the endpoint's limit (1 MiB unless it says otherwise).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "TooManyRequests": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "too_many_requests, with Retry-After; or quota_exceeded (a rate, usage or concurrency quota, with quota), never with Retry-After.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "Unauthenticated": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: no credential, or one that doesn't check out.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      },
      "Unavailable": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unavailable: a dependency the request needs is down. Retry after Retry-After.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "additionalProperties": false,
        "description": "Every non-2xx answer. Clients branch on code, never on message.",
        "properties": {
          "error": {
            "additionalProperties": true,
            "properties": {
              "code": {
                "maxLength": 64,
                "pattern": "^[a-z][a-z0-9_]*$",
                "type": "string"
              },
              "issues": {
                "description": "invalid_request: one entry per problem, at a dotted path.",
                "items": {
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "message"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "quota": {
                "$ref": "#/components/schemas/QuotaExceeded"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "QuotaExceeded": {
        "additionalProperties": false,
        "description": "quota_exceeded: the quota that refused the request. Never with Retry-After.",
        "properties": {
          "id": {
            "type": "string"
          },
          "inFlight": {
            "minimum": 0,
            "type": "integer"
          },
          "kind": {
            "enum": [
              "allocation",
              "rate",
              "usage",
              "concurrency"
            ]
          },
          "limit": {
            "minimum": 0,
            "type": "integer"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "resetsAt": {
            "format": "date-time",
            "type": "string"
          },
          "scope": {
            "enum": [
              "organization",
              "project",
              "resource"
            ]
          },
          "scopeResourceName": {
            "type": "string"
          },
          "used": {
            "minimum": 0,
            "type": "integer"
          },
          "window": {
            "description": "rate only: an ISO 8601 duration, PT1S to PT1H.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "scope",
          "limit"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "A customer API key: Bearer ezgh_…",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth": {
        "description": "An OAuth access token (Bearer ezgh_at_…) or an EZGH SSO resource token (Bearer ezgh_sat_…)",
        "scheme": "bearer",
        "type": "http"
      },
      "sessionCookie": {
        "description": "A signed-in person's session, set by login.ezghcloud.com.",
        "in": "cookie",
        "name": "__Secure-better-auth.session_token",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Connections, pipelines, tasks and task logs. Every path is under an organization and a project; lists are paged with limit, cursor and nextCursor.",
    "title": "Build API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/organizations/{orgId}/projects/{projectId}/connections": {
      "get": {
        "operationId": "ListConnections",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "List a project's connections",
        "x-ezgh-action": "build.connections.list",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      },
      "post": {
        "operationId": "CreateConnection",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "bot": {
                    "description": "An existing Bot (bot_…) that trusts build.ezghcloud.com for this repository.",
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "source": {
                    "additionalProperties": false,
                    "properties": {
                      "defaultBranch": {
                        "description": "GitHub only.",
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "ezghGit",
                          "github"
                        ],
                        "type": "string"
                      },
                      "repositoryId": {
                        "description": "An EZGH Git repository's ID (gtr_…), or a GitHub repository's numeric ID as a string.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "repositoryId"
                    ],
                    "type": "object"
                  },
                  "trustedRefs": {
                    "description": "Full ref globs (refs/heads/main, refs/tags/**) whose runs are trusted. Default: the default branch.",
                    "items": {
                      "maxLength": 256,
                      "type": "string"
                    },
                    "maxItems": 20,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "name",
                  "bot",
                  "source"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Connect a repository",
        "x-ezgh-action": "build.connections.create",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests",
          "build.connectionsPerProject"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/connections/{connection}": {
      "delete": {
        "operationId": "DeleteConnection",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Delete a connection",
        "x-ezgh-action": "build.connections.delete",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      },
      "get": {
        "operationId": "GetConnection",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Get a connection",
        "x-ezgh-action": "build.connections.get",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      },
      "patch": {
        "operationId": "UpdateConnection",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "bot": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "trustedRefs": {
                    "description": "Full ref globs (refs/heads/main, refs/tags/**) whose runs are trusted. Default: the default branch.",
                    "items": {
                      "maxLength": 256,
                      "type": "string"
                    },
                    "maxItems": 20,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Change a connection",
        "x-ezgh-action": "build.connections.update",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/connections/{connection}/pipelines": {
      "get": {
        "operationId": "ListPipelines",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only the pipelines at this commit: 40 lowercase hex characters.",
            "in": "query",
            "name": "sha",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-f]{40}$",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "List a connection's pipelines, newest first",
        "x-ezgh-action": "build.pipelines.list",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      },
      "post": {
        "description": "Starts a pipeline of the connected repository's tree at sha, planned from file instead of the commit's .ezgh/build.yaml. The pipeline's ref is refs/caller/\u003cbranch\u003e: a Bot acts for it only when its trust names refs/caller/\u003cbranch\u003e (refs/** does not reach it), its cache entries are never trusted, and the file's trigger is not matched.",
        "operationId": "StartPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "file": {
                    "description": "The text of a build file, at most 1 MiB.",
                    "type": "string"
                  },
                  "label": {
                    "description": "A printable note shown with the pipeline.",
                    "maxLength": 200,
                    "type": "string"
                  },
                  "ref": {
                    "description": "refs/heads/\u003cbranch\u003e: the branch the commit was pushed to.",
                    "type": "string"
                  },
                  "sha": {
                    "description": "The commit, in the connected repository.",
                    "pattern": "^[0-9a-f]{40}$",
                    "type": "string"
                  }
                },
                "required": [
                  "ref",
                  "sha",
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The pipeline, queued: source is \"caller\" (source is an open set of strings), ref is refs/caller/\u003cbranch\u003e, and label is the request's label (null on other pipelines)."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "description": "invalid_file: the file has problems, listed in problems."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Run a supplied build file at a pushed commit",
        "x-ezgh-action": "build.pipelines.run",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests",
          "build.pipelineStartsPerMinute"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/connections/{connection}/plan": {
      "post": {
        "operationId": "PlanPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "description": "A full ref, like refs/heads/main.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "tasks": {
                    "additionalProperties": {
                      "additionalProperties": false,
                      "properties": {
                        "definition": {
                          "pattern": "^([0-9a-f]{64})?$",
                          "type": "string"
                        },
                        "inputs": {
                          "pattern": "^([0-9a-f]{64})?$",
                          "type": "string"
                        },
                        "key": {
                          "pattern": "^([0-9a-f]{64})?$",
                          "type": "string"
                        },
                        "needs": {
                          "pattern": "^([0-9a-f]{64})?$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "definition",
                        "inputs",
                        "needs"
                      ],
                      "type": "object"
                    },
                    "description": "By task name: the key the caller computed and its three parts.",
                    "maxProperties": 100,
                    "type": "object"
                  }
                },
                "required": [
                  "ref",
                  "tasks"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Look up which tasks a pipeline would skip",
        "x-ezgh-action": "build.pipelines.get",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/connections/{connection}/runs": {
      "post": {
        "operationId": "RunPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "connection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "At most 16 MiB.",
                "properties": {
                  "blob": {
                    "additionalProperties": false,
                    "description": "The working tree's archive, already pushed to the connection's cache repository.",
                    "properties": {
                      "layerDigest": {
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "type": "string"
                      },
                      "manifestDigest": {
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "type": "string"
                      },
                      "sizeBytes": {
                        "maximum": 2147483648,
                        "minimum": 0,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "manifestDigest",
                      "layerDigest",
                      "sizeBytes"
                    ],
                    "type": "object"
                  },
                  "branch": {
                    "description": "The run's ref is refs/local/\u003cbranch\u003e.",
                    "maxLength": 200,
                    "type": "string"
                  },
                  "file": {
                    "description": "The text of .ezgh/build.yaml, at most 1 MiB.",
                    "type": "string"
                  },
                  "noCache": {
                    "default": false,
                    "type": "boolean"
                  },
                  "tree": {
                    "items": {
                      "properties": {
                        "mode": {
                          "description": "Six octal digits.",
                          "type": "string"
                        },
                        "path": {
                          "maxLength": 4096,
                          "minLength": 1,
                          "type": "string"
                        },
                        "sha": {
                          "description": "The git blob hash, lowercase hex.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "mode",
                        "sha"
                      ],
                      "type": "object"
                    },
                    "maxItems": 100000,
                    "type": "array"
                  }
                },
                "required": [
                  "branch",
                  "file",
                  "tree",
                  "blob"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Run a working tree as a pipeline",
        "x-ezgh-action": "build.pipelines.run",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests",
          "build.pipelineStartsPerMinute"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/github/installations": {
      "get": {
        "operationId": "ListGitHubInstallations",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "List the organization's GitHub installations",
        "x-ezgh-action": "build.connections.list",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/github/installations/{installation}/repositories": {
      "get": {
        "operationId": "ListGitHubRepositories",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "installation",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "List a GitHub installation's repositories",
        "x-ezgh-action": "build.connections.list",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/github/installs": {
      "post": {
        "operationId": "StartGitHubInstall",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Start a GitHub App installation",
        "x-ezgh-action": "build.connections.create",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/pipelines/{pipeline}": {
      "get": {
        "operationId": "GetPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pipeline",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Get a pipeline and its tasks",
        "x-ezgh-action": "build.pipelines.get",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/pipelines/{pipeline}/cancel": {
      "post": {
        "operationId": "CancelPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pipeline",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Cancel a pipeline",
        "x-ezgh-action": "build.pipelines.cancel",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/pipelines/{pipeline}/rerun": {
      "post": {
        "operationId": "RerunPipeline",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pipeline",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "noCache": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Run a pipeline again",
        "x-ezgh-action": "build.pipelines.run",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests",
          "build.pipelineStartsPerMinute"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/pipelines/{pipeline}/tasks/{task}": {
      "get": {
        "operationId": "GetTask",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pipeline",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Get a task",
        "x-ezgh-action": "build.tasks.get",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/pipelines/{pipeline}/tasks/{task}/log": {
      "get": {
        "description": "Without follow: the stored log bytes from the offset from (default 0), as application/octet-stream, with X-Ezgh-Log-Next: the offset to read from next. An offset past the end is an empty answer, never an error. With follow=true: server-sent events. Each data event's id is the offset after it and its data is base64 of at most 49,152 log bytes; a comment is sent every 15 seconds; an end event (data {\"status\": the task's status}) once the task is finished and its log is sent, at once for a finished task. A stream lasts at most 890 seconds and then closes without end: reconnect with from set to the last id. Last-Event-ID is never read. A log is kept up to 16 MiB, then a marker line. Recorded in Trails only when refused.",
        "operationId": "ReadTaskLog",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pipeline",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "task",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The byte offset to read from; default 0.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "true to stream the log as it grows.",
            "in": "query",
            "name": "follow",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The log's bytes from the offset, or with follow=true a stream of server-sent events: data, heartbeat comments, then end.",
            "headers": {
              "X-Ezgh-Log-Next": {
                "description": "Without follow: the offset to read from next.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Read or follow a task's log",
        "x-ezgh-action": "build.logs.read",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    },
    "/v1/organizations/{orgId}/projects/{projectId}/validate": {
      "post": {
        "operationId": "ValidateFile",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (org_…)",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "description": "UUID or prefixed ID (prj_…)",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "file": {
                    "description": "The text of .ezgh/build.yaml.",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessDenied"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth": []
          },
          {
            "sessionCookie": []
          }
        ],
        "summary": "Check a build file's format",
        "x-ezgh-action": "build.files.validate",
        "x-ezgh-quotas": [
          "build.api.requestsPerPeriod",
          "build.api.concurrentRequests"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://build.ezghcloud.com"
    }
  ]
}