{
  "openapi": "3.0.1",
  "info": {
    "title": "Jenkins Controller Extractor",
    "description": "Point at any Jenkins or Hudson controller (anonymous-read) and get one structured row per job or build: status, results, timings, build history, job graph. Works on any controller via the standard /api/json Remote Access API.",
    "version": "0.1",
    "x-build-id": "xByzjZL94fgRn4o7V"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~jenkins-controller-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-jenkins-controller-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datamule~jenkins-controller-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-jenkins-controller-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datamule~jenkins-controller-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-jenkins-controller-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "baseUrl"
        ],
        "properties": {
          "baseUrl": {
            "title": "Jenkins controller URL",
            "type": "string",
            "description": "Root URL of a Jenkins or Hudson controller. Every Jenkins controller exposes the identical Remote Access API at /api/json, so one actor works against any of them: https://jenkins.debian.net, https://ci.adoptium.net, or any self-hosted / corporate / university controller that allows anonymous read. The /api/json path is appended for you (paste the controller root). The run MODE is chosen automatically from the other fields you set (see below)."
          },
          "mode": {
            "title": "Run mode",
            "enum": [
              "jobs",
              "builds",
              "discovery"
            ],
            "type": "string",
            "description": "What to extract. jobs (default): one row per job on the whole controller, with each job's last-build result. builds: the recent build history of ONE job (set the Job field) — one row per build. discovery: a single row describing the controller itself (Jenkins version, job count, security mode). Leave unset to auto-select: jobs, unless a Job is set (then builds). Pick a value here to force a specific mode (e.g. discovery)."
          },
          "job": {
            "title": "Job (MODE: builds)",
            "type": "string",
            "description": "BUILDS MODE. The job whose recent build history to fetch. Accepts a simple job name (my-job), a nested folder path (my-folder/my-job), or a full job URL (https://ci.adoptium.net/job/build-scripts/job/openjdk21-pipeline/). Setting this auto-selects builds mode. One row is emitted per build (result, timing, timestamp)."
          },
          "buildDepth": {
            "title": "Builds per job (MODE: builds)",
            "minimum": 1,
            "type": "integer",
            "description": "BUILDS MODE. How many of the most recent builds to fetch for the Job (newest first). Default 10. Capped at 500. Ignored in jobs / discovery mode.",
            "default": 10
          },
          "foldersRecurse": {
            "title": "Recurse into folders (MODE: jobs)",
            "type": "boolean",
            "description": "JOBS MODE. Jenkins organizes jobs into folders (Folder / Organization Folder plugins). When true (default), the actor recurses into folder jobs to surface the nested jobs too, up to the Max folder depth. When false, only the jobs at the controller root level are returned (folders appear as single rows).",
            "default": true
          },
          "maxFolderDepth": {
            "title": "Max folder depth (MODE: jobs)",
            "minimum": 0,
            "type": "integer",
            "description": "JOBS MODE. How many levels of nested folders to recurse into when Recurse into folders is on. Default 3, capped at 8. A controller with deep folder trees (e.g. multibranch pipelines) may nest several levels.",
            "default": 3
          },
          "maxRecords": {
            "title": "Max records (global cap)",
            "minimum": 1,
            "type": "integer",
            "description": "A GLOBAL cap across jobs and builds. The default and prefill cap the run at 25 rows. Each emitted row is one `record` PPE event at the current FREE unit price of $0.0005, so the maximum example event charge is $0.0125, excluding Apify infrastructure cost. Jobs-mode folder recursion and builds-mode history stop deterministically as soon as the global cap is reached; lower it for a smaller sample or explicitly raise it for broader extraction.",
            "default": 25
          },
          "bearer": {
            "title": "Bearer token",
            "type": "string",
            "description": "Optional access token for a private / registration-required / rate-limited controller (sent as Authorization: Bearer ***). Not required for public controllers that allow anonymous read. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"Jenkins-Crumb\": \"...\"} or a cookie for gated controllers. Not required for public controllers. Header values are never logged."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}