{
  "openapi": "3.0.4",
  "info": {
    "title": "Sequentum Cloud API",
    "description": "API endpoints for Sequentum Cloud",
    "version": "v1"
  },
  "paths": {
    "/api/v1/agent/all": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get all agents",
        "description": "Returns a list of agents accessible to the authenticated user within their organization.\n\nSupports optional pagination, filtering, and sorting. When pagination parameters are\nprovided, returns a paginated response with `totalRecordCount`. When no pagination\nparameters are provided, returns a simple array for backward compatibility.\n\n**Filtering**\n\n- `name` — filter by agent name (case-insensitive contains match)\n- `status` — filter by last run status (`RunStatus` enum):\n  - not provided: no filter\n  - `1` Running\n  - `4` Queuing\n  - `6` Failure\n  - `7` Failed\n  - `8` Stopped\n  - `9` Completed\n  - `10` Success\n\n  `6` Failure and `7` Failed are one filter, and so are `9` Completed and `10` Success:\n  either value returns Agents whose last Run has either one. Agents that have never run\n  report `status = null` and match no status filter.\n- `spaceId` — filter by Space:\n  - not provided: no Space filter — every agent you can access, whether or not it is in a Space\n  - `0`: your Personal space only — the agents you own that are not in any Space\n  - a positive Space ID: that Space only\n\n  Personal-space agents report `spaceId` as `null` in responses, because Personal\n  space is not a Space. The `0` above is an input value only. Negative values are\n  rejected with `400`.\n- `configType` — filter by config type\n\n**Sorting**\n\n- `sortColumn` — `name` | `lastActivity` | `created` | `updated` | `status` | `configType` (default: `name`)\n- `sortOrder` — `0` ascending (default) | `1` descending\n\n**Response format**\n\n- Without pagination params: array of agents (backward compatible)\n- With pagination params: `{ agents: [...], totalRecordCount: N }`",
        "parameters": [
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based). If provided with recordsPerPage, enables pagination.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "recordsPerPage",
            "in": "query",
            "description": "Number of records per page. If provided with pageIndex, enables pagination.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: name, lastActivity, created, updated, status, configType",
            "schema": {
              "type": "string",
              "default": "name"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending (default), 1 = descending",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filter by agent name (contains match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by last run status (RunStatus: 0=Invalid, 1=Running, 2=Exporting, 3=Starting, 4=Queuing, 5=Stopping, 6=Failure, 7=Failed, 8=Stopped, 9=Completed, 10=Success, 11=Skipped, 12=Waiting, 13=UpdatingDataSet). Agents that never ran have null status.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "spaceId",
            "in": "query",
            "description": "Filter by Space: omit for no Space filter, `0` for your Personal space only, or a positive Space ID. Negative values are rejected with `400`.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "configType",
            "in": "query",
            "description": "Filter by config type",
            "schema": {
              "$ref": "#/components/schemas/ConfigType"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of agents (array without pagination, object with pagination)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/search": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Search for agents by name or description",
        "description": "Searches for agents by matching the query term against agent names and descriptions (case-insensitive).\n\nReturns agents accessible to the authenticated user within their organization. Results are\nlimited to prevent performance issues — use `maxRecords` to control the limit.\n\nThe response carries no indication of whether the limit was reached, so do not count it to\nfind out how many Agents match. Use `GET /api/v1/agent/search/count` for that.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "The search term to match against agent names and descriptions",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxRecords",
            "in": "query",
            "description": "Maximum number of results to return. Defaults to 50, max 1000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of matching agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If the query is empty or invalid, or maxRecords is out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/search/count": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get the number of Agents matching a search",
        "description": "Returns how many Agents match a search term, as a single total.\n\nUse this instead of counting the response of `GET /api/v1/agent/search`. That endpoint\nreturns at most `maxRecords` results — 50 by default — so counting it reports the limit\nrather than the number of matches whenever a search matches more Agents than the limit.\n\nThe term is matched the same way as `GET /api/v1/agent/search`: against Agent names and\ndescriptions, case-insensitive, and archived Agents are excluded unless `includeArchived`\nis set. So this total always equals the number of Agents that search would return if its\nlimit were high enough.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "The search term to match against agent names and descriptions",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "description": "Include archived Agents in the count",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the number of matching Agents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCountApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the query is empty or too short",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl \"https://dashboard.sequentum.com/api/v1/agent/search/count?query=checkout\" \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# => { \"totalCount\": 214 }\n\n# Include archived agents in the count:\n# curl \"https://dashboard.sequentum.com/api/v1/agent/search/count?query=checkout&includeArchived=true\" \\\n#   -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\""
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const params = new URLSearchParams({ query: \"checkout\" });\n\nconst res = await fetch(`https://dashboard.sequentum.com/api/v1/agent/search/count?${params}`, {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst { totalCount } = await res.json();\nconsole.log(`${totalCount} agents match`);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/agent/search/count\",\n    params={\"query\": \"checkout\"},\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nprint(response.json()[\"totalCount\"])  # e.g. 214"
          }
        ]
      }
    },
    "/api/v1/agent/personal/count": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get the number of Agents in your personal Space",
        "description": "Returns the number of Agents that belong to no Space — the ones the Control Center lists\nunder \"Personal\" — as a single total, so callers that only need a count do not have to\nfetch the full Agent list and count it themselves.\n\nPersonal Agents are not reachable through the Space endpoints: \"Personal\" is not a Space\nand has no `spaceId`, so `GET /api/v1/spaces/{spaceId}/agents/count` cannot return them.\nUse this endpoint for them instead.\n\nArchived Agents are excluded unless `includeArchived` is set. Organization administrators\nalso count the personal Agents of other users in their organization, matching the\nvisibility the other Agent endpoints already grant over those same Agents.",
        "parameters": [
          {
            "name": "includeArchived",
            "in": "query",
            "description": "Include archived Agents in the count",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the number of personal Agents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCountApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/agent/personal/count \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# => { \"totalCount\": 238 }"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent/personal/count\", {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst { totalCount } = await res.json();\nconsole.log(`${totalCount} agents in your personal space`);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/agent/personal/count\",\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nprint(response.json()[\"totalCount\"])  # e.g. 238"
          }
        ]
      }
    },
    "/api/v1/agent/{agentId}/runs": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get all runs for agent",
        "description": "Returns a list of all Runs and Run history for an Agent. By default the most recent records are returned first.\n\n**Filtering**\n\n- `status` — filter by Run status (`RunStatus` enum). `Failed` and `Failure` match each\n  other, and so do `Completed` and `Success`, the same as `GET /api/v1/analytics/runs/summary`.\n\n**Sorting**\n\n- `sortColumn` — `id` | `configName` | `serverName` | `sequence` | `created` | `startTime` |\n  `endTime` | `status` | `message` | `actionCount` | `pageCount` | `requestCount` |\n  `errorCount` | `dataCount` | `inputCount` | `exportCount` | `traffic` | `runTimeSec`\n  (default: `created`)\n- `sortOrder` — `0` ascending | `1` descending (default) — most recent Runs first\n\nRuns with no value in the sort column are listed last. A Run that is still queued has no\n`startTime`, so sorting by `startTime` lists it after every Run that has started.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The id of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "maxRecords",
            "in": "query",
            "description": "The maximum number of records to return (default: 50). The cap applies after sorting, so with the default sort you get the most recent Runs.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by (default: created)",
            "schema": {
              "type": "string",
              "default": "created"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending, 1 = descending (default)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by Run status (RunStatus: 0=Invalid, 1=Running, 2=Exporting, 3=Starting, 4=Queuing, 5=Stopping, 6=Failure, 7=Failed, 8=Stopped, 9=Completed, 10=Success, 11=Skipped, 12=Waiting, 13=UpdatingDataSet)",
            "schema": {
              "$ref": "#/components/schemas/RunStatus"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentRunApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/runs/summary": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get aggregate run counts for an agent",
        "description": "Returns the total number of Runs for an Agent together with a breakdown by `RunStatus`,\ncounted across both current Runs and Run history.\n\nUse this instead of counting the response of `GET /api/v1/agent/{agentId}/runs`. That\nendpoint returns at most `maxRecords` Runs — 50 by default — so counting it reports the\ncap rather than the real total for any Agent that has run more often than the limit.\n\n**Reading the breakdown**\n\n- Each entry carries the numeric `status`, its `statusName`, and the `count`.\n- Statuses with no Runs are omitted rather than reported as zero.\n- `Failure` and `Failed` are distinct statuses, as are `Completed` and `Success`. Add the\n  pairs together if you want a single failed or succeeded figure.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The id of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the total number of Runs and the per-status breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRunSummaryApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the Agent is not found or is not accessible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/agent/289/runs/summary \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# => {\n#      \"totalCount\": 395,\n#      \"statusCounts\": [\n#        { \"status\": 9, \"statusName\": \"Completed\", \"count\": 272 },\n#        { \"status\": 7, \"statusName\": \"Failed\",    \"count\": 72  },\n#        { \"status\": 8, \"statusName\": \"Stopped\",   \"count\": 51  }\n#      ]\n#    }"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent/289/runs/summary\", {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst summary = await res.json();\nconsole.log(`${summary.totalCount} runs total`);\n\nfor (const s of summary.statusCounts) {\n  console.log(`  ${s.statusName}: ${s.count}`);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/agent/289/runs/summary\",\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nsummary = response.json()\n\nprint(f\"{summary['totalCount']} runs total\")\nfor s in summary[\"statusCounts\"]:\n    print(f\"  {s['statusName']}: {s['count']}\")"
          }
        ]
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}/status": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get the status of a specific run",
        "description": "Returns the current status and details of a specific run. Faster than the agent-runs\nlist endpoint when you only need to check a single run; checks both the active runs\ntable and the run history.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent/config",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run to check",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the run status and details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRunApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the run or agent is not found, or user doesn't have access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}/files": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get all files for agent run",
        "description": "Get a list of of the files that were created when an agent was run.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent/config",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentRunFileApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}/file/{fileId}/download": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Download run file",
        "description": "Download the contents of a file from when an agent was run.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent/config",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "description": "The ID of the file to download",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "302": {
            "description": "Found"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get a single agent",
        "description": "Returns a specific agent accessible to the authenticated user within their organization.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent to retrieve",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the requested agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or user doesn't have access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/input-parameters": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get input parameters for an agent",
        "description": "Returns the list of input parameters the agent expects, including whether each parameter is encrypted.\n\nUse this endpoint to discover which parameters to pass when calling the start-run endpoint,\nand which parameters are sensitive (encrypted at rest). For encrypted parameters the default\nvalue is not returned, to avoid leaking secrets.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentInputParameterApiModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or user doesn't have access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/start": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Start a new agent run",
        "description": "Initiates a new run of the specified agent with the provided configuration parameters.\n\nSample request:\n```json\n{\n    \"inputParameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n    },\n    \"parallelism\": 1,\n    \"parallelMaxConcurrency\": 2,\n    \"parallelExport\": true,\n    \"proxyPoolId\": 123,\n    \"isExclusive\": false,\n    \"isWaitOnFailure\": true,\n    \"logLevel\": \"Info\",\n    \"logMode\": \"Normal\"\n}\n```\n\n**Encrypted input parameters**\n\nPrefix a parameter name with `?` to have its value encrypted at rest and hidden in\nthe Run log — for example `\"?apiKey\"` instead of `\"apiKey\"`. The name you send decides\nthis. Sending a name without the `?` prefix stores and logs the value in clear text,\n**even when the Agent defines that parameter as encrypted**. Omitting a parameter\nentirely leaves the Agent's own definition in effect, encryption included.\n\nIf you send both `\"name\"` and `\"?name\"`, the `?`-prefixed entry is used and the plain\none is discarded. The request still succeeds.\n\nCall `GET /api/v1/agent/{agentId}/input-parameters` to see which parameters an Agent\ndefines as encrypted.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent to run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "The configuration parameters for the run",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAgentApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAgentApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartAgentApiRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the ID of the newly created run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRunApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid or there was an error starting the agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid, or the user doesn't have permission to run the agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}/stop": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Stop a running agent",
        "description": "Stops a specific running agent instance.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent that contains the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run to stop",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The agent was successfully stopped"
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or user doesn't have access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If an unexpected server error occurs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}/kill": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Kill a running agent",
        "description": "Forcefully kills a specific running agent instance. The kill operation behaves differently\nbased on the current state:\n\n- **First call** — initiates a graceful stop (equivalent to the stop-run endpoint).\n- **Second call** — if the run is still stopping, forces immediate termination of the server process.\n\nUse this endpoint when a normal stop is not responding or when you need to force-terminate a stuck Run.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent that contains the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run to kill",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The kill command was successfully sent"
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or user doesn't have access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If an unexpected server error occurs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/run/{runId}": {
      "delete": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Delete a run and all its associated data",
        "description": "Deletes a specific run and all its associated data, including files and storage.\nThis is primarily used for PII compliance when an agent extracts personally identifiable\ninformation. The run can be in either the active Runs table or the RunHistory table —\nboth are checked automatically.\n\nThe `removeMethod` parameter controls what is deleted:\n\n- **`RemoveEntireRun`** (default) — completely removes the run record and all associated files.\n- **`RemoveAllFiles`** — removes files but keeps the run record.\n- **`RemoveAllFilesAndAgentInput`** — removes files and clears agent input parameters.\n\nReturns `400` if the Agent is archived — restore the Agent first.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent that contains the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run to delete",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "removeMethod",
            "in": "query",
            "description": "The deletion method to use. Defaults to RemoveEntireRun.",
            "schema": {
              "$ref": "#/components/schemas/RemoveRunMethod"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "The run was successfully deleted"
          },
          "400": {
            "description": "If the request is invalid or the Agent is archived",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or run is not found, or user doesn't have access",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If an unexpected server error occurs or the run could not be deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/version/{versionNumber}/restore": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Restore to a previous agent version",
        "description": "Restores a previous version of an agent configuration as the new version.\n\nSample request:\n```json\n{\n  \"content\":\"Comments about why this version is being restored\"\n}\n```\n\nReturns `400` if the Agent is archived — restore the Agent first.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "versionNumber",
            "in": "path",
            "description": "The version number to restore",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "Comments to include with the restored version",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StringContent"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StringContent"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StringContent"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The version was successfully restored"
          },
          "400": {
            "description": "If the request is invalid, the Agent is archived, or the restored version turns on file and log encryption while encryption is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid, or the user doesn't have permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or version is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/versions": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get all versions of an agent",
        "description": "Returns a list of all versions of the specified agent. The active version is always the largest version number\n\nRequires authorization.\n\n**Sorting**\n\n- `sortColumn` — `version` | `userName` | `created` (default: `version`)\n- `sortOrder` — `0` ascending | `1` descending (default) — the active version is listed first",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: version, userName, created",
            "schema": {
              "type": "string",
              "default": "version"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending, 1 = descending (default)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "A collection of agent versions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentVersionModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid, or the user doesn't have permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/content": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get an agent's content",
        "description": "Returns the latest version of an agent's content. Edit it and upload it via\n`POST {agentId}/content` to create a new version.\n\n`format` controls the shape of the returned `content`:\n- `json` (default) - the canonical config as a JSON object. This is the only format\n  `POST {agentId}/content` accepts.\n- `yaml` - the plain-text NestedText format used by the agent editor, returned as a string.\n\nSecret values in the content (for example static input values, or FTP/Snowflake\npasswords and API keys) are returned as encrypted ciphertext, not plaintext.\n\nRequires read access to the agent.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Either `json` (default) or `yaml`",
            "schema": {
              "$ref": "#/components/schemas/AgentContentFormat"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The agent's content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentContentModel"
                }
              }
            }
          },
          "400": {
            "description": "If `format` is not `json` or `yaml`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found, or the user doesn't have read access to it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "If `format=yaml` and this agent's content cannot be represented as yaml; retry with `format=json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableEntityError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/agent/123/content \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# Add ?format=yaml to get the plain-text NestedText format instead (content becomes a string):\n# curl https://dashboard.sequentum.com/api/v1/agent/123/content?format=yaml \\\n#   -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\""
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent/123/content\", {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst agentContent = await res.json();\nconsole.log(agentContent.content); // a JSON object, e.g. { Agent: { Commands: [...] } }\n\n// Add ?format=yaml to the URL to get the plain-text NestedText format instead\n// (content becomes a string)."
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/agent/123/content\",\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nagent_content = response.json()\nprint(agent_content[\"content\"])  # a JSON object, e.g. {\"Agent\": {\"Commands\": [...]}}\n\n# Add ?format=yaml to the URL to get the plain-text NestedText format instead\n# (content becomes a string)."
          }
        ]
      },
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Upload a new version of an agent's content",
        "description": "Parses the supplied config, creates a new agent version from it, and returns the new\nversion number together with the agent's resulting validation status. The exception is the\nfirst upload to an agent that has no content yet: it is stored as version 1, the version\nthe agent already reports, so `newVersion` is 1. Semantic validation\nerrors (e.g. a missing required export column) do **not** prevent the version from being\ncreated - they are returned in `errors` so the caller can decide whether to fix them. Syntax\nerrors, however, are rejected outright and no version is written.\n\n`content` must be a JSON object - the same shape returned by `GET {agentId}/content`'s\ndefault `format=json` (not the plain-text NestedText produced by `format=yaml`).\n\n`comments` is a mandatory commit message describing the change.\n\n`expectedVersion` is an optional optimistic-concurrency guard: when set, the upload is rejected\nwith a conflict if the agent's current version does not match it. Because the first upload to\nan agent with no content keeps version 1, the guard can't detect it: two callers that both\nsend `expectedVersion: 1` to an empty agent both succeed, and the first caller's content is\nkept as version 1 in the version history.\n\nRequires write access to the agent.\n\nReturns `400` if the Agent is archived — restore the Agent first.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "The new content, commit comments, and optional expected version",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadAgentContentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadAgentContentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UploadAgentContentRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The new version was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadAgentContentResult"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid, the content has a syntax error, or the Agent is archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found, or the user doesn't have write access to it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "If `expectedVersion` no longer matches the agent's current version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X POST https://dashboard.sequentum.com/api/v1/agent/123/content \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": {\n      \"Agent\": {\n        \"Commands\": [\n          { \"Type\": \"URL\", \"Name\": \"URL\", \"Input\": { \"Static Value\": \"https://example.com\" } }\n        ],\n        \"Export\": { \"Export Name\": \"My Agent\" }\n      }\n    },\n    \"comments\": \"Point at the new start URL\"\n  }'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent/123/content\", {\n  method: \"POST\",\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    // content must be the canonical config JSON object - the same shape returned by\n    // GET {agentId}/content's default format=json (not the format=yaml NestedText string).\n    content: {\n      Agent: {\n        Commands: [\n          { Type: \"URL\", Name: \"URL\", Input: { \"Static Value\": \"https://example.com\" } },\n        ],\n        Export: { \"Export Name\": \"My Agent\" },\n      },\n    },\n    comments: \"Point at the new start URL\",\n    // Optional optimistic-concurrency guard: reject the upload with a 409 if the agent\n    // has since moved past this version.\n    // expectedVersion: 4,\n  }),\n});\n\nconst result = await res.json();\nconsole.log(`Created version ${result.newVersion}, status ${result.validationStatus}`);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://dashboard.sequentum.com/api/v1/agent/123/content\",\n    headers={\n        \"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\",\n        \"Content-Type\": \"application/json\",\n    },\n    json={\n        # content must be the canonical config JSON object - the same shape returned by\n        # GET {agentId}/content's default format=json (not the format=yaml NestedText string).\n        \"content\": {\n            \"Agent\": {\n                \"Commands\": [\n                    {\"Type\": \"URL\", \"Name\": \"URL\", \"Input\": {\"Static Value\": \"https://example.com\"}}\n                ],\n                \"Export\": {\"Export Name\": \"My Agent\"},\n            }\n        },\n        \"comments\": \"Point at the new start URL\",\n        # Optional optimistic-concurrency guard: reject the upload with a 409 if the agent\n        # has since moved past this version.\n        # \"expectedVersion\": 4,\n    },\n)\nresponse.raise_for_status()\nresult = response.json()\nprint(f\"Created version {result['newVersion']}, status {result['validationStatus']}\")"
          }
        ]
      }
    },
    "/api/v1/agent/{agentId}/version/{versionNumber}/content": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get a specific version of an agent's content",
        "description": "Returns a historical version of an agent's content, identified by its version number\n(see `GET {agentId}/versions`).\n\n`format` controls the shape of the returned `content`:\n- `json` (default) - the canonical config as a JSON object. This is the only format\n  `POST {agentId}/content` accepts.\n- `yaml` - the plain-text NestedText format used by the agent editor, returned as a string.\n\nSecret values in the content (for example static input values, or FTP/Snowflake\npasswords and API keys) are returned as encrypted ciphertext, not plaintext.\n\nRequires read access to the agent.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "versionNumber",
            "in": "path",
            "description": "The version number to retrieve",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Either `json` (default) or `yaml`",
            "schema": {
              "$ref": "#/components/schemas/AgentContentFormat"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The agent's content at the requested version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentContentModel"
                }
              }
            }
          },
          "400": {
            "description": "If `format` is not `json` or `yaml`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or version is not found, or the user doesn't have read access to it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "If `format=yaml` and this agent's content cannot be represented as yaml; retry with `format=json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableEntityError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/agent/123/version/4/content \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# Add ?format=yaml to get the plain-text NestedText format instead (content becomes a string):\n# curl https://dashboard.sequentum.com/api/v1/agent/123/version/4/content?format=yaml \\\n#   -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\""
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent/123/version/4/content\", {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst agentContent = await res.json();\nconsole.log(agentContent.content); // a JSON object, e.g. { Agent: { Commands: [...] } }\n\n// Add ?format=yaml to the URL to get the plain-text NestedText format instead\n// (content becomes a string)."
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/agent/123/version/4/content\",\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nagent_content = response.json()\nprint(agent_content[\"content\"])  # a JSON object, e.g. {\"Agent\": {\"Commands\": [...]}}\n\n# Add ?format=yaml to the URL to get the plain-text NestedText format instead\n# (content becomes a string)."
          }
        ]
      }
    },
    "/api/v1/agent/{agentId}/schedules": {
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get all schedules for a specific agent",
        "description": "Returns a list of all scheduled tasks configured for the specified agent.\n\n**Filtering**\n\n- `isEnabled` — filter by whether the Schedule is enabled\n\n**Sorting**\n\n- `sortColumn` — `name` | `created` | `startedBy` | `startTime` | `nextRunTime` | `scheduleType` | `isEnabled` | `tag` (default: `startTime`)\n- `sortOrder` — `0` ascending | `1` descending (default)",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: name, created, startedBy, startTime, nextRunTime, scheduleType, isEnabled, tag",
            "schema": {
              "type": "string",
              "default": "startTime"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending, 1 = descending (default)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "isEnabled",
            "in": "query",
            "description": "Filter by whether the Schedule is enabled",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentScheduleApiModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Create a new schedule for an agent",
        "description": "Creates a new scheduled task that will automatically run the agent based on the specified schedule.\n\n**Schedule Types:**\n- **CRON (3)**: Use cronExpression to define a recurring schedule\n- **RunOnce (1)**: Requires startTime (must be at least 1 minute in the future) - runs once at the specified date/time\n- **RunEvery (2)**: Uses runEveryCount and runEveryPeriod (1=minutes, 2=hours, 3=days, 4=weeks, 5=months). Requires startTime, which anchors the recurrence and must be in the future.\n\n**StartTime Validation:**\n- For **RunOnce**: Required. Must be at least 1 minute in the future (UTC).\n- For **RunEvery**: Required. Must be in the future (UTC). Anchors the recurrence: the first run happens at this time and every later run is computed from it.\n- For **CRON**: Not used. Schedule is determined by cronExpression.\n\n**CRON Schedule Example:**\n```json\n{\n    \"name\": \"Daily Morning Run\",\n    \"scheduleType\": 3,\n    \"cronExpression\": \"0 9 * * 1,4\",\n    \"timezone\": \"America/New_York\",\n    \"isEnabled\": true\n}\n```\n\n**Run Once Example:**\n```json\n{\n    \"name\": \"One-time Run\",\n    \"scheduleType\": 1,\n    \"startTime\": \"2026-01-20T14:30:00Z\",\n    \"timezone\": \"America/New_York\",\n    \"isEnabled\": true\n}\n```\n\n**Run Every Example (every 30 minutes):**\n```json\n{\n    \"name\": \"Frequent Check\",\n    \"scheduleType\": 2,\n    \"runEveryCount\": 30,\n    \"runEveryPeriod\": 0,\n    \"startTime\": \"2026-01-17T10:00:00Z\",\n    \"timezone\": \"America/Denver\",\n    \"isEnabled\": true\n}\n```\n\n**Encrypted input parameters**\n\nPrefix a parameter name with `?` to have its value encrypted at rest and hidden in\nthe Run log — for example `\"?apiKey\"` instead of `\"apiKey\"`. The name you send decides\nthis. Sending a name without the `?` prefix stores and logs the value in clear text,\n**even when the Agent defines that parameter as encrypted**. Omitting a parameter\nentirely leaves the Agent's own definition in effect, encryption included.\n\nIf you send both `\"name\"` and `\"?name\"`, the `?`-prefixed entry is used and the plain\none is discarded. The request still succeeds.\n\nA Schedule stores its input parameters, so a clear-text value is also returned in\nclear text by `GET /api/v1/agent/{agentId}/schedules` to any caller with an API key\nand read access to the Agent's Space. Send `?name` for anything sensitive.\n\nCall `GET /api/v1/agent/{agentId}/input-parameters` to see which parameters an Agent\ndefines as encrypted.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "The schedule configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleApiRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the created schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentScheduleApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid, the schedule name is blank, or the schedule name is already used by another schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/schedules/{scheduleId}": {
      "delete": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Delete a schedule",
        "description": "Permanently removes the specified schedule from the agent.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "scheduleId",
            "in": "path",
            "description": "The ID of the schedule to delete",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "Schedule deleted successfully"
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or schedule is not found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Get a specific schedule by ID",
        "description": "Returns the details of a specific schedule for an agent.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "scheduleId",
            "in": "path",
            "description": "The ID of the schedule",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the schedule details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentScheduleApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or schedule is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Update an existing schedule",
        "description": "Updates the configuration of an existing scheduled task.\n\nReturns `400` if the Agent is archived — restore the Agent first before modifying its Schedules.\n\n**Schedule Types:**\n- **CRON (3)**: Use cronExpression to define a recurring schedule\n- **RunOnce (1)**: Requires startTime (must be in the future) - runs once at the specified date/time\n- **RunEvery (2)**: Uses runEveryCount and runEveryPeriod. Optional startTime for first run.\n\n**Encrypted input parameters**\n\nPrefix a parameter name with `?` to have its value encrypted at rest and hidden in\nthe Run log — for example `\"?apiKey\"` instead of `\"apiKey\"`. The name you send decides\nthis. Sending a name without the `?` prefix stores and logs the value in clear text,\n**even when the Agent defines that parameter as encrypted**. Omitting a parameter\nentirely leaves the Agent's own definition in effect, encryption included.\n\nIf you send both `\"name\"` and `\"?name\"`, the `?`-prefixed entry is used and the plain\none is discarded. The request still succeeds.\n\nA Schedule stores its input parameters, so a clear-text value is also returned in\nclear text by `GET /api/v1/agent/{agentId}/schedules` to any caller with an API key\nand read access to the Agent's Space. Send `?name` for anything sensitive.\n\nCall `GET /api/v1/agent/{agentId}/input-parameters` to see which parameters an Agent\ndefines as encrypted.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "scheduleId",
            "in": "path",
            "description": "The ID of the schedule to update",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "The updated schedule configuration",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleApiRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the updated schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentScheduleApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid, the agent is archived, the schedule name is blank, or the schedule name is already used by another schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or schedule is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/schedules/{scheduleId}/enable": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Enable a schedule",
        "description": "Enables a previously disabled schedule so it will run according to its configuration.\n\nReturns `400` if the Agent is archived — restore the Agent first before enabling its Schedules.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "scheduleId",
            "in": "path",
            "description": "The ID of the schedule to enable",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Schedule enabled successfully"
          },
          "400": {
            "description": "If the agent is archived or the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or schedule is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/schedules/{scheduleId}/disable": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Disable a schedule",
        "description": "Disables a schedule so it will not run until it is enabled again.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "scheduleId",
            "in": "path",
            "description": "The ID of the schedule to disable",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Schedule disabled successfully"
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or schedule is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/archive": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Archive an agent",
        "description": "Archives an agent, hiding it from default list views and disabling all schedules.\nArchived agents can still be accessed by ID and appear in list endpoints when\n`includeArchived=true`.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent to archive",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Agent archived successfully"
          },
          "400": {
            "description": "If the agent is not found, is not an agent, or is already archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid, or the user doesn't have permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/{agentId}/unarchive": {
      "post": {
        "tags": [
          "ApiAgent"
        ],
        "summary": "Unarchive an agent",
        "description": "Restores a previously archived agent so it appears in default list views again.\nSchedules remain disabled after unarchiving and must be re-enabled manually.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent to unarchive",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Agent unarchived successfully"
          },
          "400": {
            "description": "If the agent is not found, is not an agent, or is not archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid, or the user doesn't have permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent-builder/start": {
      "post": {
        "tags": [
          "ApiAgentBuilder"
        ],
        "summary": "Start a new agent building session",
        "description": "**Session Lifecycle**\n\n1. **POST /start** (this endpoint) — create a session from a prompt → returns `sessionId`.\n2. **GET /{sessionId}/status** — poll every few seconds until `status` is `\"completed\"`\n   (the AI finished building the agent successfully), `\"ready\"` (the AI finished its turn\n   but the agent may not have been saved yet), or `\"error\"`. On any terminal status the\n   response also contains `agentId` and `agentName`; **stop polling at that point**.\n   Subsequent calls may return the same terminal response or `404` — both mean the build\n   is done.\n3. **POST /{sessionId}/stop** *(optional)* — abort the session early if you no longer\n   want the build to continue. Returns `204 No Content`. Has no effect once the session\n   has already reached a terminal state.\n\n> **Note:** The session tears down automatically a short time after reaching a terminal\n> status — no explicit teardown call is required. The agent draft is saved in your\n> workspace as soon as the AI creates it (before the session ends). The draft persists\n> whether or not you call `/stop`; use the standard agents API to delete unwanted drafts.\n\nIf `spaceId` is provided, it must be an existing Space you have write access to, or the\ncall returns `403`. Omit `spaceId` to save the agent to your Personal space.\n\nStarting a session requires available credits; without them the call returns `402` with\n`errorCode: \"outOfCredits\"`. Only the start is gated — a session already under way runs\nto completion.",
        "operationId": "AgentBuilder_StartSession",
        "requestBody": {
          "description": "The prompt and optional Space to save to",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalStartAgentBuildRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalStartAgentBuildResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "402": {
            "description": "Your organization has no available credits and cannot start a new session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequiredError"
                }
              }
            }
          },
          "403": {
            "description": "Agent Builder is disabled for your organization, or you do not have write access to the requested Space",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/agent-builder/start \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"Build an agent that extracts product names and prices from example.com.\"\n  }'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/agent-builder/start\", {\n  method: \"POST\",\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    prompt: \"Build an agent that extracts product names and prices from example.com.\",\n    // Optional: an existing Space id you have write access to. Omit to save to your\n    // Personal space; an id you cannot write to (or that doesn't exist) returns 403.\n    // spaceId: 42,\n  }),\n});\n\nconst { sessionId } = await res.json();\nconsole.log(`Started session ${sessionId}`);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://dashboard.sequentum.com/api/v1/agent-builder/start\",\n    headers={\n        \"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\",\n        \"Content-Type\": \"application/json\",\n    },\n    json={\n        \"prompt\": \"Build an agent that extracts product names and prices from example.com.\",\n        # Optional: an existing Space id you have write access to. Omit to save to your\n        # Personal space; an id you cannot write to (or that doesn't exist) returns 403.\n        # \"spaceId\": 42,\n    },\n)\nresponse.raise_for_status()\nsession_id = response.json()[\"sessionId\"]\nprint(f\"Started session {session_id}\")"
          }
        ]
      }
    },
    "/api/v1/agent-builder/{sessionId}/status": {
      "get": {
        "tags": [
          "ApiAgentBuilder"
        ],
        "summary": "Get current status for a session (lightweight polling endpoint)",
        "description": "Poll every few seconds until `status` is `\"completed\"`, `\"ready\"`, `\"error\"` or `\"cancelled\"`.\n\n- `503` with a `Retry-After` header means the server building the Agent did not answer this time. The Session\n  is most likely still running, so keep polling.\n- When the server building the Agent is known to have lost the Session, for example because it ran out of\n  memory, the status is `\"error\"` and `error` says what happened. Start a new Session to try again.\n- `404` means the Session does not exist or has already been torn down.",
        "operationId": "AgentBuilder_GetSessionStatus",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session ID returned from /start",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalSessionStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent-builder/{sessionId}/stop": {
      "post": {
        "tags": [
          "ApiAgentBuilder"
        ],
        "summary": "Stop and clean up a session, releasing all associated resources",
        "operationId": "AgentBuilder_StopSession",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/runs/summary": {
      "get": {
        "tags": [
          "ApiAnalytics"
        ],
        "summary": "Get runs summary for a date range",
        "description": "Returns a summary of all runs (completed, failed, running, etc.) within the specified date range.\nUseful for answering questions like:\n- \"How many agents ran yesterday?\"\n- \"What agents failed last week?\"\n\n`Failure` and `Failed` are one `status` filter, and so are `Completed` and `Success`:\nfiltering by either value counts Runs stored as either one.\n\n**Sorting failed Run details**\n\n- `sortColumn` — `startTime` | `endTime` | `agentName` | `runId` (default: `startTime`)\n- `sortOrder` — `0` ascending | `1` descending (default)\n- `maxDetails` — maximum number of failed Run details returned (min `1`, max `1000`). Omit it to return all of them.",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, defaults to yesterday)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, defaults to now)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Optional: only count Runs in this status (see the remarks for statuses that filter together).",
            "schema": {
              "$ref": "#/components/schemas/RunStatus"
            }
          },
          {
            "name": "includeDetails",
            "in": "query",
            "description": "Whether to include details of failed runs (default: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort failed Run details by: startTime, endTime, agentName, runId (default: startTime)",
            "schema": {
              "type": "string",
              "default": "startTime"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order for failed Run details: 0 = ascending, 1 = descending (default)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "maxDetails",
            "in": "query",
            "description": "Maximum number of failed Run details to return (min 1, max 1000). Omit it to return all of them.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the runs summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunsSummaryApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the date range is invalid, or maxDetails is out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/records/summary": {
      "get": {
        "tags": [
          "ApiAnalytics"
        ],
        "summary": "Get records summary for a date range",
        "description": "Returns a summary of records extracted and exported within the specified date range.\nUseful for answering questions like \"How many records did the agent download yesterday?\"",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, defaults to yesterday)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, defaults to now)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional: Filter by specific agent ID",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the records summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordsSummaryApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the date range is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/schedules/upcoming": {
      "get": {
        "tags": [
          "ApiAnalytics"
        ],
        "summary": "Get all upcoming scheduled runs in a date range",
        "description": "Returns all scheduled runs that are configured to execute within the specified date range.\nUseful for answering questions like \"What agents are scheduled to run this week?\"\n\nEach item includes the Schedule's own settings (cron expression, type, run-every interval,\ntimezone), the Space and approval status of the Agent it belongs to, and details of the most\nrecent Run this Schedule started (id, start time, status, and message), when it has run before.\n\n**Filtering**\n\n- `isEnabled` — `true` (default) returns enabled Schedules, `false` returns disabled Schedules\n\n**Sorting**\n\n- `sortColumn` — `nextRunTime` | `startTime` | `name` | `configName` | `spaceName` | `status` (default: `nextRunTime`).\n  `startTime` and `status` sort by the most recent Run this Schedule started, not by the Schedule itself.\n- `sortOrder` — `0` ascending (default), soonest scheduled Run first | `1` descending\n\nAt most 1000 Schedules are returned. If more Schedules match, the sort decides which ones:\nwith the default sort you get the 1000 that run soonest.",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by (default: nextRunTime)",
            "schema": {
              "type": "string",
              "default": "nextRunTime"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending (default), 1 = descending",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "isEnabled",
            "in": "query",
            "description": "Filter by whether the Schedule is enabled (default: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of upcoming scheduled runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UpcomingScheduleApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/agents/{agentId}/runs/{runId}/diagnostics": {
      "get": {
        "tags": [
          "ApiAnalytics"
        ],
        "summary": "Get detailed diagnostics for a run",
        "description": "Returns detailed diagnostic information for a specific run, including error messages,\nstatistics, possible causes of failure, and suggested remediation actions.\nUseful for answering questions like \"Why did my agent fail?\"",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "The ID of the run",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the run diagnostics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDiagnosticsApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent or run is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/agents/{agentId}/latest-failure": {
      "get": {
        "tags": [
          "ApiAnalytics"
        ],
        "summary": "Get the most recent failed run for an agent",
        "description": "Returns diagnostics for the most recent failed run of the specified agent.\nUseful when asking \"Why did my agent fail?\" without specifying a run ID.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the run diagnostics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDiagnosticsApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or has no failed runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/credits": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get available credits balance",
        "description": "Returns the current available credits balance for the user's organization.\nUseful for answering questions like \"How many credits do I have left?\"\n\nNOTE: As of migration 100160, balance is computed from active grants (RemainingAmount-based)\nrather than the legacy running Balance ledger column. This is intentional; orgs that relied\non the old positive-balance row while having exhausted their grants will now see 0 instead.",
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the credits balance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsBalanceApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/spending": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get spending summary for a date range",
        "description": "Returns the total amount spent within the specified date range.\nUseful for answering questions like \"How much have I spent this week?\"",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, defaults to start of current week)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, defaults to now)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the spending summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpendingSummaryApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the date range is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/history": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get credit transaction history",
        "description": "Returns the history of credit transactions (additions, deductions, etc.) for the organization.\n\n**Sorting**\n\n- `sortColumn` — `transactionType` | `amount` | `balance` | `created` | `updated` (default: `created`)\n- `sortOrder` — `0` ascending | `1` descending (default)",
        "parameters": [
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based, default: 1)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "recordsPerPage",
            "in": "query",
            "description": "Records per page (default: 50, max: 100)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: transactionType, amount, balance, created, updated",
            "schema": {
              "type": "string",
              "default": "created"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending, 1 = descending (default)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the credit history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditHistoryApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/agents": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get all agents with their costs for a date range",
        "description": "Returns a paginated list of agents with their total costs within the specified date range.\nOnly returns agents the authenticated user has access to.\n\n**Filtering**\n\n- `name` — filter by agent name (case-insensitive contains match)\n- `usageTypes` — filter by usage type (comma-separated: `Server Time`, `Export GB`, `Agent Inputs`, `Proxy Data`, `Export CPM`)\n\n**Sorting**\n\n- `sortColumn` — `name` | `cost` (default: `name`)\n- `sortOrder` — `0` ascending (default) | `1` descending",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based, default: 1)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "recordsPerPage",
            "in": "query",
            "description": "Records per page (default: 50, max: 1000)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: name, cost",
            "schema": {
              "type": "string",
              "default": "name"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending (default), 1 = descending",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filter by agent name (contains match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "usageTypes",
            "in": "query",
            "description": "Filter by usage types (comma-separated)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the paginated list of agents with costs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentsUsageApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid (e.g., missing date range)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/agents/{agentId}": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get cost breakdown for a specific agent over time",
        "description": "Returns the cost breakdown by usage type for a specific agent within the specified date range.\nUseful for visualizing agent costs over time in charts.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The agent ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "timeUnit",
            "in": "query",
            "description": "Time unit for grouping data: day (default), month",
            "schema": {
              "type": "string",
              "default": "day"
            }
          },
          {
            "name": "usageTypes",
            "in": "query",
            "description": "Filter by usage types (comma-separated)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the cost breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCostBreakdownApiModel"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or not accessible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/agents/{agentId}/runs": {
      "get": {
        "tags": [
          "ApiBilling"
        ],
        "summary": "Get individual run costs for a specific agent",
        "description": "Returns a paginated list of runs with their costs for a specific agent within the specified date range.\n\n**Filtering**\n\n- `usageTypes` — filter by usage type (comma-separated: `Server Time`, `Export GB`, `Agent Inputs`, `Proxy Data`, `Export CPM`)\n\n**Sorting**\n\n- `sortColumn` — `date` | `cost` | `duration` (default: `date`)\n- `sortOrder` — `0` ascending (default) | `1` descending",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The agent ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the range (ISO format, required)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based, default: 1)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "recordsPerPage",
            "in": "query",
            "description": "Records per page (default: 50, max: 1000)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: date, cost, duration",
            "schema": {
              "type": "string",
              "default": "date"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending (default), 1 = descending",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "usageTypes",
            "in": "query",
            "description": "Filter by usage types (comma-separated)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the paginated list of runs with costs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRunsApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "If the request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the agent is not found or not accessible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dataset-uploads": {
      "post": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Register a dataset upload",
        "description": "Register Parquet tables and optionally one ZIP of downloaded files. The response contains a Run Proxy URL for each file and an upload token valid for 24 hours.\n            Existing datasets can omit tables to reuse saved mappings or match all business tables by name.\n            Each upload replaces the complete source, sequence and parallel-set slice. Tables omitted from an explicit table list lose their rows in that slice.\n            Idempotency-Key is optional but recommended; reuse the same key when retrying registration.\n            Without a key, each request creates a new registration subject to normal conflict checks.\n            Category and dataset names are matched case-insensitively. A category name is reused or created within the owning organization.\n            Organization administrator access is required.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogUploadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogUploadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogUploadRequest"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request POST 'https://dashboard.sequentum.com/api/v1/dataset-uploads' \\\n  --header 'Authorization: ApiKey {key}' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\"datasetId\":42,\"sourceId\":\"crm\"}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads', {\n  method: 'POST',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY, 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"datasetId\":42,\"sourceId\":\"crm\"})\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    json={\"datasetId\":42,\"sourceId\":\"crm\"},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/dataset-uploads/{uploadId}": {
      "get": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Get upload progress",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request GET 'https://dashboard.sequentum.com/api/v1/dataset-uploads/123' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads/123', {\n  method: 'GET',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads/123',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/dataset-uploads/{uploadId}/complete": {
      "post": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Complete an upload",
        "description": "No request body or file list is required. Control Center checks the Run Proxy's recorded uploads.\n            A 409 response lists files that are missing or still processing. Retry after their uploads finish.\n            Repeated completion requests return the same upload.",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request POST 'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/complete' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads/123/complete', {\n  method: 'POST',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/complete',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/dataset-uploads/{uploadId}/preview": {
      "post": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Preview uploaded table schemas",
        "description": "Upload all files first. Preview does not close intake or modify dataset contents.",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request POST 'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/preview' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads/123/preview', {\n  method: 'POST',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/preview',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/dataset-uploads/{uploadId}/token": {
      "post": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Replace an upload token",
        "description": "The replacement token expires at the original 24-hour deadline and invalidates the previous token for new transfers.",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request POST 'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/token' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads/123/token', {\n  method: 'POST',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/token',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/dataset-uploads/{uploadId}/expire": {
      "post": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Expire an unfinished upload",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogUploadResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request POST 'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/expire' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/dataset-uploads/123/expire', {\n  method: 'POST',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    'https://dashboard.sequentum.com/api/v1/dataset-uploads/123/expire',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/datasets/{datasetId}/schema": {
      "get": {
        "tags": [
          "ApiDatasetUploads"
        ],
        "summary": "Read a dataset schema",
        "description": "Returns the existing tables, relationships and downloaded-file column definitions for registration mappings.",
        "parameters": [
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSchema"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSchema"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSchema"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl --request GET 'https://dashboard.sequentum.com/api/v1/datasets/42/schema' \\\n  --header 'Authorization: ApiKey {key}'"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const response = await fetch('https://dashboard.sequentum.com/api/v1/datasets/42/schema', {\n  method: 'GET',\n  headers: { Authorization: 'ApiKey ' + process.env.SEQUENTUM_API_KEY }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    'https://dashboard.sequentum.com/api/v1/datasets/42/schema',\n    headers={'Authorization': 'ApiKey ' + os.environ['SEQUENTUM_API_KEY']},\n    timeout=60,\n)\nresponse.raise_for_status()\nprint(response.json())"
          }
        ]
      }
    },
    "/api/v1/input-files/agent/{agentId}": {
      "post": {
        "tags": [
          "ApiInputFile"
        ],
        "summary": "Upload input files to an Agent",
        "description": "Stores one or more input files against a single Agent. Only that Agent can read them at\nRun time - use the Space endpoint instead to share one file across every Agent in a Space.\n\nThe request is `multipart/form-data` with one or more parts named `files`.\n\n**Supported formats**\n\n`.csv`, `.tsv`, `.txt`, `.json`, `.xml`, `.xls`, `.xlsx`, `.parquet`, `.zip`. A file may\nbe up to 2 GB, and 2 GB is also the ceiling on the request as a whole - every `files`\npart, the `lastModified` part and the multipart framing count toward it. So a batch has to\nstay under 2 GB in total, and a single file has to leave room for the framing around it. A\nrequest over the ceiling is rejected while the body is still being read, before the\nendpoint runs, so it does not come back with the usual error body.\n\nThe Editor applies its own, lower ceiling of 100 MiB when a file is uploaded through an\nAgent's `Files` panel. That is a limitation of the Editor, not of this endpoint: a file\nbetween 100 MiB and 2 GB is accepted here and readable by a Run, but cannot be uploaded or\nreplaced through the Editor.\n\n**Re-uploading**\n\nUploading a file whose name already exists overwrites it, so a Run always reads the file\nmost recently uploaded under that name. This is what makes a two-stage workflow work: the\nfirst Agent's output can be pushed under a fixed name that the second Agent reads. Agent\ninput files keep no version history, and the returned `id` changes on every upload.\n\nA `.zip` is stored as a single file on this endpoint - it is never expanded. A zip whose\ncontents cannot be read is rejected.\n\n**Last Modified**\n\nBy default, the file's Last Modified time shown in the Agent's Files panel is the time of\nthis upload. Send `lastModified` to record the file's own modification time instead - one\nvalue applies to every file, or send one value per `files` part to give each file its own\ntime.\n\nThe Editor sends this value automatically when a file is uploaded through an Agent's\n`Files` panel: the browser reads it from the file you pick, with nothing for you to do. A\nscript or HTTP client calling this endpoint has no such value available on its own - no\ncommon client (curl, Postman, `requests`, `httpx`) attaches a file's modification time to\nan upload by default. To match what the Editor does, read the file's own mtime yourself\nand send `lastModified`, the way every code sample on this page does.\n\nEvery file is checked before any of them is stored — its name, extension and size, and for a\n`.zip`, that its contents can be read. The batch is then written in a single database\ntransaction. So a rejected request stores nothing at all, and a request that fails while\nbeing written registers none of its files against the Agent.\n\nRequires write access to the Agent.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "The ID of the Agent",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "The input files to store"
                  },
                  "lastModified": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "description": "Optional last-modified time(s) for the files, as a Unix epoch between `315532800` (1980-01-01) and `4102444800` (2100-01-01) in seconds, or the equivalent in milliseconds. Send one value to apply it to every file in the batch, or one value per `files` part, in the same order, to give each file its own time. `0` or omitting the part entirely means the time of the upload, and a value ahead of the upload time is recorded as the upload time."
                  }
                }
              },
              "encoding": {
                "files": {
                  "style": "form"
                },
                "lastModified": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The files were stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InputFileUploadResult"
                }
              }
            }
          },
          "400": {
            "description": "If no files were sent; a file is empty, oversized, or has an unsupported extension or name; `lastModified` is out of range, or its count matches neither one nor the number of `files`; or a `.zip` cannot be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the Agent is not found, or the user doesn't have write access to it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If the files could not be stored. The message carries a reference that identifies the request in the server logs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "# Omitting lastModified records the upload time instead of each file's own mtime.\ncurl -X POST https://dashboard.sequentum.com/api/v1/input-files/agent/123 \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\" \\\n  -F \"files=@urls.csv\" \\\n  -F \"files=@extra-urls.txt\" \\\n  -F \"lastModified=$(date -r urls.csv +%s)\" \\\n  -F \"lastModified=$(date -r extra-urls.txt +%s)\""
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "import { readFile, stat } from \"node:fs/promises\";\n\nconst form = new FormData();\n// Every part must be named \"files\". Re-uploading a name overwrites that input file, so the\n// next Run of the Agent reads whatever was uploaded last under that name.\nform.append(\"files\", new Blob([await readFile(\"urls.csv\")]), \"urls.csv\");\n// lastModified is a Unix epoch in seconds or milliseconds - mtimeMs is already the unit the\n// API accepts, rounded because it carries a fractional part. Omitting it records the upload\n// time instead of the file's own mtime.\nform.append(\"lastModified\", String(Math.round((await stat(\"urls.csv\")).mtimeMs)));\n\nconst res = await fetch(\"https://dashboard.sequentum.com/api/v1/input-files/agent/123\", {\n  method: \"POST\",\n  headers: { \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}` },\n  body: form,\n});\n\nconst result = await res.json();\nfor (const file of result.files) {\n  console.log(`Stored ${file.name} (${file.size} bytes)`);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\n# Every part must be named \"files\". Re-uploading a name overwrites that input file, so the\n# next Run of the Agent reads whatever was uploaded last under that name.\n# lastModified is a Unix epoch in seconds or milliseconds - getmtime() is already the unit the\n# API accepts. Omitting it records the upload time instead of the file's own mtime.\nwith open(\"urls.csv\", \"rb\") as handle:\n    response = requests.post(\n        \"https://dashboard.sequentum.com/api/v1/input-files/agent/123\",\n        headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n        files=[(\"files\", (\"urls.csv\", handle, \"text/csv\"))],\n        data={\"lastModified\": int(os.path.getmtime(\"urls.csv\"))},\n    )\n\nresponse.raise_for_status()\nfor file in response.json()[\"files\"]:\n    print(f\"Stored {file['name']} ({file['size']} bytes)\")"
          }
        ]
      }
    },
    "/api/v1/input-files/space/{spaceId}": {
      "post": {
        "tags": [
          "ApiInputFile"
        ],
        "summary": "Upload input files to a Space",
        "description": "Stores one or more input files in a Space, where every Agent in that Space can read them\nat Run time by file name. Use the Agent endpoint instead to keep a file private to a\nsingle Agent.\n\nThe request is `multipart/form-data` with one or more parts named `files`.\n\n**Supported formats**\n\n`.csv`, `.tsv`, `.txt`, `.json`, `.xml`, `.xls`, `.xlsx`, `.parquet`, `.zip`. A file may\nbe up to 100 MiB, and the request as a whole - every `files` part, the `lastModified` part\nand the multipart framing - has to stay under 2 GB. A request over that ceiling is rejected\nwhile the body is still being read, before the endpoint runs, so it does not come back with\nthe usual error body.\n\n**Re-uploading**\n\nUploading a file whose name already exists overwrites its content in place, keeping the\nsame `id`, so a Run always reads the file most recently uploaded under that name. This is\nwhat makes a two-stage workflow work: the first Agent's output can be pushed under a fixed\nname that the second Agent reads.\n\n**Zip files**\n\nA `.zip` produced by exporting a Run is expanded into one input file per text file inside\nit, matching what the Control Center UI does; the response reports each extracted file\nwith `expandedFrom` set to the zip's name. Entries whose extension is not in the supported\nlist are skipped. Any other `.zip` is stored as a single file.\n\nAn expanded zip may contain at most 500 input files totalling 500 MiB uncompressed, and\neach entry name must be a plain file name — an entry carrying a directory path, or a zip\nwhose contents cannot be read, is rejected.\n\n**Last Modified**\n\nBy default, the file's Last Modified time shown in the Space's file list is the time of\nthis upload. Send `lastModified` to record the file's own modification time instead - one\nvalue applies to every file, or send one value per `files` part to give each file its own\ntime.\n\nThe Control Center UI always sends this value automatically: the browser reads it from the\nfile you pick, with nothing for you to do. A script or HTTP client calling this endpoint has\nno such value available on its own - no common client (curl, Postman, `requests`, `httpx`)\nattaches a file's modification time to an upload by default. If you want this endpoint to\nmatch the UI's behavior, read the file's own mtime yourself and send `lastModified`, the way\nevery code sample on this page does.\n\n**What this endpoint will not do**\n\nThe Space file store imports a text file whose first token is `agent:` or `@template:` as\nan Agent or Template definition. This endpoint refuses such a file rather than creating or\nreplacing an Agent — upload Agent content with `POST /api/v1/agent/{agentId}/content`\ninstead. A file whose name is already taken by an Agent or Template in the Space is\nlikewise refused.\n\nEvery file is checked before any of them is stored — its name, extension and size, and for a\n`.zip`, that its contents can be read. The batch is then written in a single database\ntransaction. So a rejected request stores nothing at all, and a request that fails while\nbeing written registers none of its files against the Space.\n\nRequires write access to the Space.",
        "parameters": [
          {
            "name": "spaceId",
            "in": "path",
            "description": "The ID of the Space",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "The input files to store"
                  },
                  "lastModified": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "description": "Optional last-modified time(s) for the files, as a Unix epoch between `315532800` (1980-01-01) and `4102444800` (2100-01-01) in seconds, or the equivalent in milliseconds. Send one value to apply it to every file in the batch, or one value per `files` part, in the same order, to give each file its own time. `0` or omitting the part entirely means the time of the upload, and a value ahead of the upload time is recorded as the upload time."
                  }
                }
              },
              "encoding": {
                "files": {
                  "style": "form"
                },
                "lastModified": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "The files were stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InputFileUploadResult"
                }
              }
            }
          },
          "400": {
            "description": "If no files were sent; a file is empty, oversized, or has an unsupported extension or name; `lastModified` is out of range, or its count matches neither one nor the number of `files`; a `.zip` cannot be read or exceeds the expansion limits; the content would be imported as an Agent or Template; or the name is already taken by an Agent or Template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the Space is not found, or the user doesn't have write access to it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If the files could not be stored. The message carries a reference that identifies the request in the server logs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "# Omitting lastModified records the upload time instead of the file's own mtime.\ncurl -X POST https://dashboard.sequentum.com/api/v1/input-files/space/7 \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\" \\\n  -F \"files=@seeds.csv\" \\\n  -F \"lastModified=$(date -r seeds.csv +%s)\""
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "import { readFile, stat } from \"node:fs/promises\";\n\nconst form = new FormData();\n// A zip exported from a Run is expanded into one input file per text file inside it; each\n// one comes back with expandedFrom set to the zip's name.\nform.append(\"files\", new Blob([await readFile(\"export_run812.zip\")]), \"export_run812.zip\");\n// lastModified is a Unix epoch in seconds or milliseconds - mtimeMs is already the unit the\n// API accepts, rounded because it carries a fractional part. Omitting it records the upload\n// time instead of the file's own mtime.\nform.append(\"lastModified\", String(Math.round((await stat(\"export_run812.zip\")).mtimeMs)));\n\nconst res = await fetch(\"https://dashboard.sequentum.com/api/v1/input-files/space/7\", {\n  method: \"POST\",\n  headers: { \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}` },\n  body: form,\n});\n\nconst result = await res.json();\nfor (const file of result.files) {\n  console.log(`Stored ${file.name} (id ${file.id})`);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\n# A zip exported from a Run is expanded into one input file per text file inside it; each\n# one comes back with expandedFrom set to the zip's name.\n# lastModified is a Unix epoch in seconds or milliseconds - getmtime() is already the unit the\n# API accepts. Omitting it records the upload time instead of the file's own mtime.\nwith open(\"export_run812.zip\", \"rb\") as handle:\n    response = requests.post(\n        \"https://dashboard.sequentum.com/api/v1/input-files/space/7\",\n        headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n        files=[(\"files\", (\"export_run812.zip\", handle, \"application/zip\"))],\n        data={\"lastModified\": int(os.path.getmtime(\"export_run812.zip\"))},\n    )\n\nresponse.raise_for_status()\nfor file in response.json()[\"files\"]:\n    print(f\"Stored {file['name']} (id {file['id']})\")"
          }
        ]
      }
    },
    "/api/v1/spaces": {
      "get": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Get all spaces accessible to the user",
        "description": "Returns the Spaces the authenticated user has access to within their organization.\nOrganization Administrators and SE4 Administrators get every Space in the organization.\nOther users get the Spaces with default access plus the Spaces granted to their User Groups.",
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of spaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpaceApiModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/spaces/{spaceId}": {
      "get": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Get a specific space by ID",
        "description": "Returns details of a specific space.",
        "parameters": [
          {
            "name": "spaceId",
            "in": "path",
            "description": "The ID of the space",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the space details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the space is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/spaces/{spaceId}/agents": {
      "get": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Get all agents in a space",
        "description": "Returns a list of all Agents within the specified Space. Archived Agents are excluded\nunless `includeArchived` is set.\n\nTo get only the number of Agents in the Space, use\n`GET /api/v1/spaces/{spaceId}/agents/count` instead of counting this list. That count\naccepts `includeArchived` but not `status`, so it matches this list only when `status` is not set.\n\n**Filtering**\n\n- `status` — filter by the Agent's last Run status (`RunStatus` name, e.g. `Completed`). `Failure` and\n  `Failed` are one filter, and so are `Completed` and `Success`, the same as `GET /api/v1/agent/all`.\n- `includeArchived` — include archived Agents (default: `false`)\n\n**Sorting**\n\n- `sortColumn` — `name` | `description` | `status` | `updated` | `created` | `lastActivity` (default: `name`)\n- `sortOrder` — `0` ascending (default) | `1` descending",
        "parameters": [
          {
            "name": "spaceId",
            "in": "path",
            "description": "The ID of the space",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sortColumn",
            "in": "query",
            "description": "Column to sort by: name, description, status, updated, created, lastActivity",
            "schema": {
              "type": "string",
              "default": "name"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order: 0 = ascending (default), 1 = descending",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by the Agent's last Run status",
            "schema": {
              "$ref": "#/components/schemas/RunStatus"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "description": "Include archived Agents in the list",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the list of agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpaceAgentApiModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If status is not a valid RunStatus value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the space is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/spaces/{spaceId}/agents/count": {
      "get": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Get the number of Agents in a Space",
        "description": "Returns the number of Agents in the specified Space as a single total, so callers that only\nneed a count do not have to fetch the full Agent list and count it themselves.\n\nThe total always matches the number of Agents returned by\n`GET /api/v1/spaces/{spaceId}/agents` for the same Space and the same `includeArchived`\nvalue, when that endpoint's `status` filter is not set: archived Agents are excluded from\nboth unless `includeArchived` is set, and Space contents that are not Agents are not counted.",
        "parameters": [
          {
            "name": "spaceId",
            "in": "path",
            "description": "The ID of the Space",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "description": "Include archived Agents in the count",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the number of Agents in the Space",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCountApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the Space is not found or is not accessible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "If an unexpected server error occurs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://dashboard.sequentum.com/api/v1/spaces/42/agents/count \\\n  -H \"Authorization: ApiKey $SEQUENTUM_API_KEY\"\n\n# => { \"totalCount\": 73 }"
          },
          {
            "lang": "node",
            "label": "Node.js",
            "source": "const res = await fetch(\"https://dashboard.sequentum.com/api/v1/spaces/42/agents/count\", {\n  headers: {\n    \"Authorization\": `ApiKey ${process.env.SEQUENTUM_API_KEY}`,\n  },\n});\n\nconst { totalCount } = await res.json();\nconsole.log(`${totalCount} agents in this space`);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.get(\n    \"https://dashboard.sequentum.com/api/v1/spaces/42/agents/count\",\n    headers={\"Authorization\": f\"ApiKey {os.environ['SEQUENTUM_API_KEY']}\"},\n)\nresponse.raise_for_status()\nprint(response.json()[\"totalCount\"])  # e.g. 73"
          }
        ]
      }
    },
    "/api/v1/spaces/{spaceId}/run-all": {
      "post": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Run all agents in a space",
        "description": "Starts every agent in the specified Space. Each agent is started independently;\nper-agent failures (for example, an agent that already has a Run in progress) are\nreported in the results without affecting the other agents.\n\nOptional `proxyPoolId`, `logLevel`, and `logMode` fields in the request body are applied\nto every run that is started. All runs execute in the caller's organization.\n`serverOrganizationId` is not accepted on this endpoint.\n\n**Encrypted input parameters**\n\nPrefix a parameter name with `?` to have its value encrypted at rest and hidden in\nthe Run log — for example `\"?apiKey\"` instead of `\"apiKey\"`. The name you send decides\nthis. Sending a name without the `?` prefix stores and logs the value in clear text,\n**even when the Agent defines that parameter as encrypted**. Omitting a parameter\nentirely leaves the Agent's own definition in effect, encryption included.\n\nIf you send both `\"name\"` and `\"?name\"`, the `?`-prefixed entry is used and the plain\none is discarded. The request still succeeds.\n\nCall `GET /api/v1/agent/{agentId}/input-parameters` for any Agent in the Space to see\nwhich parameters it defines as encrypted.",
        "parameters": [
          {
            "name": "spaceId",
            "in": "path",
            "description": "The ID of the space",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "Optional run parameters",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunSpaceAgentsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RunSpaceAgentsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RunSpaceAgentsRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the results of starting each agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunSpaceAgentsResultApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If the space is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/spaces/search": {
      "get": {
        "tags": [
          "ApiSpace"
        ],
        "summary": "Search for a space by name",
        "description": "Searches for a space by name within the user's organization.\nUseful for finding a space like \"Bot Blocking\" by name.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "The name of the space to search for",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "Returns the matching space",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceApiModel"
                }
              }
            }
          },
          "401": {
            "description": "If the API key is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "If no space with that name is found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgentApiModel": {
        "type": "object",
        "properties": {
          "agentTemplates": {
            "type": "string",
            "nullable": true
          },
          "configType": {
            "$ref": "#/components/schemas/ConfigType"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "documentation": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "image": {
            "type": "string",
            "format": "byte",
            "nullable": true
          },
          "inputParameters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "readOnly": true
          },
          "lastActivity": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "proxyPoolId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "spaceId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "startUrl": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "validationStatus": {
            "$ref": "#/components/schemas/ConfigValidationStatus"
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentBuilderSessionStatus": {
        "enum": [
          "processing",
          "ready",
          "completed",
          "error",
          "cancelled"
        ],
        "type": "string",
        "description": "All observable status values for an agent builder session.\nSerialized as lowercase strings on the wire (processing, ready, completed, error, cancelled). (`0` = `Processing`; `1` = `Ready`; `2` = `Completed`; `3` = `Error`; `4` = `Cancelled`)"
      },
      "AgentContentFormat": {
        "enum": [
          "json",
          "yaml"
        ],
        "type": "string",
        "description": "Which shape an agent's content is exchanged in on the agent-content download endpoints\n(`GET {agentId}/content`, `GET {agentId}/version/{versionNumber}/content`). The\nupload endpoint (`POST {agentId}/content`) only ever accepts Sequentum.Enterprise.ControlCenter.AgentContentFormat.Json. (`0` = `Json`; `1` = `Yaml`)"
      },
      "AgentContentModel": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "integer",
            "description": "The ID of the agent this content belongs to.",
            "format": "int32"
          },
          "version": {
            "type": "integer",
            "description": "The version number of this content, matching the requested version, or the agent's latest version if none was requested.",
            "format": "int32"
          },
          "validationStatus": {
            "$ref": "#/components/schemas/ConfigValidationStatus"
          },
          "content": {
            "description": "The agent's content. A JSON object holding the canonical config when `format=json` (the\ndefault), or a plain-text NestedText string when `format=yaml` - see the `format` query\nparameter on this endpoint.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An agent's content, returned by the agent-content download endpoints - either the latest\nversion or a specific historical one."
      },
      "AgentCostBreakdownApiModel": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "integer",
            "description": "Agent ID",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "description": "Agent name",
            "nullable": true
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Date labels for the chart (e.g., \"2024-01-01\", \"2024-01-02\")",
            "nullable": true
          },
          "usageTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageTypeDataApiModel"
            },
            "description": "Usage data grouped by type",
            "nullable": true
          },
          "totalCost": {
            "type": "number",
            "description": "Total cost across all usage types",
            "format": "double"
          },
          "startDate": {
            "type": "string",
            "description": "Start date of the range",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Cost breakdown for a specific agent over time"
      },
      "AgentCountApiModel": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "integer",
            "description": "Number of agents matching the request",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Agent count for a space or for the personal space"
      },
      "AgentInputParameterApiModel": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The parameter name to use when starting a run via the inputParameters field.",
            "nullable": true
          },
          "defaultValue": {
            "type": "string",
            "description": "The default value for this parameter, or null if the parameter is encrypted.\nEncrypted parameter values are never exposed through the API.",
            "nullable": true
          },
          "isEncrypted": {
            "type": "boolean",
            "description": "True if this parameter is stored encrypted at rest.\nWhen starting a run, callers can send plain text values for encrypted parameters\nand the server will encrypt them automatically."
          }
        },
        "additionalProperties": false,
        "description": "Describes an input parameter that an agent expects when starting a run."
      },
      "AgentRunApiModel": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string",
            "description": "Optional, case-sensitive Tag used to compare Runs of the same Agent. Surrounding whitespace is trimmed; blank means untagged.",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "configId": {
            "type": "integer",
            "format": "int64"
          },
          "configName": {
            "type": "string",
            "nullable": true
          },
          "spaceId": {
            "type": "integer",
            "format": "int32"
          },
          "organizationId": {
            "type": "integer",
            "format": "int32"
          },
          "organizationName": {
            "type": "string",
            "nullable": true
          },
          "sequence": {
            "type": "integer",
            "format": "int64"
          },
          "parallelism": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parallelMaxConcurrency": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parallelExport": {
            "$ref": "#/components/schemas/ParallelExport"
          },
          "parallelSet": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "configVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "actionCount": {
            "type": "integer",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          },
          "dynamicPageCount": {
            "type": "integer",
            "format": "int32"
          },
          "requestCount": {
            "type": "integer",
            "format": "int32"
          },
          "dataCount": {
            "type": "integer",
            "format": "int32"
          },
          "inputCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorCount": {
            "type": "integer",
            "format": "int32"
          },
          "exportCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "traffic": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "runTimeSec": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "serverName": {
            "type": "string",
            "nullable": true
          },
          "tableType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AgentRunCostApiModel": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "integer",
            "description": "Run ID",
            "format": "int64"
          },
          "date": {
            "type": "string",
            "description": "Date of the run",
            "format": "date-time"
          },
          "startTime": {
            "type": "string",
            "description": "Start time of the run",
            "format": "date-time",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "description": "End time of the run",
            "format": "date-time",
            "nullable": true
          },
          "cost": {
            "type": "number",
            "description": "Cost for this run",
            "format": "double"
          },
          "billingType": {
            "type": "string",
            "description": "Billing type (e.g., \"Server Time\", \"Export GB\")",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Individual agent run with cost (for billing purposes)"
      },
      "AgentRunFileApiModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "regionId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "fileType": {
            "$ref": "#/components/schemas/RunFileType"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentRunResultApiModel": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "integer",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "success": {
            "type": "boolean"
          },
          "runId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Individual agent run result"
      },
      "AgentRunStatusCountApiModel": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "The RunStatus value",
            "format": "int32"
          },
          "statusName": {
            "type": "string",
            "description": "The RunStatus name, for example Completed, Failed or Stopped",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "description": "Number of runs with this status",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Number of runs that ended in one particular status"
      },
      "AgentRunSummaryApiModel": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "integer",
            "description": "Total number of runs for the agent, across current runs and run history",
            "format": "int32"
          },
          "statusCounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunStatusCountApiModel"
            },
            "description": "Run counts broken down by run status",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Aggregate run counts for an agent"
      },
      "AgentRunsApiResponse": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunCostApiModel"
            },
            "description": "List of runs with their costs",
            "nullable": true
          },
          "totalRecordCount": {
            "type": "integer",
            "description": "Total number of runs matching the filter",
            "format": "int32"
          },
          "totalCost": {
            "type": "number",
            "description": "Total cost across the runs in the current page.\nNote: this is a page-level sum, not a grand total across all pages.",
            "format": "double"
          },
          "agentId": {
            "type": "integer",
            "description": "Agent ID",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "description": "Agent name",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Paginated response for agent runs"
      },
      "AgentScheduleApiModel": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string",
            "description": "Optional, case-sensitive Tag used to compare Runs of the same Agent. Surrounding whitespace is trimmed; blank means untagged.",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "configId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "schedule": {
            "type": "string",
            "nullable": true
          },
          "localSchedule": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "nextRunTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "scheduleType": {
            "$ref": "#/components/schemas/ScheduleType"
          },
          "isEnabled": {
            "type": "boolean"
          },
          "runEveryCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "runEveryPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "inputParameters": {
            "type": "string",
            "nullable": true
          },
          "parallelism": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parallelMaxConcurrency": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parallelExport": {
            "$ref": "#/components/schemas/ParallelExport"
          },
          "proxyPoolId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "serverGroupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "logMode": {
            "$ref": "#/components/schemas/LogMode"
          },
          "isExclusive": {
            "type": "boolean"
          },
          "isWaitOnFailure": {
            "type": "boolean"
          },
          "startedBy": {
            "type": "string",
            "description": "The user who created or last updated the Schedule.",
            "nullable": true
          },
          "serverId": {
            "type": "integer",
            "description": "ID of the Server this Schedule is pinned to run on, if any. Always `null` today -\nSchedules cannot currently be pinned to a specific Server.",
            "format": "int32",
            "nullable": true
          },
          "httpVersion": {
            "$ref": "#/components/schemas/HttpVersion"
          },
          "saveContentCache": {
            "type": "boolean",
            "description": "Whether the Schedule's Runs save a content cache."
          },
          "configName": {
            "type": "string",
            "description": "Name of the Agent this Schedule belongs to.",
            "nullable": true
          },
          "created": {
            "type": "string",
            "description": "Date and time the Schedule was created. `null` for Schedules created before this field was tracked.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents a scheduled task for an agent in the External API"
      },
      "AgentUsageApiModel": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "integer",
            "description": "Agent ID",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "description": "Agent name",
            "nullable": true
          },
          "cost": {
            "type": "number",
            "description": "Total cost for the agent in the date range",
            "format": "double"
          },
          "spaceId": {
            "type": "integer",
            "description": "Space ID the agent belongs to (null for personal space)",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Individual agent usage summary"
      },
      "AgentVersionModel": {
        "type": "object",
        "properties": {
          "userName": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "comments": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "AgentsUsageApiResponse": {
        "type": "object",
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentUsageApiModel"
            },
            "description": "List of agents with their costs",
            "nullable": true
          },
          "totalRecordCount": {
            "type": "integer",
            "description": "Total number of agents matching the filter",
            "format": "int32"
          },
          "totalCost": {
            "type": "number",
            "description": "Total cost across all agents in the date range",
            "format": "double"
          },
          "startDate": {
            "type": "string",
            "description": "Start date of the range",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Paginated response for agent usage list"
      },
      "ApprovalStatus": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "description": "`0` = `NotApproved`; `1` = `PendingApproval`; `2` = `Approved`",
        "format": "int32"
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CatalogColumn": {
        "type": "object",
        "properties": {
          "isFileReference": {
            "type": "boolean"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "sourceName": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "$ref": "#/components/schemas/ContentType"
          },
          "isEncrypted": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CatalogConnectionSettings": {
        "type": "object",
        "properties": {
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogTableMapping"
            },
            "nullable": true
          },
          "stagingRetentionDays": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CatalogNewDataset": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "categoryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CatalogSchema": {
        "type": "object",
        "properties": {
          "systemColumnsVersion": {
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "hasCollectionTable": {
            "type": "boolean",
            "default": false
          },
          "hasFileTable": {
            "type": "boolean"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogTable"
            },
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CatalogTable": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "parentTableId": {
            "type": "string",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean"
          },
          "hasParentId": {
            "type": "boolean"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogColumn"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CatalogTableMapping": {
        "type": "object",
        "properties": {
          "sourceTableId": {
            "type": "string",
            "nullable": true
          },
          "targetTable": {
            "type": "string",
            "nullable": true
          },
          "columns": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Destination column to source column, with service-owned provenance excluded.",
            "nullable": true
          },
          "selectSql": {
            "type": "string",
            "description": "Optional SELECT override using the service-provided source relation named source.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CatalogUploadFileResponse": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "integer",
            "format": "int64"
          },
          "table": {
            "type": "string",
            "nullable": true
          },
          "kind": {
            "type": "string",
            "nullable": true
          },
          "uploadUrl": {
            "type": "string",
            "nullable": true
          },
          "uploaded": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "An expected upload destination; storage paths remain server-owned."
      },
      "CatalogUploadRequest": {
        "type": "object",
        "properties": {
          "datasetId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "newDataset": {
            "$ref": "#/components/schemas/CatalogNewDataset"
          },
          "sourceId": {
            "type": "string",
            "nullable": true
          },
          "sourceName": {
            "type": "string",
            "nullable": true
          },
          "sequence": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "extractedTime": {
            "type": "string",
            "nullable": true
          },
          "parallelSet": {
            "type": "integer",
            "format": "int32"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogUploadTable"
            },
            "nullable": true
          },
          "attachments": {
            "type": "boolean"
          },
          "allowSchemaUpdates": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Registers a delivery of Parquet tables and an optional ZIP of downloaded files."
      },
      "CatalogUploadResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "integer",
            "format": "int64"
          },
          "datasetId": {
            "type": "integer",
            "format": "int32"
          },
          "sourceId": {
            "type": "string",
            "nullable": true
          },
          "sequence": {
            "type": "integer",
            "format": "int64"
          },
          "parallelSet": {
            "type": "integer",
            "format": "int32"
          },
          "extractedTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "categoryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "nullable": true
          },
          "deadline": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogUploadFileResponse"
            },
            "nullable": true
          },
          "uploadToken": {
            "type": "string",
            "nullable": true
          },
          "step": {
            "type": "integer",
            "format": "int32"
          },
          "totalSteps": {
            "type": "integer",
            "format": "int32"
          },
          "previewSchema": {
            "$ref": "#/components/schemas/CatalogSchema"
          },
          "previewMappings": {
            "$ref": "#/components/schemas/CatalogConnectionSettings"
          },
          "previewPending": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CatalogUploadTable": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "targetTable": {
            "type": "string",
            "nullable": true
          },
          "format": {
            "type": "string",
            "nullable": true
          },
          "columns": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "idColumn": {
            "type": "string",
            "nullable": true
          },
          "parentIdColumn": {
            "type": "string",
            "nullable": true
          },
          "parentTable": {
            "type": "string",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean",
            "nullable": true
          },
          "fileColumns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Describes a source table; column mappings map destination names to source names."
      },
      "ConfigScope": {
        "enum": [
          "Private",
          "Public",
          "Global"
        ],
        "type": "string",
        "description": "`1` = `Private`; `2` = `Public`; `3` = `Global`"
      },
      "ConfigType": {
        "enum": [
          1,
          2,
          3,
          4
        ],
        "type": "integer",
        "description": "`1` = `Agent`; `2` = `SharedFile`; `3` = `Template`; `4` = `Command`",
        "format": "int32"
      },
      "ConfigValidationError": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConfigValidationStatus": {
        "enum": [
          1,
          2,
          3
        ],
        "type": "integer",
        "description": "Semantic validation status of a config's most recently saved definition (e.g. whether every\nfixed export schema column is actually produced by a command). Serialized as its underlying\nint, not a string - see Sequentum.Enterprise.ControlCenter.Swagger.EnumDescriptionsSchemaFilter\nfor how these values get documented in the public OpenAPI spec. (`1` = `Unknown` - Validation status was not computed for this response (e.g. a historical config version, which does not retain its own stored status); `2` = `Invalid` - The config has one or more semantic validation errors (e.g. a required export column with no producing command); `3` = `Valid` - The config has no semantic validation errors)",
        "format": "int32"
      },
      "ConflictError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContentType": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11
        ],
        "type": "integer",
        "description": "`0` = `Text`; `1` = `LongText`; `2` = `File`; `3` = `Integer`; `4` = `BigInteger`; `5` = `Float`; `6` = `Decimal`; `7` = `Date`; `8` = `Time`; `9` = `DateAndTime`; `10` = `Boolean`; `11` = `Guid`",
        "format": "int32"
      },
      "CreateScheduleApiRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the schedule (required)",
            "nullable": true
          },
          "cronExpression": {
            "type": "string",
            "description": "Cron expression for the schedule (e.g., \"0 9 * * 1,4\" for Mon/Thu at 9am)",
            "nullable": true
          },
          "localSchedule": {
            "type": "string",
            "description": "Local schedule expression (human readable)",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone for the schedule (e.g., \"America/New_York\"). An unrecognized timezone returns 400 Bad Request.",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "description": "Start date/time for the schedule in UTC.\n- Required for RunOnce schedules (must be at least 1 minute in the future).\n- Required for RunEvery schedules. Anchors the recurrence: the first run happens at this time and every later run is computed from it. Must be in the future when creating a schedule, or when changing the anchor of an existing one.\n- Not used for CRON schedules.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-01-20T14:30:00Z"
          },
          "inputParameters": {
            "type": "string",
            "description": "JSON string of input parameters for scheduled runs",
            "nullable": true
          },
          "tag": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Optional, case-sensitive Tag used to compare Runs of the same Agent. Surrounding whitespace is trimmed; blank means untagged.",
            "nullable": true
          },
          "scheduleType": {
            "$ref": "#/components/schemas/ScheduleType"
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the schedule is enabled"
          },
          "runEveryCount": {
            "type": "integer",
            "description": "Run every N periods (used with RunEveryPeriod)",
            "format": "int32",
            "nullable": true
          },
          "runEveryPeriod": {
            "type": "integer",
            "description": "Period unit for RunEveryCount (1=minutes, 2=hours, 3=days, 4=weeks, 5=months)",
            "format": "int32",
            "nullable": true
          },
          "parallelism": {
            "type": "integer",
            "description": "Parallelism level for the scheduled run",
            "format": "int32",
            "nullable": true
          },
          "parallelMaxConcurrency": {
            "type": "integer",
            "description": "Max concurrency for parallel runs",
            "format": "int32",
            "nullable": true
          },
          "parallelExport": {
            "$ref": "#/components/schemas/ParallelExport"
          },
          "proxyPoolId": {
            "type": "integer",
            "description": "Proxy pool ID to use for scheduled runs",
            "format": "int32",
            "nullable": true
          },
          "serverGroupId": {
            "type": "integer",
            "description": "Server group ID for scheduled runs (optional).\nWhen specified, the schedule will run on servers in this group.",
            "format": "int32",
            "nullable": true
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "logMode": {
            "$ref": "#/components/schemas/LogMode"
          },
          "isExclusive": {
            "type": "boolean",
            "description": "Whether to run exclusively (no concurrent runs)"
          },
          "isWaitOnFailure": {
            "type": "boolean",
            "description": "Whether to wait on failure before retrying"
          }
        },
        "additionalProperties": false,
        "description": "Request model for creating a new schedule"
      },
      "CreditHistoryApiModel": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditTransactionApiModel"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "pageIndex": {
            "type": "integer",
            "format": "int32"
          },
          "recordsPerPage": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Response model for credit history"
      },
      "CreditTransactionApiModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "transactionType": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "balance": {
            "type": "number",
            "format": "double"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Individual credit transaction record"
      },
      "CreditsBalanceApiModel": {
        "type": "object",
        "properties": {
          "availableCredits": {
            "type": "number",
            "description": "Current available credits balance",
            "format": "double"
          },
          "organizationId": {
            "type": "integer",
            "description": "Organization ID",
            "format": "int32"
          },
          "retrievedAt": {
            "type": "string",
            "description": "Timestamp when the balance was retrieved",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Response model for credits balance"
      },
      "ErrorSeverity": {
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "type": "integer",
        "description": "`0` = `Error`; `1` = `Unexpected`; `2` = `Fatal`; `3` = `Warning`; `4` = `Info`",
        "format": "int32"
      },
      "ExternalSessionStatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/AgentBuilderSessionStatus"
          },
          "agentId": {
            "type": "integer",
            "description": "ID of the agent draft. Populated once the agent draft has been created in your workspace.\nAlways present when `status` is `\"completed\"` or `\"ready\"`.",
            "format": "int32",
            "nullable": true
          },
          "agentName": {
            "type": "string",
            "description": "Name of the agent draft. Populated alongside `agentId`.\nAlways present when `status` is `\"completed\"` or `\"ready\"`.",
            "nullable": true
          },
          "error": {
            "type": "string",
            "description": "Error message when status is \"error\".",
            "nullable": true
          },
          "agentElapsedSeconds": {
            "type": "number",
            "description": "Seconds of agent time used so far, excluding time spent waiting on browser I/O.",
            "format": "double",
            "nullable": true
          },
          "browserIoSeconds": {
            "type": "number",
            "description": "Seconds spent waiting on browser I/O, the complement of agentElapsedSeconds.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Session status response for the external API."
      },
      "ExternalStartAgentBuildRequest": {
        "required": [
          "prompt"
        ],
        "type": "object",
        "properties": {
          "prompt": {
            "maxLength": 5000,
            "minLength": 10,
            "type": "string",
            "description": "Natural language prompt describing the automation to build.\nMust be between 10 and 5000 characters (trimmed).",
            "x-minTrimmedLength": 10
          },
          "spaceId": {
            "type": "integer",
            "description": "Optional space ID to save the agent to. Uses the default space if omitted.",
            "format": "int32",
            "nullable": true
          },
          "disableSiteCache": {
            "type": "boolean",
            "description": "Internal testing control. Builds without the site cache so a run measures the harness\nrather than a scaffold remembered from an earlier session. Requires an administrator;\nignored otherwise. Defaults to `false`."
          }
        },
        "additionalProperties": false,
        "description": "Request to start an agent building session via the external API."
      },
      "ExternalStartAgentBuildResponse": {
        "required": [
          "sessionId"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "minLength": 1,
            "type": "string",
            "description": "Session ID to use for status polling and subsequent calls."
          }
        },
        "additionalProperties": false,
        "description": "Response when starting an agent build session via the external API."
      },
      "FailedRunSummaryApiModel": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "integer",
            "format": "int64"
          },
          "agentId": {
            "type": "integer",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "spaceId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "spaceName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Summary of a failed run"
      },
      "HttpVersion": {
        "enum": [
          "Default",
          "Http10",
          "Http11",
          "Http20"
        ],
        "type": "string",
        "description": "`0` = `Default`; `1` = `Http10`; `2` = `Http11`; `3` = `Http20`"
      },
      "InputFileUploadResult": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadedInputFileModel"
            },
            "description": "The files that were stored, in the order they were processed.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Result of uploading input files. Contains one entry per stored file - an agent export zip\nproduces one entry per file extracted from it."
      },
      "InternalServerError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LogLevel": {
        "enum": [
          "Fatal",
          "Error",
          "Warning",
          "Info"
        ],
        "type": "string",
        "description": "`0` = `Fatal`; `1` = `Error`; `2` = `Warning`; `3` = `Info`"
      },
      "LogMode": {
        "enum": [
          "Text",
          "TextAndHtml"
        ],
        "type": "string",
        "description": "`0` = `Text`; `1` = `TextAndHtml`"
      },
      "ParallelExport": {
        "enum": [
          "Combined",
          "Separated"
        ],
        "type": "string",
        "description": "`0` = `Combined`; `1` = `Separated`"
      },
      "PaymentRequiredError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "HTTP 402. Returned when the request is well-formed and authorized but the organization\ncannot pay for the work - e.g. it has no available credits. Set\nSequentum.Enterprise.Core.ControllerError.ErrorCode so clients can branch without parsing the message."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "RecordsSummaryApiModel": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "description": "Start date of the range",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range",
            "format": "date-time"
          },
          "totalRecordsExtracted": {
            "type": "integer",
            "description": "Total records extracted across all runs",
            "format": "int64"
          },
          "totalRecordsExported": {
            "type": "integer",
            "description": "Total records exported across all runs",
            "format": "int64"
          },
          "totalErrors": {
            "type": "integer",
            "description": "Total errors across all runs",
            "format": "int64"
          },
          "totalPageLoads": {
            "type": "integer",
            "description": "Total page loads across all runs",
            "format": "int64"
          },
          "runCount": {
            "type": "integer",
            "description": "Number of runs included in this summary",
            "format": "int32"
          },
          "agentId": {
            "type": "integer",
            "description": "Optional agent ID filter",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for records summary"
      },
      "RemoveRunMethod": {
        "enum": [
          "RemoveAllFiles",
          "RemoveAllFilesAndAgentInput",
          "RemoveEntireRun"
        ],
        "type": "string",
        "description": "`0` = `RemoveAllFiles`; `1` = `RemoveAllFilesAndAgentInput`; `2` = `RemoveEntireRun`"
      },
      "RunDiagnosticsApiModel": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "integer",
            "format": "int64"
          },
          "agentId": {
            "type": "integer",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "runtimeSeconds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "stats": {
            "$ref": "#/components/schemas/RunStatsApiModel"
          },
          "possibleCauses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Possible failure reasons based on status and error message",
            "nullable": true
          },
          "suggestedActions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Suggested actions to resolve the issue",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for run diagnostics (why a run failed)"
      },
      "RunFileType": {
        "enum": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8
        ],
        "type": "integer",
        "description": "`1` = `DeliveredFile`; `2` = `ExtractedFiles`; `3` = `InternalExportFiles`; `4` = `InternalRuntimeFiles`; `5` = `InternalTrackingDb`; `6` = `LogText`; `7` = `LogHtml`; `8` = `InternalContentCache`",
        "format": "int32"
      },
      "RunSpaceAgentsRequest": {
        "type": "object",
        "properties": {
          "tag": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Optional, case-sensitive Tag for success-criteria comparisons within each Agent. Surrounding whitespace is trimmed; blank means untagged.",
            "nullable": true
          },
          "inputParameters": {
            "type": "string",
            "description": "Optional JSON string of input parameters to pass to all agents",
            "nullable": true
          },
          "parallelism": {
            "type": "integer",
            "description": "Parallelism level for each agent run (default: 1)",
            "format": "int32",
            "nullable": true
          },
          "isExclusive": {
            "type": "boolean",
            "description": "Whether to run exclusively"
          },
          "proxyPoolId": {
            "type": "integer",
            "description": "Optional proxy pool ID to route agent traffic through. Values of 0 or less are treated as unset.",
            "format": "int32",
            "nullable": true
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "logMode": {
            "$ref": "#/components/schemas/LogMode"
          }
        },
        "additionalProperties": false,
        "description": "Request model for running all agents in a space"
      },
      "RunSpaceAgentsResultApiModel": {
        "type": "object",
        "properties": {
          "spaceId": {
            "type": "integer",
            "format": "int32"
          },
          "spaceName": {
            "type": "string",
            "nullable": true
          },
          "totalAgents": {
            "type": "integer",
            "format": "int32"
          },
          "agentsStarted": {
            "type": "integer",
            "format": "int32"
          },
          "agentsFailed": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunResultApiModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Result of running all agents in a space"
      },
      "RunStatsApiModel": {
        "type": "object",
        "properties": {
          "dataCount": {
            "type": "integer",
            "format": "int32"
          },
          "inputCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorCount": {
            "type": "integer",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          },
          "exportCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "traffic": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Run statistics"
      },
      "RunStatus": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13
        ],
        "type": "integer",
        "description": "`0` = `Invalid`; `1` = `Running`; `2` = `Exporting`; `3` = `Starting`; `4` = `Queuing`; `5` = `Stopping`; `6` = `Failure`; `7` = `Failed`; `8` = `Stopped`; `9` = `Completed`; `10` = `Success`; `11` = `Skipped`; `12` = `Waiting`; `13` = `UpdatingDataSet`",
        "format": "int32"
      },
      "RunsSummaryApiModel": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "description": "Start date of the range",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range",
            "format": "date-time"
          },
          "totalRuns": {
            "type": "integer",
            "description": "Total number of runs in the date range",
            "format": "int32"
          },
          "completedRuns": {
            "type": "integer",
            "description": "Number of completed runs",
            "format": "int32"
          },
          "failedRuns": {
            "type": "integer",
            "description": "Number of failed runs",
            "format": "int32"
          },
          "completedWithErrorsRuns": {
            "type": "integer",
            "description": "Number of runs completed with errors",
            "format": "int32"
          },
          "runningRuns": {
            "type": "integer",
            "description": "Number of currently running runs",
            "format": "int32"
          },
          "queuedRuns": {
            "type": "integer",
            "description": "Number of queued runs",
            "format": "int32"
          },
          "stoppedRuns": {
            "type": "integer",
            "description": "Number of stopped runs",
            "format": "int32"
          },
          "failedRunDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FailedRunSummaryApiModel"
            },
            "description": "Details of failed runs (if requested)",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for runs summary"
      },
      "ScheduleType": {
        "enum": [
          0,
          1,
          2,
          3
        ],
        "type": "integer",
        "description": "`0` = `None`; `1` = `RunOnce`; `2` = `RunEvery`; `3` = `CRON`",
        "format": "int32"
      },
      "ServiceUnavailableError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SpaceAgentApiModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "configType": {
            "$ref": "#/components/schemas/ConfigType"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "validationStatus": {
            "$ref": "#/components/schemas/ConfigValidationStatus"
          },
          "lastActivity": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "isArchived": {
            "type": "boolean"
          },
          "approvalStatus": {
            "$ref": "#/components/schemas/ApprovalStatus"
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpaceAgentLabelApiModel"
            },
            "description": "The Agent's labels, empty when it has none.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Agent summary for space listing"
      },
      "SpaceAgentLabelApiModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A single label attached to a Space Agent"
      },
      "SpaceApiModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "organizationId": {
            "type": "integer",
            "format": "int32"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "isDefaultAccess": {
            "type": "boolean"
          },
          "scope": {
            "$ref": "#/components/schemas/ConfigScope"
          },
          "runRetentionHours": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "initiatedBy": {
            "type": "string",
            "nullable": true
          },
          "access": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for a space in the External API"
      },
      "SpendingSummaryApiModel": {
        "type": "object",
        "properties": {
          "totalSpent": {
            "type": "number",
            "description": "Total amount spent in the date range",
            "format": "double"
          },
          "startDate": {
            "type": "string",
            "description": "Start date of the range",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range",
            "format": "date-time"
          },
          "organizationId": {
            "type": "integer",
            "description": "Organization ID",
            "format": "int32"
          },
          "currentBalance": {
            "type": "number",
            "description": "Current available credits balance",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Response model for spending summary"
      },
      "StartAgentApiRequest": {
        "type": "object",
        "properties": {
          "tag": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Optional, case-sensitive Tag used to compare Runs of the same Agent. Surrounding whitespace is trimmed; blank means untagged.",
            "nullable": true
          },
          "parallelism": {
            "type": "integer",
            "format": "int32"
          },
          "parallelMaxConcurrency": {
            "type": "integer",
            "format": "int32"
          },
          "parallelExport": {
            "$ref": "#/components/schemas/ParallelExport"
          },
          "proxyPoolId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "inputParameters": {
            "type": "string",
            "nullable": true
          },
          "timeout": {
            "type": "integer",
            "format": "int32"
          },
          "isExclusive": {
            "type": "boolean"
          },
          "isWaitOnFailure": {
            "type": "boolean"
          },
          "isRunSynchronously": {
            "type": "boolean"
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "logMode": {
            "$ref": "#/components/schemas/LogMode"
          }
        },
        "additionalProperties": false
      },
      "StringContent": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TooManyRequestsError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UnprocessableEntityError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "statusDescription": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "severity": {
            "$ref": "#/components/schemas/ErrorSeverity"
          },
          "errorCode": {
            "type": "string",
            "description": "Optional machine-readable error code. When present, clients should switch on this\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. The controller pipeline serialises\nwith System.Text.Json, which ignores the Newtonsoft attribute below, so an unset code\nreaches the client as `\"errorCode\": null` rather than being omitted - clients\nmust treat null and absent alike.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpcomingScheduleApiModel": {
        "type": "object",
        "properties": {
          "scheduleId": {
            "type": "integer",
            "description": "ID of the Schedule.",
            "format": "int64"
          },
          "agentId": {
            "type": "integer",
            "description": "ID of the Agent this Schedule belongs to.",
            "format": "int32"
          },
          "agentName": {
            "type": "string",
            "description": "Name of the Agent this Schedule belongs to.",
            "nullable": true
          },
          "scheduleName": {
            "type": "string",
            "description": "Name of the Schedule.",
            "nullable": true
          },
          "schedule": {
            "type": "string",
            "description": "Cron expression the Schedule runs on.",
            "nullable": true
          },
          "scheduleType": {
            "$ref": "#/components/schemas/ScheduleType"
          },
          "runEveryCount": {
            "type": "integer",
            "description": "Run every N periods. Set only for a RunEvery Schedule.",
            "format": "int32",
            "nullable": true
          },
          "runEveryPeriod": {
            "type": "integer",
            "description": "Period unit for `runEveryCount` (1=minutes, 2=hours, 3=days, 4=weeks, 5=months). Set\nonly for a RunEvery Schedule.",
            "format": "int32",
            "nullable": true
          },
          "nextRunTime": {
            "type": "string",
            "description": "Next date and time the Schedule is due to run.",
            "format": "date-time",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "description": "Timezone the Schedule runs in.",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the Schedule is enabled. This endpoint only returns enabled Schedules, so it\nis always `true` here."
          },
          "spaceId": {
            "type": "integer",
            "description": "ID of the Space the Agent belongs to. `0` for an Agent in a personal Space (see\n`spaceName`).",
            "format": "int32"
          },
          "spaceName": {
            "type": "string",
            "description": "Name of the Space the Agent belongs to. For an Agent in a personal Space, this is\n`Personal Space of {user}`, where `{user}` is the user who created or last updated the\nSchedule.",
            "nullable": true
          },
          "approvalStatus": {
            "$ref": "#/components/schemas/ApprovalStatus"
          },
          "lastRunId": {
            "type": "integer",
            "description": "ID of the most recent Run started by this Schedule, if it has run before. A negative value means the\nRun is archived (in run history) rather than current.",
            "format": "int64",
            "nullable": true
          },
          "lastRunTime": {
            "type": "string",
            "description": "Start date and time of the most recent Run started by this Schedule, if it has run before.",
            "format": "date-time",
            "nullable": true
          },
          "lastRunStatus": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "lastRunMessage": {
            "type": "string",
            "description": "Status message of the most recent Run started by this Schedule, if it has run before.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for upcoming scheduled runs"
      },
      "UpdateScheduleApiRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the schedule (required)",
            "nullable": true
          },
          "cronExpression": {
            "type": "string",
            "description": "Cron expression for the schedule (e.g., \"0 9 * * 1,4\" for Mon/Thu at 9am)",
            "nullable": true
          },
          "localSchedule": {
            "type": "string",
            "description": "Local schedule expression (human readable)",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone for the schedule (e.g., \"America/New_York\"). An unrecognized timezone returns 400 Bad Request.",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "description": "Start date/time for the schedule in UTC.\n- Required for RunOnce schedules (must be at least 1 minute in the future).\n- Required for RunEvery schedules. Anchors the recurrence: the first run happens at this time and every later run is computed from it. Must be in the future when creating a schedule, or when changing the anchor of an existing one.\n- Not used for CRON schedules.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-01-20T14:30:00Z"
          },
          "inputParameters": {
            "type": "string",
            "description": "JSON string of input parameters for scheduled runs",
            "nullable": true
          },
          "tag": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Case-sensitive Tag for future Runs. Omit to keep the current Tag; send an empty string to clear it. Surrounding whitespace is trimmed. Existing Runs keep their original Tag.",
            "nullable": true
          },
          "scheduleType": {
            "$ref": "#/components/schemas/ScheduleType"
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the schedule is enabled"
          },
          "runEveryCount": {
            "type": "integer",
            "description": "Run every N periods (used with RunEveryPeriod)",
            "format": "int32",
            "nullable": true
          },
          "runEveryPeriod": {
            "type": "integer",
            "description": "Period unit for RunEveryCount (1=minutes, 2=hours, 3=days, 4=weeks, 5=months)",
            "format": "int32",
            "nullable": true
          },
          "parallelism": {
            "type": "integer",
            "description": "Parallelism level for the scheduled run",
            "format": "int32",
            "nullable": true
          },
          "parallelMaxConcurrency": {
            "type": "integer",
            "description": "Max concurrency for parallel runs",
            "format": "int32",
            "nullable": true
          },
          "parallelExport": {
            "$ref": "#/components/schemas/ParallelExport"
          },
          "proxyPoolId": {
            "type": "integer",
            "description": "Proxy pool ID to use for scheduled runs",
            "format": "int32",
            "nullable": true
          },
          "serverGroupId": {
            "type": "integer",
            "description": "Server group ID for scheduled runs (optional).\nWhen specified, the schedule will run on servers in this group.",
            "format": "int32",
            "nullable": true
          },
          "logLevel": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "logMode": {
            "$ref": "#/components/schemas/LogMode"
          },
          "isExclusive": {
            "type": "boolean",
            "description": "Whether to run exclusively (no concurrent runs)"
          },
          "isWaitOnFailure": {
            "type": "boolean",
            "description": "Whether to wait on failure before retrying"
          }
        },
        "additionalProperties": false,
        "description": "Request model for updating an existing schedule"
      },
      "UploadAgentContentRequest": {
        "required": [
          "comments"
        ],
        "type": "object",
        "properties": {
          "content": {
            "description": "The agent's full config as a JSON object - the same shape returned by the download endpoints'\ndefault `format=json` (not the plain-text NestedText produced by `format=yaml`). Must be a\nJSON object.",
            "example": {
              "Agent": {
                "Commands": [
                  {
                    "Type": "URL",
                    "Name": "URL",
                    "Input": {
                      "Static Value": "https://example.com"
                    }
                  }
                ],
                "Export": {
                  "Export Name": "My Agent"
                }
              }
            }
          },
          "comments": {
            "minLength": 1,
            "type": "string",
            "description": "A mandatory commit message describing the change, stored alongside the new version.",
            "example": "Point at the new start URL"
          },
          "expectedVersion": {
            "type": "integer",
            "description": "Optional optimistic-concurrency guard. When set, the upload is rejected with a conflict if the\nagent's current version does not match this value.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for uploading a new version of an agent's content."
      },
      "UploadAgentContentResult": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "integer",
            "description": "The ID of the agent this content belongs to.",
            "format": "int32"
          },
          "newVersion": {
            "type": "integer",
            "description": "The newly created version number.",
            "format": "int32"
          },
          "validationStatus": {
            "$ref": "#/components/schemas/ConfigValidationStatus"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigValidationError"
            },
            "description": "Semantic validation errors, if any. Non-empty only when `validationStatus` is `2` (`Invalid`) - these do not prevent the version from being created.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Result of uploading a new version of an agent's content. Semantic validation errors do\nnot prevent the version from being created - they are returned alongside it so the caller can decide\nwhether to fix them."
      },
      "UploadedInputFileModel": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The file name the Agent uses to read the file at Run time.",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "description": "The ID of the stored file. For a Space input file this is the shared file's ID, stable\nacross re-uploads of the same name. For an Agent input file it identifies the record just\nwritten, and changes every time the file is re-uploaded.",
            "format": "int32"
          },
          "version": {
            "type": "integer",
            "description": "The shared file's version number after the upload. Re-uploading the same name overwrites\nthe content in place, so this number does not increment. `null` for Agent input files,\nwhich are not versioned at all.",
            "format": "int32",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "description": "The stored size in bytes.",
            "format": "int64"
          },
          "expandedFrom": {
            "type": "string",
            "description": "The name of the export zip this file was extracted from, when it came from one.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One stored input file."
      },
      "UsageTypeDataApiModel": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Usage type name (e.g., \"Server Time\", \"Export GB\", \"Agent Inputs\", \"Proxy Data\", \"Export CPM\")",
            "nullable": true
          },
          "data": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            },
            "description": "Cost data points corresponding to the date labels",
            "nullable": true
          },
          "totalCost": {
            "type": "number",
            "description": "Total cost for this usage type",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Usage data for a specific usage type (e.g., Server Time, Export GB)"
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API Key authorization header. Example: \"Authorization: ApiKey {your-api-key}\"",
        "name": "Authorization",
        "in": "header"
      },
      "Bearer": {
        "type": "http",
        "description": "OAuth 2.0 Bearer token. Example: \"Authorization: Bearer {access-token}\"",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ],
      "Bearer": [ ]
    }
  ]
}