{
  "openapi": "3.1.0",
  "info": {
    "title": "Gradient Works API",
    "description": "Programmatic access to Gradient Works market maps and account data.",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v1/crm-connections": {
      "get": {
        "tags": [
          "CRM Connections"
        ],
        "summary": "List CRM connections.",
        "description": "Return the CRM connections in the account linked to the API key that the\nkey may see. Results are sorted by creation date, newest first.",
        "operationId": "webapi_crm_connections_list_crm_connections_get",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Filter by CRM type: SALESFORCE or HUBSPOT",
            "required": false,
            "schema": {
              "title": "Type",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by CRM type: SALESFORCE or HUBSPOT"
            }
          },
          {
            "name": "crm_environment",
            "in": "query",
            "description": "Filter by environment: PRODUCTION or SANDBOX",
            "required": false,
            "schema": {
              "title": "Crm Environment",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by environment: PRODUCTION or SANDBOX"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status: ACTIVE, INACTIVE, or ALL (default: ACTIVE)",
            "required": false,
            "schema": {
              "title": "Status",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: ACTIVE, INACTIVE, or ALL (default: ACTIVE)",
              "default": "ACTIVE"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Case-insensitive substring search on org name or instance URL",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Case-insensitive substring search on org name or instance URL"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CRMConnectionListResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_crm_connections"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/metadata": {
      "get": {
        "tags": [
          "CRM Connections"
        ],
        "summary": "List CRM object field metadata for a connection.",
        "description": "Return the field schema for the requested CRM object type: `account`\n(Salesforce) or `company` (HubSpot). If `type` is omitted it defaults to\nthe appropriate type for the connection. Fields with `updateable: true` can\nbe written to; non-updateable fields (e.g. Salesforce `Id`, HubSpot\n`hs_object_id`) are read-only.",
        "operationId": "webapi_crm_connections_list_crm_connection_metadata__crm_connection_id__metadata_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Object type to retrieve metadata for: `account` (Salesforce only) or `company` (HubSpot only). Defaults to `account` for Salesforce connections and `company` for HubSpot connections.",
            "required": false,
            "schema": {
              "title": "Type",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Object type to retrieve metadata for: `account` (Salesforce only) or `company` (HubSpot only). Defaults to `account` for Salesforce connections and `company` for HubSpot connections."
            }
          },
          {
            "name": "enumerate",
            "in": "query",
            "description": "When true, include allowed values for picklist (Salesforce) and enumeration (HubSpot) fields in the `options` array. Defaults to false.",
            "required": false,
            "schema": {
              "title": "Enumerate",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, include allowed values for picklist (Salesforce) and enumeration (HubSpot) fields in the `options` array. Defaults to false.",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CRMObjectFieldListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_crm_connection_metadata"
        }
      }
    },
    "/api/v1/assets": {
      "post": {
        "tags": [
          "Assets"
        ],
        "summary": "Upload a file directly.",
        "description": "Upload a CSV or Excel (xlsx/xls) file as multipart/form-data. Returns an\nasset:// URI. For Excel files, pass ``sheet_index`` (0-indexed, default 0)\nto select which sheet to convert to CSV.",
        "operationId": "webapi_assets_upload_asset_direct_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadAssetForm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "expose": false
        }
      }
    },
    "/api/v1/assets/upload-url": {
      "post": {
        "tags": [
          "Assets"
        ],
        "summary": "Get a pre-signed upload URL.",
        "description": "Returns a pre-signed S3 URL and an upload token. PUT the file bytes\ndirectly to the URL, then call complete_asset_upload with the token to\ncreate the data source.\n\nExample upload step:\n    curl -X PUT \"<upload_url>\" --upload-file \"/path/to/file.csv\"\n\nFor Excel files, pass sheet_index (0-based) to select which sheet to\nconvert to CSV.",
        "operationId": "webapi_assets_get_upload_url_upload_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUploadUrlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUploadUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "upload_asset"
        }
      }
    },
    "/api/v1/assets/complete": {
      "post": {
        "tags": [
          "Assets"
        ],
        "summary": "Complete a file upload.",
        "description": "Finalize an upload started with upload_asset. Reads the uploaded file\nfrom S3, processes it, and creates a data source record. Returns an\nasset:// URI.",
        "operationId": "webapi_assets_complete_upload_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "complete_asset_upload"
        }
      }
    },
    "/api/v1/market-maps": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "List market maps.",
        "description": "Return market maps owned by the account linked to the API key.\nBy default only ACTIVE market maps are returned; pass `?status=all`\nto include inactive ones.",
        "operationId": "webapi_market_maps_list_market_maps_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status: 'active' (default) or 'all'.",
            "required": false,
            "schema": {
              "title": "Status",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: 'active' (default) or 'all'."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketMapListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_market_maps"
        }
      },
      "post": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Create a market map.",
        "description": "Accept configuration JSON and start an asynchronous market map creation.\nReturns the new market map ID with PENDING status. Poll run status via the\nruns endpoints.\n\nCredit/subscription validation happens server-side before accepting the request.",
        "operationId": "webapi_market_maps_create_market_map_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketMapBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateMarketMapResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_market_map"
        }
      }
    },
    "/api/v1/market-maps/{id}": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get a market map.",
        "description": "Retrieve a single market map by its ID, including the latest run\nstatus and statistics from the latest completed run.",
        "operationId": "webapi_market_maps_get_market_map__id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketMapDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "List runs for a market map.",
        "description": "Return all runs for a market map, ordered by most recent first.",
        "operationId": "webapi_market_maps_list_runs__id__runs_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_market_map_runs"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs/current": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get the latest run.",
        "description": "Return the most recent run for a market map.\nReturns 404 if no runs exist yet.",
        "operationId": "webapi_market_maps_get_current_run__id__runs_current_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_current_market_map_run"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs/{run_id}": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get a single run.",
        "description": "Retrieve a run by its ID. Returns 404 if the run does not belong to\nthis market map.",
        "operationId": "webapi_market_maps_get_run__id__runs__run_id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "UUID of the run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "UUID of the run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_run"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs/{run_id}/progress": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Poll run progress.",
        "description": "Return real-time progress for a run. For PENDING or PROCESSING runs,\nproxies to the Krang MK4 progress API. For terminal states, returns\na synthetic progress response.",
        "operationId": "webapi_market_maps_get_run_progress__id__runs__run_id__progress_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "UUID of the run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "UUID of the run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunProgressResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_run_progress"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs/{run_id}/results": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get run results.",
        "description": "Return the output artifacts of a completed run, including a pre-signed\nS3 download URL for the result file. Returns 409 if the run has not\ncompleted yet.",
        "operationId": "webapi_market_maps_get_run_results__id__runs__run_id__results_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "UUID of the run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "UUID of the run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResultsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_run_results"
        }
      }
    },
    "/api/v1/market-maps/{id}/runs/{run_id}/cancel": {
      "post": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Cancel a run.",
        "description": "Cancel a run that is PENDING or PROCESSING. Returns 409 if the run is\nalready in a terminal state (COMPLETE, FAILED, or CANCELED).",
        "operationId": "webapi_market_maps_cancel_run__id__runs__run_id__cancel_post",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "UUID of the run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "UUID of the run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunCancelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "cancel_market_map_run"
        }
      }
    },
    "/api/v1/market-maps/{id}/accounts": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "List all accounts in a market map.",
        "description": "Return every account with name, website, cluster assignment, score, and tier.\nCluster names are resolved from the map's cluster metadata.",
        "operationId": "webapi_market_maps_list_accounts__id__accounts_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_market_map_accounts"
        }
      },
      "post": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Add accounts to an existing market map.",
        "description": "Accepts a source and field mappings. Identifies accounts from the source\nthat are not already in the market map and adds them in a new run.\nOnly 'csv' sources (asset:// URIs) are currently supported.",
        "operationId": "webapi_market_maps_post_accounts__id__accounts_post",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAccountsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAccountsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "add_accounts_to_market_map"
        }
      }
    },
    "/api/v1/market-maps/{id}/summary": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get market map summary metrics.",
        "description": "Return top-level metrics for a market map: analyzed accounts, mapped accounts,\nreference accounts, total clusters, clustered accounts, tier 1 accounts,\nand a breakdown of accounts by tier.",
        "operationId": "webapi_market_maps_get_market_map_summary__id__summary_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketMapSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_summary"
        }
      }
    },
    "/api/v1/market-maps/{id}/clusters": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "List clusters in a market map.",
        "description": "Return every cluster with its name, summary, and account count.",
        "operationId": "webapi_market_maps_list_clusters__id__clusters_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClusterListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_market_map_clusters"
        }
      }
    },
    "/api/v1/market-maps/{id}/clusters/{cluster_id}": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get cluster detail.",
        "description": "Return a single cluster's metadata and all its accounts.",
        "operationId": "webapi_market_maps_get_cluster__id__clusters__int_cluster_id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "cluster_id",
            "in": "path",
            "description": "Cluster ID",
            "required": true,
            "schema": {
              "title": "Cluster Id",
              "type": "integer",
              "description": "Cluster ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClusterDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_cluster"
        }
      }
    },
    "/api/v1/market-maps/{id}/export": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Export market map as CSV.",
        "description": "Build a CSV of all accounts in the market map, upload it to S3, and return\na pre-signed download URL. Prospect accounts are limited to 100 rows.",
        "operationId": "webapi_market_maps_export_market_map__id__export_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResultsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "export_market_map_csv"
        }
      }
    },
    "/api/v1/market-maps/{id}/accounts/{account_id}": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get full account detail.",
        "description": "Returns summary, cluster name, score, tier, and custom attributes for a\nsingle account. Unlike the deprecated /market-maps/<id>/account/<aid>\nendpoint, this includes cluster_name and a structured attributes dict\ninstead of dynamic top-level export_field keys.",
        "operationId": "webapi_market_maps_get_account_detail__id__accounts__account_id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "account_id",
            "in": "path",
            "description": "Account identifier",
            "required": true,
            "schema": {
              "title": "Account Id",
              "type": "string",
              "description": "Account identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_account"
        }
      }
    },
    "/api/v1/market-maps/{id}/accounts/{account_id}/similar": {
      "get": {
        "tags": [
          "Market Maps"
        ],
        "summary": "Get similar reference accounts.",
        "description": "Returns reference (target) accounts nearest to the given account by map\ndistance. Only available for accounts in Tier 1 or Tier 2. Returns 422\nif the account is in Tier 3+ or unscored.",
        "operationId": "webapi_market_maps_get_similar_accounts_detail__id__accounts__account_id__similar_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "UUID of the market map",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string",
              "description": "UUID of the market map"
            }
          },
          {
            "name": "account_id",
            "in": "path",
            "description": "Account identifier",
            "required": true,
            "schema": {
              "title": "Account Id",
              "type": "string",
              "description": "Account identifier"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max similar accounts to return (default 5)",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Max similar accounts to return (default 5)",
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarAccountDetailListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_market_map_similar_accounts"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/target-books": {
      "get": {
        "tags": [
          "Target Books"
        ],
        "summary": "List target books.",
        "description": "Return target books for the given Salesforce CRM connection.\nSupports status filtering, full-text search by name or rep, sorting, and cursor-based pagination.\nDefault page size is 50. Pass next_records_url from one response into the next request to\npaginate through large result sets.",
        "operationId": "webapi_target_books_list_target_books__crm_connection_id__target_books_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status: Active, Deleted, or All (default: Active)",
            "required": false,
            "schema": {
              "title": "Status",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: Active, Deleted, or All (default: Active)",
              "default": "Active"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by target book name or active rep name",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by target book name or active rep name"
            }
          },
          {
            "name": "include_segments",
            "in": "query",
            "description": "Include segment names per target book (default: true)",
            "required": false,
            "schema": {
              "title": "Include Segments",
              "type": "boolean",
              "description": "Include segment names per target book (default: true)",
              "default": true
            }
          },
          {
            "name": "include_reps",
            "in": "query",
            "description": "Include active rep names per target book (default: true)",
            "required": false,
            "schema": {
              "title": "Include Reps",
              "type": "boolean",
              "description": "Include active rep names per target book (default: true)",
              "default": true
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by (default: Name)",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by (default: Name)",
              "default": "Name"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC or DESC (default: ASC)",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC or DESC (default: ASC)",
              "default": "ASC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of target books to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of target books to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetBookListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_target_books"
        }
      },
      "post": {
        "tags": [
          "Target Books"
        ],
        "summary": "Create a target book.",
        "description": "Creates a new target book with optional segments and conditions in the linked Salesforce org.\nUses the Salesforce Composite Graph API to create all records atomically.",
        "operationId": "webapi_target_books_create_target_book__crm_connection_id__target_books_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTargetBookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_target_book"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/target-books/{target_book_id}": {
      "get": {
        "tags": [
          "Target Books"
        ],
        "summary": "Get a target book.",
        "description": "Returns the full configuration for a target book. Use include_segments,\ninclude_reps, and include_activity_threshold to control which related data\nis fetched (all default to true).",
        "operationId": "webapi_target_books_get_target_book__crm_connection_id__target_books__target_book_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          },
          {
            "name": "include_segments",
            "in": "query",
            "description": "Include segments and their conditions (default: true)",
            "required": false,
            "schema": {
              "title": "Include Segments",
              "type": "boolean",
              "description": "Include segments and their conditions (default: true)",
              "default": true
            }
          },
          {
            "name": "include_reps",
            "in": "query",
            "description": "Include active assigned reps (default: true)",
            "required": false,
            "schema": {
              "title": "Include Reps",
              "type": "boolean",
              "description": "Include active assigned reps (default: true)",
              "default": true
            }
          },
          {
            "name": "include_activity_threshold",
            "in": "query",
            "description": "Include the assigned activity threshold (default: true)",
            "required": false,
            "schema": {
              "title": "Include Activity Threshold",
              "type": "boolean",
              "description": "Include the assigned activity threshold (default: true)",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_target_book"
        }
      },
      "delete": {
        "tags": [
          "Target Books"
        ],
        "summary": "Delete a target book.",
        "description": "Sets the status of the target book and any assigned reps to 'Deleted'.\nTriggers in the package handle downstream cleanup (queue links, distribution\nround robins).",
        "operationId": "webapi_target_books_delete_target_book__crm_connection_id__target_books__target_book_id__delete",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "delete_target_book"
        }
      },
      "patch": {
        "tags": [
          "Target Books"
        ],
        "summary": "Update target book fields.",
        "description": "All fields are optional \u2014 only provided fields are updated. Send\nactivity_threshold_id: null to remove the threshold assignment.\n\nReturns 200 with the updated book when changes are applied, or 204 when\nthe request results in no change (empty body, or clearing a threshold\nthat is not set).",
        "operationId": "webapi_target_books_patch_target_book__crm_connection_id__target_books__target_book_id__patch",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTargetBookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "update_target_book"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/target-books/{target_book_id}/reps": {
      "put": {
        "tags": [
          "Target Books"
        ],
        "summary": "Replace all reps on a target book.",
        "description": "Sets the book's active rep assignments to exactly the provided list.\nReps in the list who are currently on a different book are moved here.\nReps currently on this book who are not in the list are removed.\nReps already on this book are left unchanged.\nReturns the full list of active reps now assigned to this target book.",
        "operationId": "webapi_target_books_assign_reps_to_target_book__crm_connection_id__target_books__target_book_id__reps_put",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepIdsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignRepsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "assign_reps_to_target_book"
        }
      },
      "post": {
        "tags": [
          "Target Books"
        ],
        "summary": "Add reps to a target book.",
        "description": "Assigns one or more reps to the target book. Reps already on this book\nare skipped. Returns 409 if any rep is assigned to a different target book\n\u2014 no reps are added if any conflict is found. To move reps from another\nbook use PUT instead. Returns the full list of active reps now assigned to\nthis target book.",
        "operationId": "webapi_target_books_add_reps_to_target_book__crm_connection_id__target_books__target_book_id__reps_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepIdsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignRepsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "add_reps_to_target_book"
        }
      },
      "delete": {
        "tags": [
          "Target Books"
        ],
        "summary": "Remove one or more reps from a target book.",
        "description": "Soft-deletes the active Book assignment records by setting their status to\nDeleted. Returns 404 if any rep is not currently assigned to this book \u2014\nno reps are removed if any are not found.",
        "operationId": "webapi_target_books_remove_reps_from_target_book__crm_connection_id__target_books__target_book_id__reps_delete",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          },
          {
            "name": "rep_ids",
            "in": "query",
            "description": "Salesforce IDs of reps to remove",
            "required": true,
            "schema": {
              "title": "Rep Ids",
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Salesforce IDs of reps to remove"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "remove_reps_from_target_book"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/target-books/{target_book_id}/segments": {
      "put": {
        "tags": [
          "Target Books"
        ],
        "summary": "Replace all segments on a target book.",
        "description": "Segments with id are updated, segments without id are created, and\nexisting segments not in the request are deleted.",
        "operationId": "webapi_target_books_put_target_book_segments__crm_connection_id__target_books__target_book_id__segments_put",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSegmentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "replace_target_book_segments"
        }
      },
      "post": {
        "tags": [
          "Target Books"
        ],
        "summary": "Add a new segment to a target book.",
        "description": "Returns the full updated target book.",
        "operationId": "webapi_target_books_post_target_book_segment__crm_connection_id__target_books__target_book_id__segments_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "add_target_book_segment"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/target-books/{target_book_id}/segments/{segment_id}": {
      "delete": {
        "tags": [
          "Target Books"
        ],
        "summary": "Delete a segment from a target book.",
        "description": "Returns 400 if the segment is the last one on the book \u2014 a target book\nmust always have at least one segment. Returns the full updated target book.",
        "operationId": "webapi_target_books_delete_target_book_segment__crm_connection_id__target_books__target_book_id__segments__segment_id__delete",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          },
          {
            "name": "segment_id",
            "in": "path",
            "description": "Salesforce ID of the segment",
            "required": true,
            "schema": {
              "title": "Segment Id",
              "type": "string",
              "description": "Salesforce ID of the segment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "delete_target_book_segment"
        }
      },
      "patch": {
        "tags": [
          "Target Books"
        ],
        "summary": "Update a target book segment.",
        "description": "All fields are optional. When conditions is provided, it replaces the\nsegment's conditions using a diff (id present = update, absent = create,\nomitted from list = delete). Omitting conditions entirely leaves them\nunchanged.",
        "operationId": "webapi_target_books_patch_target_book_segment__crm_connection_id__target_books__target_book_id__segments__segment_id__patch",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "target_book_id",
            "in": "path",
            "description": "Salesforce ID of the target book",
            "required": true,
            "schema": {
              "title": "Target Book Id",
              "type": "string",
              "description": "Salesforce ID of the target book"
            }
          },
          {
            "name": "segment_id",
            "in": "path",
            "description": "Salesforce ID of the segment",
            "required": true,
            "schema": {
              "title": "Segment Id",
              "type": "string",
              "description": "Salesforce ID of the segment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSegmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleTargetBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "update_target_book_segment"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "List bookbuilder reps.",
        "description": "Returns reps with their active target-book assignment. Each rep's ``id``\nis the Salesforce User ID; a user can only be actively assigned to one\ntarget book at a time. Supports filtering by rep name, manager, target\nbook name or id, and active status, plus cursor-based pagination via\n``next_records_url``. Default page size is 50. Pass ``next_records_url``\nfrom one response into the next request to paginate through large\nresult sets.",
        "operationId": "webapi_reps_list_reps__crm_connection_id__bookbuilder_reps_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Full-text search across rep name and target book name. Requires at least 2 characters; shorter values return an empty result set.",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search across rep name and target book name. Requires at least 2 characters; shorter values return an empty result set."
            }
          },
          {
            "name": "book_definition_id",
            "in": "query",
            "description": "Filter by target book Salesforce ID (exact match)",
            "required": false,
            "schema": {
              "title": "Book Definition Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by target book Salesforce ID (exact match)"
            }
          },
          {
            "name": "manager_id",
            "in": "query",
            "description": "Filter by manager Salesforce User ID (exact match)",
            "required": false,
            "schema": {
              "title": "Manager Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by manager Salesforce User ID (exact match)"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filter by User.IsActive. Returns reps of all statuses when omitted.",
            "required": false,
            "schema": {
              "title": "Is Active",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by User.IsActive. Returns reps of all statuses when omitted."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "SOQL field on GradientWorks__Book__c (or a dotted relationship path) to sort by, e.g. GradientWorks__User__r.Name. GradientWorks__User__c is always appended as a tiebreaker unless it is already the sort_by value.",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "SOQL field on GradientWorks__Book__c (or a dotted relationship path) to sort by, e.g. GradientWorks__User__r.Name. GradientWorks__User__c is always appended as a tiebreaker unless it is already the sort_by value.",
              "default": "GradientWorks__User__r.Name"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "ASC or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "ASC or DESC",
              "default": "ASC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of reps to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of reps to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, filter/sort/search params are ignored (the underlying SOQL query is already shaped by the cursor). Metrics params (metrics, start_date, end_date), if supplied, still apply and fetch metrics for the returned page.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, filter/sort/search params are ignored (the underlying SOQL query is already shaped by the cursor). Metrics params (metrics, start_date, end_date), if supplied, still apply and fetch metrics for the returned page."
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "description": "Comma-separated list of metric names to include per rep (up to 20). Alternatively, pass a single category token \u2014 `all_accounts`, `on_book`, or `off_book` \u2014 to request every metric in that category. Category tokens cannot be combined with other tokens. Requires start_date and end_date. When omitted, the `metrics` field is null in the response.",
            "required": false,
            "schema": {
              "title": "Metrics",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated list of metric names to include per rep (up to 20). Alternatively, pass a single category token \u2014 `all_accounts`, `on_book`, or `off_book` \u2014 to request every metric in that category. Category tokens cannot be combined with other tokens. Requires start_date and end_date. When omitted, the `metrics` field is null in the response."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set.",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set."
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set.",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set."
            }
          },
          {
            "name": "hierarchy_rollup_enabled",
            "in": "query",
            "description": "When true, expands metrics to include child accounts via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org.",
            "required": false,
            "schema": {
              "title": "Hierarchy Rollup Enabled",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, expands metrics to include child accounts via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_reps"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "Get a bookbuilder rep.",
        "description": "Returns the rep's active target-book assignment. A user can only be\nactively assigned to one target book at a time, so the match is\nunambiguous. Returns 404 if the user has no active assignment. Pass\n``metrics`` with ``start_date`` and ``end_date`` to include per-rep\nmetrics; supported metric names match GET /bookbuilder/reps.",
        "operationId": "webapi_reps_get_rep__crm_connection_id__bookbuilder_reps__rep_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "rep_id",
            "in": "path",
            "description": "Salesforce User ID of the rep",
            "required": true,
            "schema": {
              "title": "Rep Id",
              "type": "string",
              "description": "Salesforce User ID of the rep"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "description": "Comma-separated list of metric names to include (up to 20). Alternatively, pass a single category token \u2014 `all_accounts`, `on_book`, or `off_book` \u2014 to request every metric in that category. Category tokens cannot be combined with other tokens. Requires start_date and end_date. When omitted, the `metrics` field is null in the response. Supported metric names match GET /bookbuilder/reps.",
            "required": false,
            "schema": {
              "title": "Metrics",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated list of metric names to include (up to 20). Alternatively, pass a single category token \u2014 `all_accounts`, `on_book`, or `off_book` \u2014 to request every metric in that category. Category tokens cannot be combined with other tokens. Requires start_date and end_date. When omitted, the `metrics` field is null in the response. Supported metric names match GET /bookbuilder/reps."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set.",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set."
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set.",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when metrics is set."
            }
          },
          {
            "name": "hierarchy_rollup_enabled",
            "in": "query",
            "description": "When true, expands metrics to include child accounts via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org.",
            "required": false,
            "schema": {
              "title": "Hierarchy Rollup Enabled",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, expands metrics to include child accounts via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_rep"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}/accounts": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "List a rep's accounts.",
        "description": "Returns a paginated list of accounts owned by the rep, optionally scoped\nto on-book or off-book accounts, with optional per-account metrics. See\nthe ``metrics`` parameter for the list of supported metric names.",
        "operationId": "webapi_reps_list_rep_accounts__crm_connection_id__bookbuilder_reps__rep_id__accounts_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "rep_id",
            "in": "path",
            "description": "Salesforce User ID of the rep",
            "required": true,
            "schema": {
              "title": "Rep Id",
              "type": "string",
              "description": "Salesforce User ID of the rep"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "description": "Comma-separated list of per-account metric names. Supported: total_activities, contacts_reached, open_opps, open_pipeline, created_opps, created_pipeline, activity_threshold_status, per_activity_count. When per_activity_count is included the response returns a list of {activity_id, activity_name, count} per account. start_date and end_date are required unless every requested metric is a snapshot (open_opps, open_pipeline).",
            "required": false,
            "schema": {
              "title": "Metrics",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated list of per-account metric names. Supported: total_activities, contacts_reached, open_opps, open_pipeline, created_opps, created_pipeline, activity_threshold_status, per_activity_count. When per_activity_count is included the response returns a list of {activity_id, activity_name, count} per account. start_date and end_date are required unless every requested metric is a snapshot (open_opps, open_pipeline)."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested.",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested."
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested.",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested."
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Filter to accounts in the rep's book.",
            "required": false,
            "schema": {
              "title": "Scope",
              "enum": [
                "all_accounts",
                "on_book",
                "off_book"
              ],
              "type": "string",
              "description": "Filter to accounts in the rep's book.",
              "default": "all_accounts"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Partial-match name search across the rep's accounts.",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Partial-match name search across the rep's accounts."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Account SObject field to sort by (e.g. Name, CreatedDate). Metric names are not supported as sort keys.",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Account SObject field to sort by (e.g. Name, CreatedDate). Metric names are not supported as sort keys.",
              "default": "Name"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "ASC or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "ASC or DESC",
              "default": "ASC"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Pagination offset (default 0, max 2000).",
            "required": false,
            "schema": {
              "title": "Offset",
              "maximum": 2000,
              "minimum": 0.0,
              "type": "integer",
              "description": "Pagination offset (default 0, max 2000).",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "maximum": 2000,
              "minimum": 1.0,
              "type": "integer",
              "description": "Page size (default 50).",
              "default": 50
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of additional Account fields to include in the response (up to 20). Supports dotted relationship paths, e.g. Owner.Name. Returned per account under the `fields` key.",
            "required": false,
            "schema": {
              "title": "Fields",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated list of additional Account fields to include in the response (up to 20). Supports dotted relationship paths, e.g. Owner.Name. Returned per account under the `fields` key."
            }
          },
          {
            "name": "hierarchy_rollup_enabled",
            "in": "query",
            "description": "When true, expands the account list to include child accounts via the org's configured account hierarchy, with a children array per parent account. Returns 400 if account hierarchy is not configured in the Salesforce org.",
            "required": false,
            "schema": {
              "title": "Hierarchy Rollup Enabled",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, expands the account list to include child accounts via the org's configured account hierarchy, with a children array per parent account. Returns 400 if account hierarchy is not configured in the Salesforce org."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepAccountsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_rep_accounts"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}/opportunities": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "List a rep's opportunities.",
        "description": "Returns a paginated list of opportunities for the rep, filtered by\n``type``: ``open`` (currently open) or ``created`` (created within a\ndate window). The ``scope`` query param filters to opportunities on\naccounts in the rep's book (default: all accounts).",
        "operationId": "webapi_reps_list_rep_opportunities__crm_connection_id__bookbuilder_reps__rep_id__opportunities_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "rep_id",
            "in": "path",
            "description": "Salesforce User ID of the rep",
            "required": true,
            "schema": {
              "title": "Rep Id",
              "type": "string",
              "description": "Salesforce User ID of the rep"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "`open` returns currently-open opportunities; `created` returns opportunities created within the date window. start_date and end_date are required when type=created and rejected when type=open.",
            "required": true,
            "schema": {
              "title": "Type",
              "enum": [
                "open",
                "created"
              ],
              "type": "string",
              "description": "`open` returns currently-open opportunities; `created` returns opportunities created within the date window. start_date and end_date are required when type=created and rejected when type=open."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the created-on window (inclusive), formatted as YYYY-MM-DD. Required when type=created; not allowed when type=open.",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start of the created-on window (inclusive), formatted as YYYY-MM-DD. Required when type=created; not allowed when type=open."
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the created-on window (inclusive), formatted as YYYY-MM-DD. Required when type=created; not allowed when type=open.",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End of the created-on window (inclusive), formatted as YYYY-MM-DD. Required when type=created; not allowed when type=open."
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Filter to opportunities whose account is in the rep's book.",
            "required": false,
            "schema": {
              "title": "Scope",
              "enum": [
                "all_accounts",
                "on_book",
                "off_book"
              ],
              "type": "string",
              "description": "Filter to opportunities whose account is in the rep's book.",
              "default": "all_accounts"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Opportunity SObject field to sort by (e.g. Name, StageName, Account.Name, CreatedDate).",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Opportunity SObject field to sort by (e.g. Name, StageName, Account.Name, CreatedDate).",
              "default": "Name"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "ASC or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "ASC or DESC",
              "default": "ASC"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Pagination offset (default 0, max 2000).",
            "required": false,
            "schema": {
              "title": "Offset",
              "maximum": 2000,
              "minimum": 0.0,
              "type": "integer",
              "description": "Pagination offset (default 0, max 2000).",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "maximum": 2000,
              "minimum": 1.0,
              "type": "integer",
              "description": "Page size (default 50).",
              "default": 50
            }
          },
          {
            "name": "hierarchy_rollup_enabled",
            "in": "query",
            "description": "When true, expands opportunity results to include child accounts via the org's configured account hierarchy. Only applies when type=open; ignored for type=created. Returns 400 if account hierarchy is not configured in the Salesforce org.",
            "required": false,
            "schema": {
              "title": "Hierarchy Rollup Enabled",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, expands opportunity results to include child accounts via the org's configured account hierarchy. Only applies when type=open; ignored for type=created. Returns 400 if account hierarchy is not configured in the Salesforce org."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepOpportunitiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_rep_opportunities"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}/charts/activities-by-day": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "Get a rep's completed-activity counts bucketed by day.",
        "description": "Returns a per-day count of completed activities (tasks and events) for\nthe rep over the requested date window, in the running user's timezone.\nDays with zero activity are gap-filled. The ``scope`` query param\nfilters to activity on all accounts (default), the rep's on-book\naccounts, or off-book accounts.",
        "operationId": "webapi_reps_get_rep_activities_by_day_chart__crm_connection_id__bookbuilder_reps__rep_id__charts_activities_by_day_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "rep_id",
            "in": "path",
            "description": "Salesforce User ID of the rep",
            "required": true,
            "schema": {
              "title": "Rep Id",
              "type": "string",
              "description": "Salesforce User ID of the rep"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the date window (inclusive), formatted as YYYY-MM-DD.",
            "required": true,
            "schema": {
              "title": "Start Date",
              "type": "string",
              "description": "Start of the date window (inclusive), formatted as YYYY-MM-DD.",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the date window (inclusive), formatted as YYYY-MM-DD.",
            "required": true,
            "schema": {
              "title": "End Date",
              "type": "string",
              "description": "End of the date window (inclusive), formatted as YYYY-MM-DD.",
              "format": "date"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Filter to activities on accounts in the rep's book.",
            "required": false,
            "schema": {
              "title": "Scope",
              "enum": [
                "all_accounts",
                "on_book",
                "off_book"
              ],
              "type": "string",
              "description": "Filter to activities on accounts in the rep's book.",
              "default": "all_accounts"
            }
          },
          {
            "name": "hierarchy_rollup_enabled",
            "in": "query",
            "description": "When true, expands chart data to include child-account activity via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org.",
            "required": false,
            "schema": {
              "title": "Hierarchy Rollup Enabled",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, expands chart data to include child-account activity via the org's configured account hierarchy. Returns 400 if account hierarchy is not configured in the Salesforce org."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepChartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_rep_activities_by_day_chart"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}/charts/created-opps-by-day": {
      "get": {
        "tags": [
          "Reps"
        ],
        "summary": "Get a rep's created-opportunity counts bucketed by day.",
        "description": "Returns a per-day count of opportunities created by the rep over the\nrequested date window, in the running user's timezone. Opportunity\nselection respects the rep pipeline criteria configured in the Gradient\nWorks managed package; \"created by\" reflects the configured opportunity-\ncreator field if set, else ``CreatedById``. Days with zero activity are\ngap-filled. The ``scope`` query param filters to opportunities whose\naccount is in the rep's book (default: all accounts).",
        "operationId": "webapi_reps_get_rep_created_opps_by_day_chart__crm_connection_id__bookbuilder_reps__rep_id__charts_created_opps_by_day_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "rep_id",
            "in": "path",
            "description": "Salesforce User ID of the rep",
            "required": true,
            "schema": {
              "title": "Rep Id",
              "type": "string",
              "description": "Salesforce User ID of the rep"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start of the date window (inclusive), formatted as YYYY-MM-DD.",
            "required": true,
            "schema": {
              "title": "Start Date",
              "type": "string",
              "description": "Start of the date window (inclusive), formatted as YYYY-MM-DD.",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End of the date window (inclusive), formatted as YYYY-MM-DD.",
            "required": true,
            "schema": {
              "title": "End Date",
              "type": "string",
              "description": "End of the date window (inclusive), formatted as YYYY-MM-DD.",
              "format": "date"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Filter to opportunities whose account is in the rep's book.",
            "required": false,
            "schema": {
              "title": "Scope",
              "enum": [
                "all_accounts",
                "on_book",
                "off_book"
              ],
              "type": "string",
              "description": "Filter to opportunities whose account is in the rep's book.",
              "default": "all_accounts"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepChartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_rep_created_opps_by_day_chart"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/distributions/templates": {
      "get": {
        "tags": [
          "Distributions"
        ],
        "summary": "List distribution templates.",
        "description": "Return distribution templates for the given Salesforce CRM connection.\nSupports sorting and cursor-based pagination. Default page size is 50.\nPass next_records_url from one response into the next request to paginate\nthrough large result sets.",
        "operationId": "webapi_distributions_list_distribution_templates__crm_connection_id__distributions_templates_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by template name (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by template name (min 2 characters)"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by (default: LastModifiedDate)",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by (default: LastModifiedDate)",
              "default": "LastModifiedDate"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC or DESC (default: DESC)",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC or DESC (default: DESC)",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of templates to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of templates to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistributionTemplateListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_distribution_templates"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/distributions/{distribution_id}": {
      "get": {
        "tags": [
          "Distributions"
        ],
        "summary": "Get a distribution.",
        "description": "Returns the full configuration for a distribution definition or template,\nincluding conditions, ranking criteria, update fields, recipients, and\nschedule info.",
        "operationId": "webapi_distributions_get_distribution__crm_connection_id__distributions__distribution_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "distribution_id",
            "in": "path",
            "description": "Salesforce ID of the distribution definition",
            "required": true,
            "schema": {
              "title": "Distribution Id",
              "type": "string",
              "description": "Salesforce ID of the distribution definition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistributionDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_distribution"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/distributions/runs": {
      "get": {
        "tags": [
          "Distributions"
        ],
        "summary": "List distribution runs.",
        "description": "Return distribution runs for the given Salesforce CRM connection.\nOptionally filter by status. Supports sorting and cursor-based pagination.\nDefault page size is 50. Pass next_records_url from one response into\nthe next request to paginate through large result sets.",
        "operationId": "webapi_distributions_list_runs__crm_connection_id__distributions_runs_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by distribution definition name (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by distribution definition name (min 2 characters)"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by run status: Pending, In Progress, Completed (default), or Failed",
            "required": false,
            "schema": {
              "title": "Status",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by run status: Pending, In Progress, Completed (default), or Failed",
              "default": "Completed"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Include runs distributed on or after this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Include runs distributed on or after this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "Include runs distributed on or before this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Include runs distributed on or before this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by: distributed_at (default), created_at, updated_at, or status",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by: distributed_at (default), created_at, updated_at, or status",
              "default": "distributed_at"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC or DESC (default: DESC)",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC or DESC (default: DESC)",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of runs to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of runs to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistributionRunListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_distribution_runs"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/distributions/runs/{run_id}": {
      "get": {
        "tags": [
          "Distributions"
        ],
        "summary": "Get distribution run detail.",
        "description": "Returns the run summary, including status, timestamps, definition\nreference, market coverage report, and total assignment count.",
        "operationId": "webapi_distributions_get_run__crm_connection_id__distributions_runs__run_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Salesforce ID of the distribution run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "Salesforce ID of the distribution run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistributionRunDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_distribution_run"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/distributions/runs/{run_id}/assignments": {
      "get": {
        "tags": [
          "Distributions"
        ],
        "summary": "List assignments for a distribution run.",
        "description": "Returns paginated assignment records for a distribution run.\nEach assignment includes the assigned record, new/previous owner, and book definition\nmatches (target book + segment).",
        "operationId": "webapi_distributions_list_run_assignments__crm_connection_id__distributions_runs__run_id__assignments_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Salesforce ID of the distribution run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "Salesforce ID of the distribution run"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of assignments to return per page (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of assignments to return per page (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page of assignments. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page of assignments. When provided, all other query params are ignored."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort assignments by: assigned_at (default), record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort assignments by: assigned_at (default), record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
              "default": "assigned_at"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: DESC (default) or ASC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: DESC (default) or ASC",
              "default": "DESC"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_distribution_run_assignments"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/queues": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "List queues.",
        "description": "Return Gradient Works queues for the given Salesforce CRM connection.\nSupports filtering by assignment policy, target book queue flag, async\nflag, capacity meter, and name search. Default page size is 50. Pass\nnext_records_url from one response into the next request to paginate\nthrough large result sets.",
        "operationId": "webapi_queues_list_queues__crm_connection_id__queues_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "policy",
            "in": "query",
            "description": "Filter by assignment policy. Comma-separated list of: Adaptive, Round Robin, Schedule First Available.",
            "required": false,
            "schema": {
              "title": "Policy",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by assignment policy. Comma-separated list of: Adaptive, Round Robin, Schedule First Available."
            }
          },
          {
            "name": "is_target_book_queue",
            "in": "query",
            "description": "When true, returns only target book queues (Type__c = 'Target Book'). When false, returns only standard queues (Type__c is null or any other value). Omit to return all queues.",
            "required": false,
            "schema": {
              "title": "Is Target Book Queue",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When true, returns only target book queues (Type__c = 'Target Book'). When false, returns only standard queues (Type__c is null or any other value). Omit to return all queues."
            }
          },
          {
            "name": "is_async",
            "in": "query",
            "description": "Filter by whether assignments are processed asynchronously",
            "required": false,
            "schema": {
              "title": "Is Async",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by whether assignments are processed asynchronously"
            }
          },
          {
            "name": "capacity_meter_id",
            "in": "query",
            "description": "Filter by the Salesforce ID of the linked capacity meter",
            "required": false,
            "schema": {
              "title": "Capacity Meter Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by the Salesforce ID of the linked capacity meter"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by queue name (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by queue name (min 2 characters)"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "SOQL field on GradientWorks__Queue__c (or a dotted relationship path) to sort by, e.g. GradientWorks__Capacity_Meter__r.Name. Default: LastModifiedDate.",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "SOQL field on GradientWorks__Queue__c (or a dotted relationship path) to sort by, e.g. GradientWorks__Capacity_Meter__r.Name. Default: LastModifiedDate.",
              "default": "LastModifiedDate"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "ASC or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "ASC or DESC",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of queues to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of queues to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_queues"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/queues/{queue_id}": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get a queue.",
        "description": "Returns the full configuration for a Gradient Works queue, its queue\nuser members, the round-robin slot ordering, and any target books\nserved by the queue. All of these are fetched in one Salesforce call\nvia parent + subqueries.",
        "operationId": "webapi_queues_get_queue__crm_connection_id__queues__queue_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "queue_id",
            "in": "path",
            "description": "Salesforce ID of the queue",
            "required": true,
            "schema": {
              "title": "Queue Id",
              "type": "string",
              "description": "Salesforce ID of the queue"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_queue"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/retrievals/templates": {
      "get": {
        "tags": [
          "Retrievals"
        ],
        "summary": "List retrieval templates.",
        "description": "Return retrieval templates for the given Salesforce CRM connection.\nSupports sorting and cursor-based pagination. Default page size is 50.\nPass next_records_url from one response into the next request to paginate\nthrough large result sets.",
        "operationId": "webapi_retrievals_list_retrieval_templates__crm_connection_id__retrievals_templates_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by template name (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by template name (min 2 characters)"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by (default: LastModifiedDate)",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by (default: LastModifiedDate)",
              "default": "LastModifiedDate"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC or DESC (default: DESC)",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC or DESC (default: DESC)",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of templates to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of templates to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrievalTemplateListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_retrieval_templates"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/retrievals/{retrieval_id}": {
      "get": {
        "tags": [
          "Retrievals"
        ],
        "summary": "Get a retrieval.",
        "description": "Returns the full configuration for a retrieval definition or template,\nincluding conditions, ranking criteria, update fields, retrieve-from\nsources, and schedule info.",
        "operationId": "webapi_retrievals_get_retrieval__crm_connection_id__retrievals__retrieval_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "retrieval_id",
            "in": "path",
            "description": "Salesforce ID of the retrieval definition",
            "required": true,
            "schema": {
              "title": "Retrieval Id",
              "type": "string",
              "description": "Salesforce ID of the retrieval definition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrievalDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_retrieval"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/retrievals/runs": {
      "get": {
        "tags": [
          "Retrievals"
        ],
        "summary": "List retrieval runs.",
        "description": "Return retrieval runs for the given Salesforce CRM connection.\nOptionally filter by status. Supports sorting and cursor-based pagination.\nDefault page size is 50. Pass next_records_url from one response into\nthe next request to paginate through large result sets.",
        "operationId": "webapi_retrievals_list_runs__crm_connection_id__retrievals_runs_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by retrieval definition name (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by retrieval definition name (min 2 characters)"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by run status: Pending, In Progress, Completed (default), or Failed",
            "required": false,
            "schema": {
              "title": "Status",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by run status: Pending, In Progress, Completed (default), or Failed",
              "default": "Completed"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Include runs retrieved on or after this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Include runs retrieved on or after this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "Include runs retrieved on or before this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Include runs retrieved on or before this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by: retrieved_at (default), created_at, updated_at, or status",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by: retrieved_at (default), created_at, updated_at, or status",
              "default": "retrieved_at"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC or DESC (default: DESC)",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC or DESC (default: DESC)",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of runs to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of runs to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrievalRunListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_retrieval_runs"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/retrievals/runs/{run_id}": {
      "get": {
        "tags": [
          "Retrievals"
        ],
        "summary": "Get retrieval run detail.",
        "description": "Returns the run summary, including status, timestamps, definition\nreference, market coverage report, flow details, and total assignment\ncount.",
        "operationId": "webapi_retrievals_get_run__crm_connection_id__retrievals_runs__run_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Salesforce ID of the retrieval run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "Salesforce ID of the retrieval run"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrievalRunDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_retrieval_run"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/retrievals/runs/{run_id}/assignments": {
      "get": {
        "tags": [
          "Retrievals"
        ],
        "summary": "List assignments for a retrieval run.",
        "description": "Returns paginated assignment records for a retrieval run.\nEach assignment includes the assigned record, new/previous owner.",
        "operationId": "webapi_retrievals_list_run_assignments__crm_connection_id__retrievals_runs__run_id__assignments_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Salesforce ID of the retrieval run",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string",
              "description": "Salesforce ID of the retrieval run"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of assignments to return per page (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of assignments to return per page (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page of assignments. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page of assignments. When provided, all other query params are ignored."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort assignments by: assigned_at (default), record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort assignments by: assigned_at (default), record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
              "default": "assigned_at"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: DESC (default) or ASC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: DESC (default) or ASC",
              "default": "DESC"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_retrieval_run_assignments"
        }
      }
    },
    "/api/v1/carve/projects": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "List projects.",
        "description": "Return the active carve projects in the account linked to the API key that\nthe key's user may see.",
        "operationId": "webapi_projects_get_projects_get",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_carve_projects"
        }
      },
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Create a project.",
        "description": "Returns the created project. The project is immediately active and ready to\nreceive data sources and scenarios.",
        "operationId": "webapi_projects_create_project_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListItemResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_carve_project"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get a project.",
        "description": "Return a single project by ID.",
        "operationId": "webapi_projects_get_project__project_id__get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListItemResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/data-sources": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "List data sources for a project.",
        "description": "Return all active data sources attached to the given project.",
        "operationId": "webapi_projects_get_project_data_sources__project_id__data_sources_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDataSourceListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_carve_project_data_sources"
        }
      },
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Attach a data source to a project.",
        "description": "Attach an existing CSV data source to the project. The data source must\nbelong to the same account as the project. Pass an asset:// URI as\nsource.id \u2014 the UUID is returned by the Assets endpoint. Only csv\nsources are currently supported.\n\nThe first data source attached to a project is automatically set as the\nprimary data source. If the account has a Carve subscription with a row\nlimit, that limit is enforced when attaching the primary data source.\n\nSet `use_credits` to true to allow the data source to exceed the row\nlimit by charging credits for the overage (1 credit per 10 rows above\nthe limit). Returns 422 if the account has insufficient credits.\n\nThe account sheet will need to be refreshed to reflect any changes.",
        "operationId": "webapi_projects_attach_project_data_source__project_id__data_sources_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachDataSourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDataSourceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "attach_carve_project_data_source",
          "description": "The source.id must be an asset:// URI from upload_asset + complete_asset_upload. If the user provides a file directly, upload it first. For Excel files, ask the user which sheet to use (0-based sheet_index, default 0) before uploading \u2014 sheet selection happens at upload time and cannot be changed after. Before setting use_credits=true, confirm with the user \u2014 it will debit credits from their account. If the attach fails with a row limit error, calculate the expected cost (rows_over_limit / 10, rounded up) and show it to the user before retrying with use_credits=true."
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/data-sources/{data_source_id}": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get a data source for a project.",
        "description": "Return a single data source attached to the given project.",
        "operationId": "webapi_projects_get_project_data_source__project_id__data_sources__data_source_id__get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Data Source Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDataSourceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_data_source"
        }
      },
      "put": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Replace a data source on a project.",
        "description": "Replace an existing attached data source with a new one of the same type.\nThe replacement inherits the primary/non-primary status of the data source\nit replaces.\n\nSet `use_credits` to true to allow the replacement to exceed the row limit\nby charging credits for the overage (1 credit per 10 rows above the limit)\nwhen replacing a primary data source. Returns 422 if the account has\ninsufficient credits.\n\nThe account sheet will need to be refreshed to reflect any changes.",
        "operationId": "webapi_projects_replace_project_data_source__project_id__data_sources__data_source_id__put",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Data Source Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceDataSourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDataSourceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "replace_carve_project_data_source",
          "description": "The source.id must be an asset:// URI from upload_asset + complete_asset_upload. If the user provides a file directly, upload it first. For Excel files, ask the user which sheet to use (0-based sheet_index, default 0) before uploading \u2014 sheet selection happens at upload time and cannot be changed after. Before setting use_credits=true, confirm with the user \u2014 it will debit credits from their account. If the replace fails with a row limit error, calculate the expected cost (rows_over_limit / 10, rounded up) and show it to the user before retrying with use_credits=true."
        }
      },
      "delete": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Remove a data source from a project.",
        "description": "Detach a data source from the project entirely. This cannot be undone.\nThe account sheet will need to be refreshed to reflect any changes.",
        "operationId": "webapi_projects_remove_project_data_source__project_id__data_sources__data_source_id__delete",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Data Source Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveDataSourceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "remove_carve_project_data_source"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/data-sources/{data_source_id}/download": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get a presigned download URL for a data source file.",
        "description": "Return a short-lived S3 presigned URL for the processed data file\nbacking the given project data source. The URL expires in one hour\n(`expires_in` seconds).",
        "operationId": "webapi_projects_download_project_data_source__project_id__data_sources__data_source_id__download_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Data Source Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataSourceDownloadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "download_carve_project_data_source",
          "description": "Agent usage: the `download_url` is a short-lived presigned S3 link. Confirm with the user where they want to save the file before downloading."
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "List scenarios for a project.",
        "description": "Return scenarios for the given project, ordered by creation date descending.\nScenarios are cached locally and reflect the last time project assets were fetched.",
        "operationId": "webapi_projects_list_project_scenarios__project_id__scenarios_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectScenarioListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_carve_project_scenarios"
        }
      },
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Create a Carve scenario.",
        "description": "Start a fresh scenario with the Carve agent",
        "operationId": "webapi_projects_create_project_scenario__project_id__scenarios_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateScenarioResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_carve_project_scenario"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get a scenario.",
        "description": "Return a single scenario by ID. The scenario must belong to the given project.",
        "operationId": "webapi_projects_get_project_scenario__project_id__scenarios__scenario_id__get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectScenarioResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_scenario"
        }
      },
      "put": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Rename a Carve scenario.",
        "description": "Update the display name of a scenario. Both the scenario record and any\nresult column headers in the downloaded CSV are updated atomically. Renaming\na scenario that has been executed does not affect its results or conversation\nhistory.\n\nReturns 400 if a scenario with the requested name already exists in the project.\n\nIf the project is currently open in the browser, refresh the page to see\nthe updated name.",
        "operationId": "webapi_projects_rename_project_scenario__project_id__scenarios__scenario_id__put",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenameScenarioResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "rename_carve_project_scenario"
        }
      },
      "delete": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Delete a Carve scenario.",
        "description": "Permanently remove a scenario from the project. The scenario's results,\nconversation history, and overrides are deleted and cannot be recovered.\n\nReturns 409 if the scenario has a deploy job currently in progress.\n\nIf the project is currently open in the browser, refresh the page to see\nthe scenario removed.",
        "operationId": "webapi_projects_delete_project_scenario__project_id__scenarios__scenario_id__delete",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteScenarioResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "delete_carve_project_scenario"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/account-sheet": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get the account sheet for a scenario.",
        "description": "Fetch the scenario account sheet from Bookcarver, upload a CSV export to\nS3, and return a presigned download URL. The account sheet includes the\nscenario's results as two additional columns named\n`{Scenario Name} (Results)` and `{Scenario Name} (Rationale)`. The project\nmust belong to the authenticated account.",
        "operationId": "webapi_projects_get_scenario_account_sheet__project_id__scenarios__scenario_id__account_sheet_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSheetDownloadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_scenario_account_sheet",
          "description": "Agent usage: the returned `download_url` is a short-lived presigned S3 link, not an answer. To answer the user's question about the scenario, download the CSV to the local `/tmp` directory (e.g. `curl -sSL \"$download_url\" -o /tmp/<project_id>-<scenario_id>.csv`) and analyze it with Python (pandas, csv) or shell tools (awk, grep, csvkit). Filter, group, or aggregate the rows as needed to address the user's request \u2014 do not return the raw URL to the user unless they explicitly asked for a download link."
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/account-sheet/schema": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get the schema of a scenario account sheet.",
        "description": "Returns the field names, types, and primary key for the account sheet\nassociated with the given scenario, without downloading all row data.\nThe scenario must belong to the authenticated account and must be executed.",
        "operationId": "webapi_projects_get_scenario_account_sheet_schema__project_id__scenarios__scenario_id__account_sheet_schema_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSheetSchemaResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_scenario_account_sheet_schema",
          "description": "Return the column schema (field names and types) for a Carve scenario account sheet. Use this before deploying to a CRM or setting overrides to discover the available column names, especially the column to use as `account_sheet_column` in `deploy_carve_project_to_crm`."
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/account-sheet/reset": {
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Refresh a scenario to use the latest account sheet version.",
        "description": "Updates the scenario so it runs against the current account sheet. Any\nexisting carve results for this scenario will no longer be accessible.",
        "operationId": "webapi_projects_reset_scenario_account_sheet__project_id__scenarios__scenario_id__account_sheet_reset_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetScenarioAccountSheetResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "reset_carve_project_scenario_account_sheet"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/account-sheet/refresh-preview": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Preview changes that would result from refreshing the account sheet.",
        "description": "Returns the column names that would be added, updated, or removed if the\naccount sheet were refreshed against the latest data from connected sources.\nThe project must belong to the authenticated account.",
        "operationId": "webapi_projects_get_account_sheet_refresh_preview__project_id__account_sheet_refresh_preview_get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSheetRefreshPreviewResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_account_sheet_refresh_preview"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/account-sheet/refresh": {
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Refresh the account sheet for a project.",
        "description": "Refreshes the account sheet using the latest data from connected sources,\ncreating a new version with any added, updated, or removed columns. The\nproject must belong to the authenticated account. After refreshing,\nexisting scenarios will continue using the previous account sheet version\nuntil the user chooses to update them via\n`reset_carve_project_scenario_account_sheet`. Note that resetting a\nscenario will make any existing carve results for that scenario\ninaccessible. Call `get_carve_project_account_sheet_refresh_preview` first\nto show the user which columns will change before triggering the refresh.",
        "operationId": "webapi_projects_refresh_account_sheet__project_id__account_sheet_refresh_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSheetRefreshResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "refresh_carve_project_account_sheet"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/account-sheet/overrides": {
      "patch": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Override Results and Rationale for rows in a scenario account sheet.",
        "description": "Override or clear the assigned result and rationale for one or more rows\nin an executed scenario account sheet. All changes are atomic: if any\nrow_key is unknown, the entire request is rejected and no override changes\nare written.",
        "operationId": "webapi_projects_set_scenario_account_sheet_overrides__project_id__scenarios__scenario_id__account_sheet_overrides_patch",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScenarioOverrideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioOverrideResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "set_carve_project_scenario_account_sheet_overrides",
          "description": "Override the assigned results and rationale for one or more rows in a Carve\n        scenario account sheet. Use row_key = gw_row_number from the\n        account sheet CSV. Send result=null to clear a row's override.\n        Omit rationale to have it auto-generated. Unknown row_keys cause\n        the whole request to fail with 400 \u2014 no partial writes.\n\n        Send at most 100 overrides per call; split larger updates across\n        multiple calls.\n        "
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/clone": {
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Clone a Carve scenario.",
        "description": "Create a new scenario by copying an existing one, including its results,\noverrides, and conversation history. The clone is an independent snapshot \u2014\nsubsequent changes to either scenario do not affect the other.\n\nIf `name` is omitted, the new scenario is named '{source name} (copy)'.\n\nIf the project is currently open in the browser, refresh the page to see\nthe new scenario.",
        "operationId": "webapi_projects_clone_project_scenario__project_id__scenarios__scenario_id__clone_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloneScenarioResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "clone_carve_project_scenario"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/description": {
      "patch": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Update a Carve scenario description.",
        "description": "Set or clear the human-readable description for a scenario. Pass null to clear it.",
        "operationId": "webapi_projects_update_project_scenario_description__project_id__scenarios__scenario_id__description_patch",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScenarioDescriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateScenarioDescriptionResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "update_carve_project_scenario_description"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/deploy-salesforce": {
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Deploy a Carve scenario to Salesforce.",
        "description": "Trigger an export of a Carve scenario's results to Salesforce.\nThe `crm_connection_id` must identify an active Salesforce OAuth connection.\nReturns a job ID that can be polled via `GET /<project_id>/deploy/<job_id>`.\n\nTo discover available account sheet columns for `field_mappings.account_sheet_column`,\ncall `GET /<project_id>/scenarios/<scenario_id>/account-sheet/schema` first.\n\nTo discover valid Salesforce field names for `field_mappings` and\n`additional_field_updates`, call\n`GET /api/v1/crm-connections/{crm_connection_id}/metadata` first.\nUse the `value` from each field object as `match_field`, `update_field`,\nor `additional_field_updates[].field`.",
        "operationId": "webapi_projects_deploy_project_salesforce__project_id__scenarios__scenario_id__deploy_salesforce_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeploySalesforceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployProjectResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "deploy_carve_project_to_salesforce"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/scenarios/{scenario_id}/deploy-hubspot": {
      "post": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Deploy a Carve scenario to HubSpot.",
        "description": "Trigger an export of a Carve scenario's results to HubSpot.\nThe `crm_connection_id` must identify an active HubSpot OAuth connection.\nReturns a job ID that can be polled via `GET /<project_id>/deploy/<job_id>`.\n\nTo discover available account sheet columns for `property_mappings.account_sheet_column`,\ncall `GET /<project_id>/scenarios/<scenario_id>/account-sheet/schema` first.\n\nTo discover valid HubSpot property names for `property_mappings` and\n`additional_property_updates`, call\n`GET /api/v1/crm-connections/{crm_connection_id}/metadata` first.\nUse the `value` from each property object as `match_property`, `update_property`,\nor `additional_property_updates[].property`.",
        "operationId": "webapi_projects_deploy_project_hubspot__project_id__scenarios__scenario_id__deploy_hubspot_post",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Scenario Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployHubspotRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployProjectResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "502": {
            "description": "Bad Gateway"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "deploy_carve_project_to_hubspot"
        }
      }
    },
    "/api/v1/carve/projects/{project_id}/deploy/{job_id}": {
      "get": {
        "tags": [
          "Carve / Projects"
        ],
        "summary": "Get the status of a Carve deploy job.",
        "description": "Poll the status of a deploy job created by `POST /<project_id>/deploy`.\n`results` is `null` while the job is pending or processing; once complete\nor failed it contains `success_count` and `total_count`.",
        "operationId": "webapi_projects_get_deploy_job__project_id__deploy__job_id__get",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployJobStatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_carve_project_deploy_job"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/assignments": {
      "get": {
        "tags": [
          "Assignments"
        ],
        "summary": "List assignments.",
        "description": "Return assignment records for the given Salesforce CRM connection.\nSupports filtering by date range, assignment type, assigned rep, record, distribution run,\nretrieval run, and queue. Supports sorting and cursor-based pagination.\nDefault page size is 50.",
        "operationId": "webapi_assignments_list_assignments__crm_connection_id__assignments_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Full-text search across record name, queue name, flow name, and detail. Minimum 2 characters.",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search across record name, queue name, flow name, and detail. Minimum 2 characters."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Filter records with assigned_time on or after this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter records with assigned_time on or after this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "Filter records with assigned_time on or before this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter records with assigned_time on or before this date (YYYY-MM-DD)"
            }
          },
          {
            "name": "assignment_type",
            "in": "query",
            "description": "Filter by assignment type: Queue, Direct, or Other",
            "required": false,
            "schema": {
              "title": "Assignment Type",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by assignment type: Queue, Direct, or Other"
            }
          },
          {
            "name": "assigned_to",
            "in": "query",
            "description": "Filter by Salesforce User ID of the assigned rep",
            "required": false,
            "schema": {
              "title": "Assigned To",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by Salesforce User ID of the assigned rep"
            }
          },
          {
            "name": "record_id",
            "in": "query",
            "description": "Filter by Salesforce ID of the assigned record",
            "required": false,
            "schema": {
              "title": "Record Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by Salesforce ID of the assigned record"
            }
          },
          {
            "name": "record_name",
            "in": "query",
            "description": "Filter by exact name of the assigned record",
            "required": false,
            "schema": {
              "title": "Record Name",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by exact name of the assigned record"
            }
          },
          {
            "name": "distribution_run_id",
            "in": "query",
            "description": "Filter by Salesforce ID of the distribution run. Mutually exclusive with retrieval_run_id.",
            "required": false,
            "schema": {
              "title": "Distribution Run Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by Salesforce ID of the distribution run. Mutually exclusive with retrieval_run_id."
            }
          },
          {
            "name": "retrieval_run_id",
            "in": "query",
            "description": "Filter by Salesforce ID of the retrieval run. Mutually exclusive with distribution_run_id.",
            "required": false,
            "schema": {
              "title": "Retrieval Run Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by Salesforce ID of the retrieval run. Mutually exclusive with distribution_run_id."
            }
          },
          {
            "name": "queue_id",
            "in": "query",
            "description": "Filter by Salesforce ID of the Gradient Works queue",
            "required": false,
            "schema": {
              "title": "Queue Id",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by Salesforce ID of the Gradient Works queue"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by: assigned_at (default), assignment_type, record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by: assigned_at (default), assignment_type, record_name, new_owner_name, previous_owner_name, created_at, or updated_at",
              "default": "assigned_at"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: DESC (default) or ASC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: DESC (default) or ASC",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return (default: 50)",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of records to return (default: 50)",
              "default": 50
            }
          },
          {
            "name": "include_book_matches",
            "in": "query",
            "description": "When true, each assignment includes a book_definition_matches array listing the target books and segments that matched. Only populated for distribution assignments; null for retrievals and manual or queue assignments.",
            "required": false,
            "schema": {
              "title": "Include Book Matches",
              "type": "boolean",
              "description": "When true, each assignment includes a book_definition_matches array listing the target books and segments that matched. Only populated for distribution assignments; null for retrievals and manual or queue assignments.",
              "default": false
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_assignments"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/log-entries": {
      "get": {
        "tags": [
          "Log Entries"
        ],
        "summary": "List log entries.",
        "description": "Returns Gradient Works log entries for the given Salesforce CRM connection.\nSupports filtering by date range and text search across logger, flow name,\nrequest ID, and flow interview GUID fields. Default page size is 50; results\nare ordered by timestamp descending. Pass next_records_url from one response\ninto the next request to paginate through large result sets.",
        "operationId": "webapi_log_entries_list_log_entries__crm_connection_id__log_entries_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search across log entry text fields: logger, flow name, request ID, and flow interview GUID. Requires at least 2 characters.",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search across log entry text fields: logger, flow name, request ID, and flow interview GUID. Requires at least 2 characters."
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Return log entries on or after this date (inclusive), formatted as YYYY-MM-DD. Filters on the log timestamp field.",
            "required": false,
            "schema": {
              "title": "Start Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return log entries on or after this date (inclusive), formatted as YYYY-MM-DD. Filters on the log timestamp field."
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "Return log entries on or before this date (inclusive), formatted as YYYY-MM-DD. Filters on the log timestamp field.",
            "required": false,
            "schema": {
              "title": "End Date",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return log entries on or before this date (inclusive), formatted as YYYY-MM-DD. Filters on the log timestamp field."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by. Default: GradientWorks__Timestamp__c.",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by. Default: GradientWorks__Timestamp__c.",
              "default": "GradientWorks__Timestamp__c"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "ASC or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "ASC or DESC",
              "default": "DESC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of log entries to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of log entries to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogEntriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_log_entries"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows": {
      "get": {
        "tags": [
          "Flows"
        ],
        "summary": "List flows.",
        "description": "Return flow definitions from the connected Salesforce org.\nOptionally search by label. Supports sorting and\ncursor-based pagination. Default page size is 50. Pass next_records_url\nfrom one response into the next request to paginate through large result sets.",
        "operationId": "webapi_flows_list_flows__crm_connection_id__flows_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search by flow label (min 2 characters)",
            "required": false,
            "schema": {
              "title": "Query",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by flow label (min 2 characters)"
            }
          },
          {
            "name": "trigger_object",
            "in": "query",
            "description": "Filter by trigger object or event label (exact match, e.g. Opportunity, Account).",
            "required": false,
            "schema": {
              "title": "Trigger Object",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by trigger object or event label (exact match, e.g. Opportunity, Account)."
            }
          },
          {
            "name": "process_type",
            "in": "query",
            "description": "Filter by flow process type (exact match, e.g. Flow, AutoLaunchedFlow, Workflow).",
            "required": false,
            "schema": {
              "title": "Process Type",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by flow process type (exact match, e.g. Flow, AutoLaunchedFlow, Workflow)."
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filter by active status. true returns only flows with an active version; false returns only flows with no active version. Omit to return all flows regardless of active status.",
            "required": false,
            "schema": {
              "title": "Is Active",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by active status. true returns only flows with an active version; false returns only flows with no active version. Omit to return all flows regardless of active status."
            }
          },
          {
            "name": "is_template",
            "in": "query",
            "description": "Filter by template status. true returns only template flows; false returns only non-template flows. Omit to return all flows regardless of template status.",
            "required": false,
            "schema": {
              "title": "Is Template",
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by template status. true returns only template flows; false returns only non-template flows. Omit to return all flows regardless of template status."
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Field to sort by (default: Label)",
            "required": false,
            "schema": {
              "title": "Sort By",
              "type": "string",
              "description": "Field to sort by (default: Label)",
              "default": "Label"
            }
          },
          {
            "name": "sort_direction",
            "in": "query",
            "description": "Sort direction: ASC (default) or DESC",
            "required": false,
            "schema": {
              "title": "Sort Direction",
              "type": "string",
              "description": "Sort direction: ASC (default) or DESC",
              "default": "ASC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of flows to return (default: 50).",
            "required": false,
            "schema": {
              "title": "Limit",
              "anyOf": [
                {
                  "maximum": 50000,
                  "minimum": 1.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of flows to return (default: 50).",
              "default": 50
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page. When provided, all other query params are ignored."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_flows"
        }
      },
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Create a flow.",
        "description": "Create a new flow in the connected Salesforce org. The new flow is created\nwith Draft status. Returns the DurableId of the created flow. The API name\nmust be unique across the org.",
        "operationId": "webapi_flows_create_flow__crm_connection_id__flows_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFlowBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFlowResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_flow"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows/{flow_id}": {
      "get": {
        "tags": [
          "Flows"
        ],
        "summary": "Get a flow.",
        "description": "Return the flow definition for a single flow by its DurableId.",
        "operationId": "webapi_flows_get_flow__crm_connection_id__flows__flow_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDefinitionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_flow"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows/{flow_id}/versions": {
      "get": {
        "tags": [
          "Flows"
        ],
        "summary": "List flow versions.",
        "description": "Return all versions of a flow definition, ordered by version number\ndescending. Each version includes its status (Active, Draft, Obsolete,\nor InvalidDraft) and version number. Pass next_records_url from one\nresponse into the next request to paginate through large result sets.",
        "operationId": "webapi_flows_list_flow_versions__crm_connection_id__flows__flow_id__versions_get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          },
          {
            "name": "next_records_url",
            "in": "query",
            "description": "Cursor returned by a previous response to fetch the next page.",
            "required": false,
            "schema": {
              "title": "Next Records Url",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned by a previous response to fetch the next page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowVersionsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "list_flow_versions"
        }
      },
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Create a flow version.",
        "description": "Create a new version of an existing flow in the connected Salesforce org.\nUse get_flow_version to fetch an existing version's metadata as a starting\npoint, then modify and pass it here. Returns the id (DurableId) of the\nnewly created version.\n\nTo update an existing draft version use update_flow_version. To activate\nor deactivate a version use activate_flow_version or deactivate_flow_version.",
        "operationId": "webapi_flows_create_flow_version__crm_connection_id__flows__flow_id__versions_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowVersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFlowVersionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "create_flow_version"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows/{flow_id}/versions/{version_id}": {
      "get": {
        "tags": [
          "Flows"
        ],
        "summary": "Get a flow version.",
        "description": "Return the full configuration for a specific flow version, including its\nMetadata JSON. By default, null fields and empty lists are stripped from\nthe metadata response. Set simplified=false to receive the unprocessed metadata.",
        "operationId": "webapi_flows_get_flow_version__crm_connection_id__flows__flow_id__versions__version_id__get",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string",
              "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions"
            }
          },
          {
            "name": "simplified",
            "in": "query",
            "description": "When true (default), null fields and empty lists are stripped from the metadata response, producing a leaner representation. Set to false to receive the unprocessed metadata.",
            "required": false,
            "schema": {
              "title": "Simplified",
              "type": "boolean",
              "description": "When true (default), null fields and empty lists are stripped from the metadata response, producing a leaner representation. Set to false to receive the unprocessed metadata.",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowVersionConfigResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "get_flow_version"
        }
      },
      "patch": {
        "tags": [
          "Flows"
        ],
        "summary": "Update a flow version.",
        "description": "Update a flow version by submitting a complete metadata object. The metadata\nmust include all fields, not just the ones being changed \u2014 fetch the current\nmetadata via get_flow_version first, modify what you need, then submit the\nfull object. Returns 204 on success. Active versions cannot be edited.",
        "operationId": "webapi_flows_update_flow_version__crm_connection_id__flows__flow_id__versions__version_id__patch",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string",
              "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowVersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "update_flow_version"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows/{flow_id}/versions/{version_id}/activate": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Activate a flow version.",
        "description": "Sets this version as the active version of the flow. The previously active\nversion (if any) becomes Obsolete. Returns 204 on success. If the version\nis already Active, returns 204 without making changes.",
        "operationId": "webapi_flows_activate_flow_version__crm_connection_id__flows__flow_id__versions__version_id__activate_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string",
              "description": "DurableId of the flow version, as returned in the durable_id field of list_flow_versions"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "activate_flow_version"
        }
      }
    },
    "/api/v1/crm-connections/{crm_connection_id}/flows/{flow_id}/deactivate": {
      "post": {
        "tags": [
          "Flows"
        ],
        "summary": "Deactivate a flow.",
        "description": "Clears the active version of a flow, transitioning it to Obsolete. Returns\n204 on success. If the flow has no active version, returns 204 without\nmaking changes.",
        "operationId": "webapi_flows_deactivate_flow_version__crm_connection_id__flows__flow_id__deactivate_post",
        "parameters": [
          {
            "name": "crm_connection_id",
            "in": "path",
            "description": "UUID of the CRM connection",
            "required": true,
            "schema": {
              "title": "Crm Connection Id",
              "type": "string",
              "description": "UUID of the CRM connection"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "description": "DurableId of the flow definition",
            "required": true,
            "schema": {
              "title": "Flow Id",
              "type": "string",
              "description": "DurableId of the flow definition"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-mcp-tool": {
          "name": "deactivate_flow_version"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CRMConnectionListResponse": {
        "title": "CRMConnectionListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CRMConnectionResponse"
        },
        "description": "A JSON array of CRM connection objects."
      },
      "CRMConnectionResponse": {
        "title": "CRMConnectionResponse",
        "required": [
          "id",
          "type",
          "status",
          "instance_url",
          "is_primary"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Unique identifier (UUID) of the CRM connection"
          },
          "type": {
            "title": "Type",
            "type": "string",
            "description": "CRM type: SALESFORCE or HUBSPOT"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Connection status: ACTIVE or INACTIVE"
          },
          "org_name": {
            "title": "Org Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "CRM org display name"
          },
          "instance_url": {
            "title": "Instance Url",
            "type": "string",
            "description": "CRM instance URL"
          },
          "crm_environment": {
            "title": "Crm Environment",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Environment: PRODUCTION or SANDBOX"
          },
          "is_primary": {
            "title": "Is Primary",
            "type": "boolean",
            "description": "Whether this is the primary CRM connection for the account"
          },
          "created_at": {
            "title": "Created At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 last-updated timestamp"
          }
        }
      },
      "CRMObjectFieldListResponse": {
        "title": "CRMObjectFieldListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CRMObjectFieldResponse"
        },
        "description": "A JSON array of CRM Account/Company field definitions."
      },
      "CRMObjectFieldOption": {
        "title": "CRMObjectFieldOption",
        "required": [
          "label",
          "value"
        ],
        "type": "object",
        "properties": {
          "label": {
            "title": "Label",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        }
      },
      "CRMObjectFieldResponse": {
        "title": "CRMObjectFieldResponse",
        "required": [
          "label",
          "value",
          "field_type"
        ],
        "type": "object",
        "properties": {
          "label": {
            "title": "Label",
            "type": "string",
            "description": "Human-readable field name"
          },
          "value": {
            "title": "Value",
            "type": "string",
            "description": "CRM API field name"
          },
          "field_type": {
            "title": "Field Type",
            "type": "string",
            "description": "Field data type (e.g. string, picklist, reference, boolean)"
          },
          "updateable": {
            "title": "Updateable",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the field can be written to"
          },
          "options": {
            "title": "Options",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CRMObjectFieldOption"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Allowed values for picklist fields"
          }
        }
      },
      "AssetResponse": {
        "title": "AssetResponse",
        "required": [
          "asset_id"
        ],
        "type": "object",
        "properties": {
          "asset_id": {
            "title": "Asset Id",
            "type": "string",
            "description": "An asset:// URI referencing the uploaded file"
          }
        }
      },
      "ErrorResponse": {
        "title": "ErrorResponse",
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "title": "Error",
            "type": "string"
          }
        }
      },
      "UploadAssetForm": {
        "title": "UploadAssetForm",
        "required": [
          "file"
        ],
        "type": "object",
        "properties": {
          "file": {
            "title": "File",
            "type": "string",
            "description": "CSV or Excel file to upload",
            "format": "binary"
          },
          "sheet_index": {
            "title": "Sheet Index",
            "type": "integer",
            "description": "Sheet index (0-based) to convert for Excel files",
            "default": 0
          }
        }
      },
      "GetUploadUrlResponse": {
        "title": "GetUploadUrlResponse",
        "required": [
          "upload_url",
          "upload_token",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "upload_url": {
            "title": "Upload Url",
            "type": "string",
            "description": "Pre-signed S3 URL \u2014 PUT the file bytes directly to this URL"
          },
          "upload_token": {
            "title": "Upload Token",
            "type": "string",
            "description": "Opaque token to pass to complete_upload after the PUT succeeds"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer",
            "description": "Seconds until the upload URL and token expire"
          }
        }
      },
      "GetUploadUrlBody": {
        "title": "GetUploadUrlBody",
        "required": [
          "file_name"
        ],
        "type": "object",
        "properties": {
          "file_name": {
            "title": "File Name",
            "type": "string",
            "description": "File name including extension (e.g. 'accounts.csv' or 'data.xlsx')"
          },
          "sheet_index": {
            "title": "Sheet Index",
            "type": "integer",
            "description": "Sheet index (0-based) to convert for Excel files",
            "default": 0
          }
        }
      },
      "CompleteUploadBody": {
        "title": "CompleteUploadBody",
        "required": [
          "upload_token"
        ],
        "type": "object",
        "properties": {
          "upload_token": {
            "title": "Upload Token",
            "type": "string",
            "description": "Token returned by upload_asset"
          }
        }
      },
      "MarketMapListResponse": {
        "title": "MarketMapListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/MarketMapListItemResponse"
        },
        "description": "A JSON array of market map objects."
      },
      "MarketMapListItemResponse": {
        "title": "MarketMapListItemResponse",
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the market map"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Market map name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Market map status (ACTIVE or INACTIVE)"
          },
          "source_type": {
            "title": "Source Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the market map was created (e.g. csv, crm)"
          },
          "analyzed_count": {
            "title": "Analyzed Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of accounts analyzed (from latest completed run)"
          },
          "mapped_count": {
            "title": "Mapped Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of accounts placed on the map (from latest completed run)"
          },
          "tier1_count": {
            "title": "Tier1 Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier 1 accounts (from latest completed run)"
          },
          "latest_run_status": {
            "title": "Latest Run Status",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status of the most recent run"
          },
          "created_at": {
            "title": "Created At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 last-updated timestamp"
          }
        }
      },
      "MarketMapDetailResponse": {
        "title": "MarketMapDetailResponse",
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the market map"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Market map name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Market map status (ACTIVE or INACTIVE)"
          },
          "source_type": {
            "title": "Source Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the market map was created (e.g. csv, crm)"
          },
          "analyzed_count": {
            "title": "Analyzed Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of accounts analyzed"
          },
          "mapped_count": {
            "title": "Mapped Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of accounts placed on the map"
          },
          "tier1_count": {
            "title": "Tier1 Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier 1 accounts"
          },
          "latest_run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most recent run for this market map"
          },
          "created_at": {
            "title": "Created At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 last-updated timestamp"
          }
        }
      },
      "RunResponse": {
        "title": "RunResponse",
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: PENDING, PROCESSING, COMPLETE, FAILED, or CANCELED"
          },
          "status_message": {
            "title": "Status Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable status detail"
          },
          "source_type": {
            "title": "Source Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source type (csv, salesforce_report, hubspot_list, project)"
          },
          "source_name": {
            "title": "Source Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the source"
          },
          "credit_cost": {
            "title": "Credit Cost",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Research credits consumed"
          },
          "analyzed_count": {
            "title": "Analyzed Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total accounts analyzed (null until complete)"
          },
          "mapped_count": {
            "title": "Mapped Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accounts placed on the map (null until complete)"
          },
          "tier1_count": {
            "title": "Tier1 Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier 1 accounts (null until complete)"
          },
          "created_at": {
            "title": "Created At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 last-updated timestamp"
          }
        }
      },
      "RunListResponse": {
        "title": "RunListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/RunResponse"
        },
        "description": "A JSON array of run objects."
      },
      "RunProgressResponse": {
        "title": "RunProgressResponse",
        "required": [
          "status",
          "estimated_pct"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Current run status"
          },
          "total_count": {
            "title": "Total Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total accounts being processed"
          },
          "estimated_pct": {
            "title": "Estimated Pct",
            "type": "number",
            "description": "Estimated progress 0\u20131"
          }
        }
      },
      "RunResultsResponse": {
        "title": "RunResultsResponse",
        "required": [
          "download_url",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "download_url": {
            "title": "Download Url",
            "type": "string",
            "description": "Pre-signed S3 URL for the result file"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer",
            "description": "URL expiry in seconds"
          },
          "stats": {
            "title": "Stats",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Result statistics"
          }
        }
      },
      "RunSourceResponse": {
        "title": "RunSourceResponse",
        "required": [
          "download_url",
          "filename",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "download_url": {
            "title": "Download Url",
            "type": "string",
            "description": "Pre-signed S3 URL for the source CSV file"
          },
          "filename": {
            "title": "Filename",
            "type": "string",
            "description": "Original uploaded filename"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer",
            "description": "URL expiry in seconds"
          }
        }
      },
      "RunCancelResponse": {
        "title": "RunCancelResponse",
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the canceled run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "New status (CANCELED)"
          }
        }
      },
      "AccountListResponse": {
        "title": "AccountListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/AccountListItemResponse"
        },
        "description": "A JSON array of account objects."
      },
      "AccountListItemResponse": {
        "title": "AccountListItemResponse",
        "required": [
          "id",
          "name",
          "url"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Account identifier"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Account name"
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Account website URL"
          },
          "cluster_id": {
            "title": "Cluster Id",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cluster ID"
          },
          "cluster_name": {
            "title": "Cluster Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cluster name"
          },
          "score": {
            "title": "Score",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Market map score"
          },
          "tier": {
            "title": "Tier",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Score tier (score_bin)"
          }
        }
      },
      "MarketMapSummaryResponse": {
        "title": "MarketMapSummaryResponse",
        "required": [
          "reference_count",
          "total_clusters",
          "clustered_accounts",
          "accounts_by_tier"
        ],
        "type": "object",
        "properties": {
          "analyzed_count": {
            "title": "Analyzed Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total accounts analyzed"
          },
          "mapped_count": {
            "title": "Mapped Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accounts placed on the map"
          },
          "reference_count": {
            "title": "Reference Count",
            "type": "integer",
            "description": "Reference (target) accounts"
          },
          "total_clusters": {
            "title": "Total Clusters",
            "type": "integer",
            "description": "Number of clusters"
          },
          "clustered_accounts": {
            "title": "Clustered Accounts",
            "type": "integer",
            "description": "Accounts assigned to a cluster"
          },
          "tier1_count": {
            "title": "Tier1 Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier 1 accounts (from DB)"
          },
          "accounts_by_tier": {
            "title": "Accounts By Tier",
            "type": "object",
            "additionalProperties": true,
            "description": "Account counts keyed by tier (score_bin): {'1': N, '2': N, ...}"
          }
        }
      },
      "ClusterListResponse": {
        "title": "ClusterListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ClusterResponse"
        },
        "description": "A JSON array of cluster objects."
      },
      "ClusterResponse": {
        "title": "ClusterResponse",
        "required": [
          "cluster_id",
          "name",
          "summary",
          "account_count",
          "tier1_count",
          "reference_count"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "title": "Cluster Id",
            "type": "integer",
            "description": "Cluster ID"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Cluster name"
          },
          "summary": {
            "title": "Summary",
            "type": "string",
            "description": "Cluster summary"
          },
          "account_count": {
            "title": "Account Count",
            "type": "integer",
            "description": "Number of accounts in this cluster"
          },
          "tier1_count": {
            "title": "Tier1 Count",
            "type": "integer",
            "description": "Tier 1 accounts in this cluster"
          },
          "reference_count": {
            "title": "Reference Count",
            "type": "integer",
            "description": "Reference (target) accounts in this cluster"
          },
          "average_score": {
            "title": "Average Score",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Average score of accounts in this cluster"
          }
        }
      },
      "ClusterDetailResponse": {
        "title": "ClusterDetailResponse",
        "required": [
          "cluster_id",
          "name",
          "summary",
          "accounts"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "title": "Cluster Id",
            "type": "integer",
            "description": "Cluster ID"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Cluster name"
          },
          "summary": {
            "title": "Summary",
            "type": "string",
            "description": "Cluster summary"
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClusterAccountResponse"
            },
            "description": "Accounts in this cluster"
          }
        }
      },
      "ClusterAccountResponse": {
        "title": "ClusterAccountResponse",
        "required": [
          "cluster_id",
          "account_summary",
          "id",
          "name",
          "target",
          "url",
          "x",
          "y"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "title": "Cluster Id",
            "type": "integer",
            "description": "Cluster ID that the account belongs to"
          },
          "account_summary": {
            "title": "Account Summary",
            "type": "string",
            "description": "Account summary"
          },
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Unique account identifier"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Account name"
          },
          "score": {
            "title": "Score",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Score"
          },
          "score_bin": {
            "title": "Score Bin",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier"
          },
          "target": {
            "title": "Target",
            "type": "boolean",
            "description": "Whether this is a reference (target) account"
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Account website URL"
          },
          "x": {
            "title": "X",
            "type": "number",
            "description": "X coordinate"
          },
          "y": {
            "title": "Y",
            "type": "number",
            "description": "Y coordinate"
          }
        }
      },
      "CreateMarketMapResponse": {
        "title": "CreateMarketMapResponse",
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the newly created market map"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Initial status (PENDING)"
          }
        }
      },
      "CreateMarketMapBody": {
        "title": "CreateMarketMapBody",
        "required": [
          "source",
          "fields"
        ],
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/DataSourceBody",
            "description": "Data source to create the market map from"
          },
          "fields": {
            "$ref": "#/components/schemas/FieldsBody",
            "description": "Field mappings for the source data"
          },
          "discover_urls": {
            "title": "Discover Urls",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Auto-discover website URLs for accounts missing a url mapping",
            "default": false
          },
          "icp": {
            "title": "Icp",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Free-text Ideal Customer Profile description"
          }
        }
      },
      "DataSourceBody": {
        "title": "DataSourceBody",
        "required": [
          "type",
          "id"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "type": "string",
            "description": "Source type. Currently only 'csv' is supported."
          },
          "id": {
            "title": "Id",
            "type": "string",
            "description": "asset://<uuid> URI for the data source (see Assets endpoint)."
          }
        }
      },
      "FieldsBody": {
        "title": "FieldsBody",
        "required": [
          "id",
          "name",
          "target"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Column name for account ID"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Column name for account name"
          },
          "url": {
            "title": "Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column name for account website URL"
          },
          "target": {
            "$ref": "#/components/schemas/TargetFieldBody",
            "description": "Target criteria: the field and values that identify reference accounts"
          },
          "target_weight": {
            "title": "Target Weight",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column name for prioritization weight"
          }
        }
      },
      "TargetFieldBody": {
        "title": "TargetFieldBody",
        "required": [
          "field",
          "values"
        ],
        "type": "object",
        "properties": {
          "field": {
            "title": "Field",
            "type": "string",
            "description": "Column name used for target criteria"
          },
          "values": {
            "title": "Values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Picklist values that identify reference accounts"
          }
        }
      },
      "UpdateMarketMapResponse": {
        "title": "UpdateMarketMapResponse",
        "required": [
          "id",
          "version_id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "UUID of the market map"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string",
            "description": "UUID of the newly created version"
          }
        }
      },
      "UpdateMarketMapBody": {
        "title": "UpdateMarketMapBody",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task display name"
          },
          "icp": {
            "title": "Icp",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Free-text Ideal Customer Profile description"
          },
          "fields": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FieldsBody"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated field mappings (replaces the full fields configuration)"
          },
          "discover_urls": {
            "title": "Discover Urls",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enable/disable URL auto-discovery"
          }
        }
      },
      "AddAccountsResponse": {
        "title": "AddAccountsResponse",
        "required": [
          "status",
          "source_type",
          "source_id"
        ],
        "type": "object",
        "properties": {
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: PENDING"
          },
          "source_type": {
            "title": "Source Type",
            "type": "string",
            "description": "Source type from the request"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string",
            "description": "Source ID from the request"
          },
          "error": {
            "title": "Error",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message if the run could not be started"
          }
        }
      },
      "AddAccountsBody": {
        "title": "AddAccountsBody",
        "required": [
          "source",
          "fields"
        ],
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/DataSourceBody",
            "description": "Data source containing accounts to add"
          },
          "fields": {
            "$ref": "#/components/schemas/AddAccountsFieldsBody",
            "description": "Field mappings for the source data"
          }
        }
      },
      "AddAccountsFieldsBody": {
        "title": "AddAccountsFieldsBody",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Column name for account ID"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Column name for account name"
          },
          "url": {
            "title": "Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column name for account website URL"
          }
        }
      },
      "AccountDetailResponse": {
        "title": "AccountDetailResponse",
        "required": [
          "id",
          "name",
          "url",
          "account_summary",
          "cluster_id",
          "cluster_name",
          "target",
          "attributes"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Unique account identifier"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Account name"
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Account website URL"
          },
          "account_summary": {
            "title": "Account Summary",
            "type": "string",
            "description": "Account summary text"
          },
          "cluster_id": {
            "title": "Cluster Id",
            "type": "integer",
            "description": "Cluster ID the account belongs to"
          },
          "cluster_name": {
            "title": "Cluster Name",
            "type": "string",
            "description": "Cluster display name"
          },
          "score": {
            "title": "Score",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Score (null for unscored/V1 maps)"
          },
          "score_bin": {
            "title": "Score Bin",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier (null for unscored accounts)"
          },
          "target": {
            "title": "Target",
            "type": "boolean",
            "description": "Whether this is a reference (target) account"
          },
          "attributes": {
            "title": "Attributes",
            "type": "object",
            "additionalProperties": true,
            "description": "Custom attributes from STSV export_fields and user-mapped extra fields, as a flat key\u2192value dict"
          }
        }
      },
      "SimilarAccountDetailListResponse": {
        "title": "SimilarAccountDetailListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/SimilarAccountDetailResponse"
        },
        "description": "A JSON array of similar account objects."
      },
      "SimilarAccountDetailResponse": {
        "title": "SimilarAccountDetailResponse",
        "required": [
          "id",
          "name",
          "url",
          "cluster_id",
          "cluster_name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Unique account identifier"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Account name"
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Account website URL"
          },
          "cluster_id": {
            "title": "Cluster Id",
            "type": "integer",
            "description": "Cluster ID the account belongs to"
          },
          "cluster_name": {
            "title": "Cluster Name",
            "type": "string",
            "description": "Cluster display name"
          },
          "score": {
            "title": "Score",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Score"
          },
          "score_bin": {
            "title": "Score Bin",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tier"
          }
        }
      },
      "CRMExportResponse": {
        "title": "CRMExportResponse",
        "required": [
          "job_id",
          "status"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string",
            "description": "UUID of the CRM export job to poll"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Initial status (PENDING)"
          }
        }
      },
      "CRMExportBody": {
        "title": "CRMExportBody",
        "required": [
          "crm_connection_id",
          "field_mappings"
        ],
        "type": "object",
        "properties": {
          "crm_connection_id": {
            "title": "Crm Connection Id",
            "type": "string",
            "description": "UUID of the CRM connection (from GET /api/v1/crm-connections)"
          },
          "field_mappings": {
            "$ref": "#/components/schemas/CRMExportFieldMappings",
            "description": "Maps market map fields to CRM field API names"
          },
          "export_name": {
            "title": "Export Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display label for the export job"
          },
          "export_similar_accounts": {
            "title": "Export Similar Accounts",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Include similar (Tier 2+) accounts. Salesforce only.",
            "default": false
          }
        }
      },
      "CRMExportFieldMappings": {
        "title": "CRMExportFieldMappings",
        "type": "object",
        "properties": {
          "cluster_name": {
            "title": "Cluster Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "CRM field for cluster name"
          },
          "cluster_id": {
            "title": "Cluster Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "CRM field for cluster ID"
          },
          "score": {
            "title": "Score",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "CRM field for market map score"
          },
          "tier": {
            "title": "Tier",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "CRM field for market map tier"
          }
        }
      },
      "CRMExportStatusResponse": {
        "title": "CRMExportStatusResponse",
        "required": [
          "job_id",
          "status"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string",
            "description": "UUID of the CRM export job"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Job status: PENDING, PROCESSING, COMPLETE, or FAILED"
          },
          "results": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CRMExportStatusResults"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present when status is COMPLETE or FAILED"
          }
        }
      },
      "CRMExportStatusResults": {
        "title": "CRMExportStatusResults",
        "type": "object",
        "properties": {
          "updated_count": {
            "title": "Updated Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accounts successfully updated in CRM"
          },
          "failed_count": {
            "title": "Failed Count",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accounts that failed to update"
          }
        }
      },
      "TargetBookListResponse": {
        "title": "TargetBookListResponse",
        "required": [
          "target_books"
        ],
        "type": "object",
        "properties": {
          "target_books": {
            "title": "Target Books",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetBookResponse"
            },
            "description": "List of target book records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "RepResponse": {
        "title": "RepResponse",
        "required": [
          "id",
          "name",
          "is_active",
          "target_book"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce User ID of the rep"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "User.Name"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean",
            "description": "User.IsActive"
          },
          "role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RoleResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "User.UserRole, if assigned"
          },
          "profile": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProfileResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "User.Profile, if any"
          },
          "manager": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagerResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "User.Manager, if assigned"
          },
          "target_book": {
            "$ref": "#/components/schemas/TargetBookSummary"
          },
          "metrics": {
            "title": "Metrics",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Requested metrics keyed by metric name. Null when the caller did not request metrics. Individual values may be null for threshold-dependent metrics when the target book has no Activity Threshold configured."
          }
        }
      },
      "SegmentResponse": {
        "title": "SegmentResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the segment record"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Segment name"
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum capacity"
          },
          "is_locked": {
            "title": "Is Locked",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the segment is locked"
          }
        }
      },
      "TargetBookResponse": {
        "title": "TargetBookResponse",
        "required": [
          "id",
          "name",
          "status",
          "ownership_field",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the target book record"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Target book name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Status: Active or Deleted"
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum account capacity"
          },
          "ownership_field": {
            "title": "Ownership Field",
            "type": "string",
            "description": "Salesforce ownership field API name"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "segments": {
            "title": "Segments",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SegmentResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Segments (present when include_segments=true)"
          },
          "reps": {
            "title": "Reps",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Active reps (present when include_reps=true)"
          }
        }
      },
      "SingleTargetBookResponse": {
        "title": "SingleTargetBookResponse",
        "required": [
          "id",
          "name",
          "status",
          "ownership_field",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the target book record"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Target book name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Status: Active or Deleted"
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum account capacity"
          },
          "ownership_field": {
            "title": "Ownership Field",
            "type": "string",
            "description": "Salesforce ownership field API name"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "activity_threshold": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ActivityThresholdResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Assigned activity threshold (if any)"
          },
          "segments": {
            "title": "Segments",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SegmentDetailResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Segments with their conditions (present when include_segments=true)"
          },
          "reps": {
            "title": "Reps",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Active assigned reps (present when include_reps=true)"
          }
        }
      },
      "ActivityThresholdResponse": {
        "title": "ActivityThresholdResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the threshold definition"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Name of the activity threshold"
          }
        }
      },
      "ConditionResponse": {
        "title": "ConditionResponse",
        "required": [
          "id",
          "number",
          "field",
          "operator"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the condition record"
          },
          "number": {
            "title": "Number",
            "type": "integer",
            "description": "Condition number, used in custom expressions"
          },
          "field": {
            "title": "Field",
            "type": "string",
            "description": "Salesforce field API name"
          },
          "operator": {
            "title": "Operator",
            "type": "string",
            "description": "Comparison operator"
          },
          "value": {
            "title": "Value",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value to compare against"
          }
        }
      },
      "SegmentDetailResponse": {
        "title": "SegmentDetailResponse",
        "required": [
          "id",
          "name",
          "is_locked",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the segment record"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Segment name"
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum capacity"
          },
          "is_locked": {
            "title": "Is Locked",
            "type": "boolean",
            "description": "Whether the segment is locked"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How conditions are combined: AND, OR, or CUSTOM"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom condition expression (e.g. '1 AND (2 OR 3)'), present when conditions_operator is CUSTOM"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionResponse"
            },
            "description": "Conditions for this segment"
          }
        }
      },
      "CreateTargetBookResponse": {
        "title": "CreateTargetBookResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the newly created target book"
          }
        }
      },
      "CreateTargetBookRequest": {
        "title": "CreateTargetBookRequest",
        "required": [
          "name",
          "segments"
        ],
        "type": "object",
        "properties": {
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "ownership_field": {
            "title": "Ownership Field",
            "type": "string",
            "default": "OwnerId"
          },
          "activity_threshold_id": {
            "title": "Activity Threshold Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "segments": {
            "title": "Segments",
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentRequest"
            }
          }
        }
      },
      "ConditionRequest": {
        "title": "ConditionRequest",
        "required": [
          "field",
          "operator",
          "value"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID; present = update existing, absent = create new"
          },
          "field": {
            "title": "Field",
            "type": "string",
            "description": "Salesforce field API name"
          },
          "operator": {
            "title": "Operator",
            "type": "string",
            "description": "Comparison operator"
          },
          "value": {
            "title": "Value",
            "type": "string",
            "description": "Value to compare against"
          }
        }
      },
      "SegmentRequest": {
        "title": "SegmentRequest",
        "required": [
          "name",
          "conditions_operator",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "type": "string"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "conditions": {
            "title": "Conditions",
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionRequest"
            }
          },
          "is_locked": {
            "title": "Is Locked",
            "type": "boolean",
            "default": false
          }
        }
      },
      "AssignRepsResponse": {
        "title": "AssignRepsResponse",
        "required": [
          "reps"
        ],
        "type": "object",
        "properties": {
          "reps": {
            "title": "Reps",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepResponse"
            },
            "description": "Full list of active reps now assigned to this target book"
          }
        }
      },
      "RepIdsRequest": {
        "title": "RepIdsRequest",
        "required": [
          "rep_ids"
        ],
        "type": "object",
        "properties": {
          "rep_ids": {
            "title": "Rep Ids",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Salesforce IDs of reps"
          }
        }
      },
      "UpdateTargetBookRequest": {
        "title": "UpdateTargetBookRequest",
        "type": "object",
        "properties": {
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ownership_field": {
            "title": "Ownership Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "activity_threshold_id": {
            "title": "Activity Threshold Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PutSegmentsRequest": {
        "title": "PutSegmentsRequest",
        "required": [
          "segments"
        ],
        "type": "object",
        "properties": {
          "segments": {
            "title": "Segments",
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentWriteRequest"
            }
          }
        }
      },
      "SegmentWriteRequest": {
        "title": "SegmentWriteRequest",
        "required": [
          "name",
          "conditions_operator",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "type": "string"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "conditions": {
            "title": "Conditions",
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionRequest"
            }
          },
          "is_locked": {
            "title": "Is Locked",
            "type": "boolean",
            "default": false
          },
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID; present = update existing, absent = create new"
          }
        },
        "description": "Segment for PUT /segments. id present = update existing, absent = create new."
      },
      "PatchSegmentRequest": {
        "title": "PatchSegmentRequest",
        "type": "object",
        "properties": {
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "conditions": {
            "title": "Conditions",
            "anyOf": [
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConditionRequest"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_locked": {
            "title": "Is Locked",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RepsResponse": {
        "title": "RepsResponse",
        "required": [
          "reps"
        ],
        "type": "object",
        "properties": {
          "reps": {
            "title": "Reps",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepResponse"
            }
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "ManagerResponse": {
        "title": "ManagerResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "ProfileResponse": {
        "title": "ProfileResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "RoleResponse": {
        "title": "RoleResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "TargetBookSummary": {
        "title": "TargetBookSummary",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "RepAccountsResponse": {
        "title": "RepAccountsResponse",
        "required": [
          "accounts",
          "offset",
          "limit",
          "total"
        ],
        "type": "object",
        "properties": {
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepAccountResponse"
            }
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        }
      },
      "RepAccountResponse": {
        "title": "RepAccountResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "fields": {
            "title": "Fields",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Requested additional Account fields keyed by field name. Null when the caller did not request fields."
          },
          "metrics": {
            "title": "Metrics",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Requested metrics keyed by metric name. Null when the caller did not request metrics. Scalar metrics map to int/float/string; per_activity_count maps to a list of {activity_id, activity_name, count}."
          },
          "children": {
            "title": "Children",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Child accounts rolled up under this account when hierarchy_rollup_enabled is true. Null when hierarchy rollup is not enabled."
          }
        }
      },
      "RepOpportunitiesResponse": {
        "title": "RepOpportunitiesResponse",
        "required": [
          "opportunities",
          "offset",
          "limit",
          "total"
        ],
        "type": "object",
        "properties": {
          "opportunities": {
            "title": "Opportunities",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepOpportunityResponse"
            }
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        }
      },
      "OppAccountSummary": {
        "title": "OppAccountSummary",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "OppUserSummary": {
        "title": "OppUserSummary",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        }
      },
      "RepOpportunityResponse": {
        "title": "RepOpportunityResponse",
        "required": [
          "id",
          "name",
          "account",
          "owner",
          "creator",
          "stage_name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "account": {
            "$ref": "#/components/schemas/OppAccountSummary"
          },
          "owner": {
            "$ref": "#/components/schemas/OppUserSummary"
          },
          "creator": {
            "$ref": "#/components/schemas/OppUserSummary",
            "description": "Reflects the configured opportunity creator field, falling back to CreatedById."
          },
          "type": {
            "title": "Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "stage_name": {
            "title": "Stage Name",
            "type": "string"
          },
          "amount": {
            "title": "Amount",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reflects the configured opportunity value field. Null when no opportunity value field is configured."
          }
        }
      },
      "RepChartResponse": {
        "title": "RepChartResponse",
        "required": [
          "chart",
          "start_date",
          "end_date",
          "data"
        ],
        "type": "object",
        "properties": {
          "chart": {
            "title": "Chart",
            "type": "string",
            "description": "Chart identifier (e.g. activities-by-day)"
          },
          "start_date": {
            "title": "Start Date",
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "title": "End Date",
            "type": "string",
            "format": "date"
          },
          "data": {
            "title": "Data",
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Map of YYYY-MM-DD \u2192 count for that day. Days with zero activity are gap-filled with 0."
          }
        }
      },
      "DistributionTemplateListResponse": {
        "title": "DistributionTemplateListResponse",
        "required": [
          "templates"
        ],
        "type": "object",
        "properties": {
          "templates": {
            "title": "Templates",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DistributionTemplateResponse"
            },
            "description": "List of distribution template records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "DistributionTemplateResponse": {
        "title": "DistributionTemplateResponse",
        "required": [
          "id",
          "name",
          "created_at",
          "updated_at",
          "recipients",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Distribution template id"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Template name"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientResponse"
            },
            "description": "Recipients assigned to this template \u2014 active reps or active target books"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How conditions are combined: AND, OR, or CUSTOM"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom condition expression (e.g. '1 AND (2 OR 3)'), present when conditions_operator is CUSTOM"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionResponse"
            },
            "description": "Conditions for this template"
          }
        }
      },
      "RecipientResponse": {
        "title": "RecipientResponse",
        "required": [
          "type",
          "id"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "type": "string",
            "description": "Recipient type: 'Rep' or 'Target Book'"
          },
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the recipient"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name"
          }
        },
        "description": "A distribution recipient (rep or target book)."
      },
      "DistributionDetailResponse": {
        "title": "DistributionDetailResponse",
        "required": [
          "id",
          "name",
          "status",
          "is_template",
          "created_at",
          "updated_at",
          "recipients",
          "conditions",
          "ranking",
          "update_fields"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the distribution definition"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Distribution name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Status: Active or Deleted"
          },
          "is_template": {
            "title": "Is Template",
            "type": "boolean",
            "description": "Whether this is a template definition"
          },
          "distribution_type": {
            "title": "Distribution Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Distribution method, e.g. Round Robin"
          },
          "distribution_amount": {
            "title": "Distribution Amount",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of records to distribute per recipient"
          },
          "source": {
            "title": "Source",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record source, e.g. ACCOUNT_POOL or USER"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientResponse"
            },
            "description": "Recipients: active reps or active target books"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How conditions are combined: AND, OR, or CUSTOM"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom condition expression (e.g. '1 AND (2 OR 3)'), present when conditions_operator is CUSTOM"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionResponse"
            },
            "description": "Eligibility conditions"
          },
          "ranking": {
            "title": "Ranking",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RankingConditionResponse"
            },
            "description": "Ranking criteria"
          },
          "update_fields": {
            "title": "Update Fields",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateFieldResponse"
            },
            "description": "Fields to update on distributed records"
          },
          "schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScheduleResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Schedule configuration (null if no schedule)"
          },
          "gw_list": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GWListResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked Gradient Works list (null if none)"
          },
          "source_users": {
            "title": "Source Users",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceUserResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Source users: account pool users when source is ACCOUNT_POOL, the single source user when source is USER, null otherwise"
          },
          "assignment_order": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentOrderResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Round-robin assignment order with next-up indicator (null if no round-robin entries exist)"
          }
        }
      },
      "AssignmentOrderEntryResponse": {
        "title": "AssignmentOrderEntryResponse",
        "required": [
          "position"
        ],
        "type": "object",
        "properties": {
          "position": {
            "title": "Position",
            "type": "integer",
            "description": "1-based position in the assignment order"
          },
          "rep": {
            "title": "Rep",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rep display name"
          },
          "target_book": {
            "title": "Target Book",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target book name"
          }
        },
        "description": "A single entry in the round-robin assignment order."
      },
      "AssignmentOrderResponse": {
        "title": "AssignmentOrderResponse",
        "required": [
          "entries"
        ],
        "type": "object",
        "properties": {
          "start_position": {
            "title": "Start Position",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "1-based position of the next rep to be assigned"
          },
          "entries": {
            "title": "Entries",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignmentOrderEntryResponse"
            },
            "description": "Ordered list of reps in assignment order"
          }
        },
        "description": "Round-robin assignment order for a distribution definition."
      },
      "GWListResponse": {
        "title": "GWListResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Gradient Works list ID"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "List name"
          },
          "source": {
            "title": "Source",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "List source"
          }
        },
        "description": "Gradient Works list linked to a definition."
      },
      "RankingConditionResponse": {
        "title": "RankingConditionResponse",
        "required": [
          "id",
          "number",
          "field",
          "order"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the ranking condition"
          },
          "number": {
            "title": "Number",
            "type": "integer",
            "description": "Ranking position number"
          },
          "field": {
            "title": "Field",
            "type": "string",
            "description": "Salesforce field API name to rank by"
          },
          "order": {
            "title": "Order",
            "type": "string",
            "description": "Sort order: ASC or DESC"
          }
        },
        "description": "A ranking criterion (field + sort order)."
      },
      "ScheduleResponse": {
        "title": "ScheduleResponse",
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "type": "string",
            "description": "Schedule type: 'one_time' or 'recurring'"
          },
          "next_run_time": {
            "title": "Next Run Time",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 next scheduled run time"
          },
          "interval": {
            "title": "Interval",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recurrence interval (only for recurring)"
          },
          "interval_type": {
            "title": "Interval Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recurrence interval unit, e.g. 'Days' (only for recurring)"
          },
          "enabled": {
            "title": "Enabled",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the recurring schedule is active (only for recurring)"
          }
        },
        "description": "Schedule configuration for a definition."
      },
      "SourceUserResponse": {
        "title": "SourceUserResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce User ID"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User display name"
          }
        },
        "description": "A source user (account pool member or explicit source user)."
      },
      "UpdateFieldResponse": {
        "title": "UpdateFieldResponse",
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the field record"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Salesforce field API name to update"
          },
          "value": {
            "title": "Value",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value to set"
          },
          "data_type": {
            "title": "Data Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Data type of the field"
          }
        },
        "description": "A field update applied during distribution/retrieval."
      },
      "DistributionRunListResponse": {
        "title": "DistributionRunListResponse",
        "required": [
          "runs"
        ],
        "type": "object",
        "properties": {
          "runs": {
            "title": "Runs",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DistributionRunResponse"
            },
            "description": "List of distribution run records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "DefinitionResponse": {
        "title": "DefinitionResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the definition"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Definition name"
          }
        },
        "description": "Reference to the definition that produced this run."
      },
      "DistributionRunResponse": {
        "title": "DistributionRunResponse",
        "required": [
          "id",
          "definition",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Run record ID"
          },
          "definition": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Distribution definition that produced this run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: Pending, In Progress, Completed, or Failed"
          },
          "status_message": {
            "title": "Status Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status message (typically set on failure)"
          },
          "distributed_at": {
            "title": "Distributed At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp when distribution ran"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-modified timestamp"
          },
          "distributed_count": {
            "title": "Distributed Count",
            "type": "integer",
            "description": "Total accounts assigned in this run",
            "default": 0
          }
        }
      },
      "DistributionRunDetailResponse": {
        "title": "DistributionRunDetailResponse",
        "required": [
          "id",
          "definition",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Run record ID"
          },
          "definition": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Distribution definition that produced this run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: Pending, In Progress, Completed, or Failed"
          },
          "status_message": {
            "title": "Status Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status message (typically set on failure)"
          },
          "run_source": {
            "title": "Run Source",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the distribution was triggered"
          },
          "distributed_at": {
            "title": "Distributed At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp when distribution ran"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-modified timestamp"
          },
          "distributed_count": {
            "title": "Distributed Count",
            "type": "integer",
            "description": "Total accounts assigned in this run",
            "default": 0
          },
          "market_coverage_report": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketCoverageReportResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked market coverage report (null if none)"
          }
        }
      },
      "MarketCoverageReportResponse": {
        "title": "MarketCoverageReportResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the report definition"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Report name"
          }
        },
        "description": "Reference to a market coverage report."
      },
      "AssignmentListResponse": {
        "title": "AssignmentListResponse",
        "required": [
          "assignments"
        ],
        "type": "object",
        "properties": {
          "assignments": {
            "title": "Assignments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignmentResponse"
            },
            "description": "Assignment records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned."
          }
        }
      },
      "AssignmentFlowResponse": {
        "title": "AssignmentFlowResponse",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the flow that ran"
          },
          "version": {
            "title": "Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version of the flow that ran"
          },
          "version_durable_id": {
            "title": "Version Durable Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Durable ID of the flow version"
          },
          "interview_guid": {
            "title": "Interview Guid",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GUID of the flow interview"
          }
        },
        "description": "Flow context for an assignment triggered by a Salesforce Flow."
      },
      "AssignmentOwnerResponse": {
        "title": "AssignmentOwnerResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce User ID"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User display name"
          }
        },
        "description": "Owner reference on an assignment."
      },
      "AssignmentQueueResponse": {
        "title": "AssignmentQueueResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce Queue ID"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Queue name"
          },
          "item_id": {
            "title": "Item Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the associated Gradient Works queue item"
          }
        },
        "description": "Queue context for a Queue-type assignment."
      },
      "AssignmentRecordResponse": {
        "title": "AssignmentRecordResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the assigned record"
          },
          "type": {
            "title": "Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce object type (Account, Contact, Lead, Opportunity)"
          },
          "field": {
            "title": "Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce field updated by the assignment"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the assigned record"
          }
        },
        "description": "The CRM record that was assigned."
      },
      "AssignmentResponse": {
        "title": "AssignmentResponse",
        "required": [
          "id",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the assignment record"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record name"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-modified timestamp"
          },
          "assignment_type": {
            "title": "Assignment Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Assignment type: Queue, Direct, or Other"
          },
          "assigned_time": {
            "title": "Assigned Time",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp when the assignment was made"
          },
          "assigned_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentOwnerResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "User who triggered the assignment"
          },
          "record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentRecordResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The CRM record that was assigned"
          },
          "new_owner": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentOwnerResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "User the record was assigned to"
          },
          "previous_owner": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentOwnerResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Previous owner (null if record had no prior owner)"
          },
          "queue": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentQueueResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Queue context (null for non-Queue assignments)"
          },
          "request_id": {
            "title": "Request Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Request ID associated with this assignment"
          },
          "flow": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentFlowResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow context (null when the assignment was not triggered by a Salesforce Flow)"
          },
          "distribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentRunResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Distribution run that produced this assignment (null if not from a distribution)"
          },
          "retrieval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssignmentRunResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Retrieval run that produced this assignment (null if not from a retrieval)"
          },
          "detail": {
            "title": "Detail",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional assignment detail"
          },
          "book_definition_matches": {
            "title": "Book Definition Matches",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BookDefinitionMatchResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Target books and segments matched for this assignment. Only populated for distribution assignments when include_book_matches=true; null for retrievals and manual or queue assignments."
          }
        },
        "description": "A single assignment record."
      },
      "AssignmentRunResponse": {
        "title": "AssignmentRunResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the run"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the distribution or retrieval definition"
          }
        },
        "description": "A distribution or retrieval run linked to an assignment."
      },
      "BookDefinitionMatchResponse": {
        "title": "BookDefinitionMatchResponse",
        "required": [
          "id",
          "book_definition",
          "segment"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the match record"
          },
          "book_definition": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Target book that matched"
          },
          "segment": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Segment within the target book"
          }
        },
        "description": "A target book + segment match for an assignment."
      },
      "QueueListResponse": {
        "title": "QueueListResponse",
        "required": [
          "queues"
        ],
        "type": "object",
        "properties": {
          "queues": {
            "title": "Queues",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueResponse"
            },
            "description": "List of queue records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "CapacityMeterRef": {
        "title": "CapacityMeterRef",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the capacity meter"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Capacity meter name"
          }
        }
      },
      "QueueResponse": {
        "title": "QueueResponse",
        "required": [
          "id",
          "name",
          "assignment_policy",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the queue record"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Queue name"
          },
          "type": {
            "title": "Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Raw value of the Salesforce Type__c field. Typically null (standard queue) or 'Target Book' (target book queue); other values may appear if set directly in Salesforce."
          },
          "assignment_policy": {
            "title": "Assignment Policy",
            "type": "string",
            "description": "Assignment policy: Adaptive, Round Robin, or Schedule First Available"
          },
          "assignment_field": {
            "title": "Assignment Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Field on the assigned record that stores the assigned user"
          },
          "capacity_meter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CapacityMeterRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked capacity meter (null if none)"
          },
          "last_assignment_time": {
            "title": "Last Assignment Time",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp of the most recent assignment"
          },
          "next_slot_index": {
            "title": "Next Slot Index",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Next round-robin slot index"
          },
          "post_assignment_automation": {
            "title": "Post Assignment Automation",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "API name of a Flow to execute after assignments complete for this queue"
          },
          "async_assignment": {
            "title": "Async Assignment",
            "type": "boolean",
            "description": "Whether assignments for this queue are always performed asynchronously. Target book queues always use asynchronous assignment.",
            "default": false
          },
          "standard_queue_id": {
            "title": "Standard Queue Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce ID of the linked standard Group (Queue)"
          },
          "user_weight_field": {
            "title": "User Weight Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Field on User used to weight round-robin distribution"
          },
          "user_maximum_capacity": {
            "title": "User Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Default maximum capacity per user for this queue's members"
          },
          "user_maximum_capacity_field": {
            "title": "User Maximum Capacity Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "DEPRECATED \u2014 name of the field on User formerly used to source per-user maximum capacity. No longer read by the managed package; retained for troubleshooting only."
          },
          "user_used_capacity_field": {
            "title": "User Used Capacity Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "DEPRECATED \u2014 name of the field on User formerly used to source per-user used capacity. No longer read by the managed package; retained for troubleshooting only."
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          }
        }
      },
      "QueueDetailResponse": {
        "title": "QueueDetailResponse",
        "required": [
          "queue",
          "queue_users",
          "queue_slots",
          "target_books"
        ],
        "type": "object",
        "properties": {
          "queue": {
            "$ref": "#/components/schemas/QueueResponse",
            "description": "Queue configuration"
          },
          "queue_users": {
            "title": "Queue Users",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueUserResponse"
            },
            "description": "Queue user members of this queue, sorted ascending by the linked Salesforce User's Name. Empty list when the queue has no members."
          },
          "queue_slots": {
            "title": "Queue Slots",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueSlotResponse"
            },
            "description": "Round-robin slot ordering, sorted ascending by slot index. A queue user with weight > 1 occupies more than one slot. Join slots back to members via queue_user.id == queue_users[].id."
          },
          "target_books": {
            "title": "Target Books",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetBookRef"
            },
            "description": "Active target books served by this queue, sorted ascending by name. Always empty for standard queues (type != 'Target Book')."
          }
        }
      },
      "QueueSlotResponse": {
        "title": "QueueSlotResponse",
        "required": [
          "index",
          "queue_user"
        ],
        "type": "object",
        "properties": {
          "index": {
            "title": "Index",
            "type": "integer",
            "description": "0-based round-robin slot index"
          },
          "queue_user": {
            "$ref": "#/components/schemas/QueueUserRef",
            "description": "The queue user that occupies this slot. `id` is the queue user ID (join against queue_users[].id); `name` is the linked Salesforce User's Name."
          }
        }
      },
      "QueueUserRef": {
        "title": "QueueUserRef",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the referenced record"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name (null if the relationship is empty)"
          }
        }
      },
      "QueueUserResponse": {
        "title": "QueueUserResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the queue user record"
          },
          "user": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueueUserRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked Salesforce User (id + name). Null when the underlying Salesforce User has been deleted."
          },
          "status": {
            "title": "Status",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Raw Salesforce Status__c value: 'Available' or 'Unavailable'"
          },
          "weight": {
            "title": "Weight",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Round-robin weight (higher weight yields more queue slots)"
          },
          "last_assignment_time": {
            "title": "Last Assignment Time",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp of the most recent assignment"
          },
          "maximum_capacity": {
            "title": "Maximum Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per-user maximum capacity for this queue"
          },
          "used_capacity": {
            "title": "Used Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Currently used capacity"
          },
          "available_capacity": {
            "title": "Available Capacity",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Remaining capacity (formula field; null when capacity fields are unset)"
          },
          "target_book": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TargetBookRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target book this queue user is tied to, if any. Null when unset or when the underlying target book was deleted."
          },
          "working_hours_start": {
            "title": "Working Hours Start",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start of working hours window"
          },
          "working_hours_end": {
            "title": "Working Hours End",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "End of working hours window"
          },
          "unavailable_until_time": {
            "title": "Unavailable Until Time",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "If set, the user is marked unavailable until this ISO-8601 timestamp"
          },
          "skip_next_times": {
            "title": "Skip Next Times",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of upcoming round-robin turns this user will skip"
          }
        }
      },
      "TargetBookRef": {
        "title": "TargetBookRef",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the target book"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target book name (null if the target book was deleted)"
          }
        }
      },
      "RetrievalTemplateListResponse": {
        "title": "RetrievalTemplateListResponse",
        "required": [
          "templates"
        ],
        "type": "object",
        "properties": {
          "templates": {
            "title": "Templates",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetrievalTemplateResponse"
            },
            "description": "List of retrieval template records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "RetrievalTemplateResponse": {
        "title": "RetrievalTemplateResponse",
        "required": [
          "id",
          "name",
          "created_at",
          "updated_at",
          "retrieve_from",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Retrieval template id"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Template name"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "retrieve_from": {
            "title": "Retrieve From",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetrieveFromResponse"
            },
            "description": "Sources to retrieve from \u2014 reps or target books, including inactive reps"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How conditions are combined: AND, OR, or CUSTOM"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom condition expression (e.g. '1 AND (2 OR 3)'), present when conditions_operator is CUSTOM"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionResponse"
            },
            "description": "Conditions for this template"
          }
        }
      },
      "RetrieveFromResponse": {
        "title": "RetrieveFromResponse",
        "required": [
          "type",
          "id"
        ],
        "type": "object",
        "properties": {
          "type": {
            "title": "Type",
            "type": "string",
            "description": "Source type: 'Rep' or 'Target Book'"
          },
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the source"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name"
          }
        },
        "description": "A retrieval source (rep or target book)."
      },
      "RetrievalDetailResponse": {
        "title": "RetrievalDetailResponse",
        "required": [
          "id",
          "name",
          "status",
          "is_template",
          "created_at",
          "updated_at",
          "retrieve_from",
          "conditions",
          "ranking",
          "update_fields"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the retrieval definition"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Retrieval name"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Status: Active or Deleted"
          },
          "is_template": {
            "title": "Is Template",
            "type": "boolean",
            "description": "Whether this is a template definition"
          },
          "ownership_field": {
            "title": "Ownership Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce field API name for ownership assignment"
          },
          "max_retrieval_amount": {
            "title": "Max Retrieval Amount",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum number of records to retrieve per source"
          },
          "retrieval_type": {
            "title": "Retrieval Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Retrieval type: On Book or Off Book"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-updated timestamp"
          },
          "retrieve_from": {
            "title": "Retrieve From",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetrieveFromResponse"
            },
            "description": "Sources to retrieve from: active reps or active target books"
          },
          "conditions_operator": {
            "title": "Conditions Operator",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How conditions are combined: AND, OR, or CUSTOM"
          },
          "custom_condition_logic": {
            "title": "Custom Condition Logic",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom condition expression (e.g. '1 AND (2 OR 3)'), present when conditions_operator is CUSTOM"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionResponse"
            },
            "description": "Eligibility conditions"
          },
          "ranking": {
            "title": "Ranking",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RankingConditionResponse"
            },
            "description": "Ranking criteria"
          },
          "update_fields": {
            "title": "Update Fields",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateFieldResponse"
            },
            "description": "Fields to update on retrieved records"
          },
          "schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScheduleResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Schedule configuration (null if no schedule)"
          },
          "new_owners": {
            "title": "New Owners",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceUserResponse"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "New owners: account pool users when source is ACCOUNT_POOL, the configured source user when source is USER, null otherwise"
          }
        }
      },
      "RetrievalRunListResponse": {
        "title": "RetrievalRunListResponse",
        "required": [
          "runs"
        ],
        "type": "object",
        "properties": {
          "runs": {
            "title": "Runs",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetrievalRunResponse"
            },
            "description": "List of retrieval run records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "RetrievalRunResponse": {
        "title": "RetrievalRunResponse",
        "required": [
          "id",
          "definition",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Run record ID"
          },
          "definition": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Retrieval definition that produced this run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: Pending, In Progress, Completed, or Failed"
          },
          "status_message": {
            "title": "Status Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status message (typically set on failure)"
          },
          "retrieved_at": {
            "title": "Retrieved At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp when retrieval ran"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-modified timestamp"
          },
          "retrieved_count": {
            "title": "Retrieved Count",
            "type": "integer",
            "description": "Total accounts retrieved in this run",
            "default": 0
          }
        }
      },
      "RetrievalRunDetailResponse": {
        "title": "RetrievalRunDetailResponse",
        "required": [
          "id",
          "definition",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Run record ID"
          },
          "definition": {
            "$ref": "#/components/schemas/DefinitionResponse",
            "description": "Retrieval definition that produced this run"
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Run status: Pending, In Progress, Completed, or Failed"
          },
          "status_message": {
            "title": "Status Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status message (typically set on failure)"
          },
          "run_source": {
            "title": "Run Source",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the retrieval was triggered"
          },
          "retrieved_at": {
            "title": "Retrieved At",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp when retrieval ran"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "description": "ISO-8601 last-modified timestamp"
          },
          "retrieved_count": {
            "title": "Retrieved Count",
            "type": "integer",
            "description": "Total accounts retrieved in this run",
            "default": 0
          },
          "market_coverage_report": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketCoverageReportResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked market coverage report (null if none)"
          },
          "flow": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FlowResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow execution details (null if no flow fields populated)"
          }
        }
      },
      "FlowResponse": {
        "title": "FlowResponse",
        "type": "object",
        "properties": {
          "interview_guid": {
            "title": "Interview Guid",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow interview GUID"
          },
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow name"
          },
          "version": {
            "title": "Version",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow version number"
          },
          "version_view_durable_id": {
            "title": "Version View Durable Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow version view durable ID"
          }
        },
        "description": "Flow execution details for a retrieval run."
      },
      "ProjectListResponse": {
        "title": "ProjectListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ProjectListItemResponse"
        }
      },
      "ProjectListItemResponse": {
        "title": "ProjectListItemResponse",
        "required": [
          "id",
          "name",
          "status",
          "is_sample",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_sample": {
            "title": "Is Sample",
            "type": "boolean"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        }
      },
      "CreateProjectRequest": {
        "title": "CreateProjectRequest",
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Name for the new project"
          }
        }
      },
      "ProjectDataSourceListResponse": {
        "title": "ProjectDataSourceListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ProjectDataSourceResponse"
        }
      },
      "ProjectDataSourceResponse": {
        "title": "ProjectDataSourceResponse",
        "required": [
          "id",
          "name",
          "type",
          "is_primary",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "type": "string"
          },
          "is_primary": {
            "title": "Is Primary",
            "type": "boolean"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        }
      },
      "AttachDataSourceRequest": {
        "title": "AttachDataSourceRequest",
        "required": [
          "source"
        ],
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/DataSourceBody",
            "description": "The data source to attach to the project."
          },
          "use_credits": {
            "title": "Use Credits",
            "type": "boolean",
            "description": "When true, and the data source exceeds the project row limit, charge credits to expand the limit rather than rejecting the request. Credits are charged only for rows above the current limit at the rate of 1 credit per 10 rows. The request is rejected with 422 if the account has insufficient credits.",
            "default": false
          }
        }
      },
      "ReplaceDataSourceRequest": {
        "title": "ReplaceDataSourceRequest",
        "required": [
          "source"
        ],
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/DataSourceBody",
            "description": "The replacement data source. Must be the same type as the existing data source."
          },
          "use_credits": {
            "title": "Use Credits",
            "type": "boolean",
            "description": "When true, and the data source exceeds the project row limit, charge credits to expand the limit rather than rejecting the request. Credits are charged only for rows above the current limit at the rate of 1 credit per 10 rows. The request is rejected with 422 if the account has insufficient credits.",
            "default": false
          }
        }
      },
      "RemoveDataSourceResponse": {
        "title": "RemoveDataSourceResponse",
        "required": [
          "data_source_id",
          "project_id"
        ],
        "type": "object",
        "properties": {
          "data_source_id": {
            "title": "Data Source Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          }
        }
      },
      "DataSourceDownloadResponse": {
        "title": "DataSourceDownloadResponse",
        "required": [
          "download_url",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          }
        }
      },
      "ProjectScenarioListResponse": {
        "title": "ProjectScenarioListResponse",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ProjectScenarioResponse"
        }
      },
      "ProjectScenarioResponse": {
        "title": "ProjectScenarioResponse",
        "required": [
          "id",
          "name",
          "is_executed",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "is_executed": {
            "title": "Is Executed",
            "type": "boolean"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Short human-readable summary of the scenario."
          },
          "description_is_user_set": {
            "title": "Description Is User Set",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "True if the description was explicitly set by a user."
          }
        }
      },
      "CreateScenarioResponse": {
        "title": "CreateScenarioResponse",
        "required": [
          "scenario_id",
          "project_id",
          "message",
          "intro_message",
          "carve_status"
        ],
        "type": "object",
        "properties": {
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "intro_message": {
            "title": "Intro Message",
            "type": "string",
            "description": "The Carve agent's opening message for the new scenario."
          },
          "carve_status": {
            "title": "Carve Status",
            "enum": [
              "draft",
              "completed",
              "in_progress"
            ],
            "type": "string",
            "description": "The new scenario's carve status."
          }
        }
      },
      "CreateScenarioRequest": {
        "title": "CreateScenarioRequest",
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Scenario name."
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "maxLength": 150,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Short and concise scenario description"
          }
        }
      },
      "AccountSheetDownloadResponse": {
        "title": "AccountSheetDownloadResponse",
        "required": [
          "download_url",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          }
        }
      },
      "AccountSheetSchemaResponse": {
        "title": "AccountSheetSchemaResponse",
        "required": [
          "fields",
          "primary_key"
        ],
        "type": "object",
        "properties": {
          "fields": {
            "title": "Fields",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSheetFieldResponse"
            }
          },
          "primary_key": {
            "title": "Primary Key",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AccountSheetFieldResponse": {
        "title": "AccountSheetFieldResponse",
        "required": [
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ResetScenarioAccountSheetResponse": {
        "title": "ResetScenarioAccountSheetResponse",
        "required": [
          "project_id",
          "scenario_id"
        ],
        "type": "object",
        "properties": {
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          }
        }
      },
      "AccountSheetRefreshPreviewResponse": {
        "title": "AccountSheetRefreshPreviewResponse",
        "required": [
          "removed",
          "added",
          "updated"
        ],
        "type": "object",
        "properties": {
          "removed": {
            "title": "Removed",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "added": {
            "title": "Added",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updated": {
            "title": "Updated",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AccountSheetRefreshResponse": {
        "title": "AccountSheetRefreshResponse",
        "required": [
          "project_id"
        ],
        "type": "object",
        "properties": {
          "project_id": {
            "title": "Project Id",
            "type": "string"
          }
        }
      },
      "ScenarioOverrideResponse": {
        "title": "ScenarioOverrideResponse",
        "required": [
          "project_id",
          "scenario_id",
          "changes"
        ],
        "type": "object",
        "properties": {
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "changes": {
            "title": "Changes",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioOverrideChange"
            }
          }
        }
      },
      "ScenarioOverrideChange": {
        "title": "ScenarioOverrideChange",
        "required": [
          "row_key",
          "prior_result",
          "prior_rationale",
          "result",
          "rationale"
        ],
        "type": "object",
        "properties": {
          "row_key": {
            "title": "Row Key",
            "type": "integer"
          },
          "prior_result": {
            "title": "Prior Result",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prior_rationale": {
            "title": "Prior Rationale",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "title": "Result",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rationale": {
            "title": "Rationale",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ScenarioOverrideRequest": {
        "title": "ScenarioOverrideRequest",
        "required": [
          "overrides"
        ],
        "type": "object",
        "properties": {
          "overrides": {
            "title": "Overrides",
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioOverrideRequestRow"
            }
          }
        }
      },
      "ScenarioOverrideRequestRow": {
        "title": "ScenarioOverrideRequestRow",
        "required": [
          "row_key",
          "result"
        ],
        "type": "object",
        "properties": {
          "row_key": {
            "title": "Row Key",
            "minimum": 0.0,
            "type": "integer",
            "description": "gw_row_number of the row to override"
          },
          "result": {
            "title": "Result",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New result value. Send null to clear this row's override. Empty string is rejected \u2014 use null to clear."
          },
          "rationale": {
            "title": "Rationale",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional rationale. Ignored when result is null. Auto-generated if omitted or null and result is a string."
          }
        }
      },
      "CloneScenarioResponse": {
        "title": "CloneScenarioResponse",
        "required": [
          "scenario_id",
          "project_id",
          "message"
        ],
        "type": "object",
        "properties": {
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        }
      },
      "CloneScenarioRequest": {
        "title": "CloneScenarioRequest",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name for the cloned scenario. Defaults to '{source name} (copy)' if omitted."
          }
        }
      },
      "RenameScenarioResponse": {
        "title": "RenameScenarioResponse",
        "required": [
          "scenario_id",
          "project_id",
          "name",
          "message"
        ],
        "type": "object",
        "properties": {
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        }
      },
      "RenameScenarioRequest": {
        "title": "RenameScenarioRequest",
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "New name for the scenario."
          }
        }
      },
      "DeleteScenarioResponse": {
        "title": "DeleteScenarioResponse",
        "required": [
          "scenario_id",
          "project_id",
          "message"
        ],
        "type": "object",
        "properties": {
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        }
      },
      "UpdateScenarioDescriptionResponse": {
        "title": "UpdateScenarioDescriptionResponse",
        "required": [
          "scenario_id",
          "project_id",
          "description",
          "message"
        ],
        "type": "object",
        "properties": {
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        }
      },
      "UpdateScenarioDescriptionRequest": {
        "title": "UpdateScenarioDescriptionRequest",
        "type": "object",
        "properties": {
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New description. Pass null to clear it."
          }
        }
      },
      "DeployProjectResponse": {
        "title": "DeployProjectResponse",
        "required": [
          "job_id",
          "status"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        }
      },
      "DeploySalesforceRequest": {
        "title": "DeploySalesforceRequest",
        "required": [
          "crm_connection_id",
          "field_mappings"
        ],
        "type": "object",
        "properties": {
          "crm_connection_id": {
            "title": "Crm Connection Id",
            "type": "string",
            "format": "uuid"
          },
          "field_mappings": {
            "$ref": "#/components/schemas/DeployFieldMappings"
          },
          "create_target_books": {
            "title": "Create Target Books",
            "type": "boolean",
            "description": "If true, create Gradient Works target books from the export results.",
            "default": false
          },
          "target_book_ownership_field": {
            "title": "Target Book Ownership Field",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Salesforce field used to assign ownership when creating target books."
          },
          "additional_field_updates": {
            "title": "Additional Field Updates",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeployAdditionalFieldUpdate"
            },
            "default": []
          }
        }
      },
      "DeployAdditionalFieldUpdate": {
        "title": "DeployAdditionalFieldUpdate",
        "required": [
          "field",
          "value"
        ],
        "type": "object",
        "properties": {
          "field": {
            "title": "Field",
            "type": "string",
            "description": "Salesforce field name to update. Must differ from `field_mappings.update_field`."
          },
          "value": {
            "title": "Value",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "Value to write into the Salesforce field. String values must be non-empty."
          }
        }
      },
      "DeployFieldMappings": {
        "title": "DeployFieldMappings",
        "required": [
          "account_sheet_column",
          "match_field",
          "update_field"
        ],
        "type": "object",
        "properties": {
          "account_sheet_column": {
            "title": "Account Sheet Column",
            "type": "string",
            "description": "Column name from the scenario account sheet used to match account sheet rows to CRM records (e.g. the account ID or a unique identifier field). Use `GET /<project_id>/scenarios/<scenario_id>/account-sheet/schema` to discover available column names."
          },
          "match_field": {
            "title": "Match Field",
            "type": "string",
            "description": "Salesforce field used to match account sheet rows to CRM records (e.g. the account ID or a unique identifier field). Use `GET /api/v1/crm-connections/{crm_connection_id}/metadata` to discover valid field names."
          },
          "update_field": {
            "title": "Update Field",
            "type": "string",
            "description": "Salesforce field to write the account sheet column value into on each matched record. Must differ from any field listed in `additional_field_updates`. For lookup fields, records are matched using the Name field on the referenced object (e.g. User Name). Duplicate or unmatched records are skipped."
          }
        }
      },
      "DeployHubspotRequest": {
        "title": "DeployHubspotRequest",
        "required": [
          "crm_connection_id",
          "property_mappings"
        ],
        "type": "object",
        "properties": {
          "crm_connection_id": {
            "title": "Crm Connection Id",
            "type": "string",
            "format": "uuid"
          },
          "property_mappings": {
            "$ref": "#/components/schemas/DeployHubspotPropertyMappings"
          },
          "additional_property_updates": {
            "title": "Additional Property Updates",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeployAdditionalPropertyUpdate"
            },
            "default": []
          }
        }
      },
      "DeployAdditionalPropertyUpdate": {
        "title": "DeployAdditionalPropertyUpdate",
        "required": [
          "property",
          "value"
        ],
        "type": "object",
        "properties": {
          "property": {
            "title": "Property",
            "type": "string",
            "description": "HubSpot property name to update. Must differ from `property_mappings.update_property`."
          },
          "value": {
            "title": "Value",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "Value to write into the HubSpot property. String values must be non-empty."
          }
        }
      },
      "DeployHubspotPropertyMappings": {
        "title": "DeployHubspotPropertyMappings",
        "required": [
          "account_sheet_column",
          "match_property",
          "update_property"
        ],
        "type": "object",
        "properties": {
          "account_sheet_column": {
            "title": "Account Sheet Column",
            "type": "string",
            "description": "Column name from the scenario account sheet used to match account sheet rows to CRM records (e.g. the account ID or a unique identifier field). Use `GET /<project_id>/scenarios/<scenario_id>/account-sheet/schema` to discover available column names."
          },
          "match_property": {
            "title": "Match Property",
            "type": "string",
            "description": "HubSpot property used to match account sheet rows to CRM records (e.g. the account ID or a unique identifier property). Use `GET /api/v1/crm-connections/{crm_connection_id}/metadata` to discover valid property names."
          },
          "update_property": {
            "title": "Update Property",
            "type": "string",
            "description": "HubSpot property to write the account sheet column value into on each matched record. Must differ from any property listed in `additional_property_updates`. For lookup properties, records are matched using the Name field on the referenced object (e.g. User Name). Duplicate or unmatched records are skipped."
          }
        }
      },
      "DeployJobStatusResponse": {
        "title": "DeployJobStatusResponse",
        "required": [
          "job_id",
          "status",
          "export_name",
          "scenario_id",
          "created_at",
          "updated_at",
          "results"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "export_name": {
            "title": "Export Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scenario_id": {
            "title": "Scenario Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "results": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeployJobResults"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeployJobResults": {
        "title": "DeployJobResults",
        "required": [
          "success_count",
          "total_count"
        ],
        "type": "object",
        "properties": {
          "success_count": {
            "title": "Success Count",
            "type": "integer"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        }
      },
      "LogEntriesResponse": {
        "title": "LogEntriesResponse",
        "required": [
          "log_entries"
        ],
        "type": "object",
        "properties": {
          "log_entries": {
            "title": "Log Entries",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogEntryResponse"
            }
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "LogEntryFlowResponse": {
        "title": "LogEntryFlowResponse",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the flow that ran"
          },
          "version": {
            "title": "Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version of the flow that ran"
          },
          "version_durable_id": {
            "title": "Version Durable Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Durable ID of the flow version"
          },
          "interview_guid": {
            "title": "Interview Guid",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GUID of the flow interview"
          }
        },
        "description": "Flow context for a log entry recorded by a Salesforce Flow."
      },
      "LogEntryResponse": {
        "title": "LogEntryResponse",
        "required": [
          "id",
          "name",
          "timestamp",
          "timestamp_milliseconds",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce ID of the log entry"
          },
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Log entry record name"
          },
          "level": {
            "title": "Level",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Log level (e.g. ERROR, WARN, INFO, DEBUG)"
          },
          "level_number": {
            "title": "Level Number",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Numeric log level"
          },
          "message": {
            "title": "Message",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Log message"
          },
          "logger": {
            "title": "Logger",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Logger name"
          },
          "context": {
            "title": "Context",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional context"
          },
          "request_id": {
            "title": "Request Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Request ID"
          },
          "flow": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LogEntryFlowResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Flow context (null when the log entry was not recorded from a Salesforce Flow)"
          },
          "timestamp": {
            "title": "Timestamp",
            "type": "string",
            "description": "Log timestamp (ISO-8601)"
          },
          "timestamp_milliseconds": {
            "title": "Timestamp Milliseconds",
            "type": "number",
            "description": "Log timestamp in milliseconds since epoch"
          },
          "created_at": {
            "title": "Created At",
            "type": "string",
            "description": "ISO-8601 creation timestamp"
          }
        }
      },
      "FlowListResponse": {
        "title": "FlowListResponse",
        "required": [
          "flows"
        ],
        "type": "object",
        "properties": {
          "flows": {
            "title": "Flows",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowDefinitionResponse"
            },
            "description": "List of flow definition records"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned. Only present when limit exceeds Salesforce's per-page maximum (2000 records)."
          }
        }
      },
      "FlowDefinitionResponse": {
        "title": "FlowDefinitionResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Flow definition ID"
          },
          "api_name": {
            "title": "Api Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "API name of the flow"
          },
          "label": {
            "title": "Label",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display label of the flow"
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Description of the flow"
          },
          "active_version_id": {
            "title": "Active Version Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the active flow version, or null if there is no active version"
          },
          "latest_version_id": {
            "title": "Latest Version Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the most recently saved flow version"
          },
          "version_number": {
            "title": "Version Number",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version number of the latest flow version"
          },
          "is_active": {
            "title": "Is Active",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow has an active version"
          },
          "is_out_of_date": {
            "title": "Is Out Of Date",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the active version is older than the most recently saved version"
          },
          "is_template": {
            "title": "Is Template",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow is a template"
          },
          "is_overridable": {
            "title": "Is Overridable",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow can be overridden by a subscriber org"
          },
          "is_swing_flow": {
            "title": "Is Swing Flow",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow was built with the legacy Swing Designer"
          },
          "process_type": {
            "title": "Process Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Type of flow (e.g. Flow, AutoLaunchedFlow, Workflow, InvocableProcess)"
          },
          "record_trigger_type": {
            "title": "Record Trigger Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trigger condition for record-triggered flows (e.g. Create, Update, CreateAndUpdate, Delete)"
          },
          "trigger_type": {
            "title": "Trigger Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trigger type for the flow (e.g. RecordBeforeSave, RecordAfterSave, Scheduled, PlatformEvent)"
          },
          "trigger_object_or_event_id": {
            "title": "Trigger Object Or Event Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the object or platform event that triggers the flow"
          },
          "trigger_object_or_event_label": {
            "title": "Trigger Object Or Event Label",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Label of the object or platform event that triggers the flow"
          },
          "trigger_order": {
            "title": "Trigger Order",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Execution order relative to other record-triggered flows on the same object and trigger event"
          },
          "builder": {
            "title": "Builder",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tool used to create the flow (e.g. Flow Builder, Cloud Flow Designer)"
          },
          "api_version": {
            "title": "Api Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "API version the flow was saved with"
          },
          "last_modified_by": {
            "title": "Last Modified By",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the user who last modified the flow"
          },
          "installed_package_name": {
            "title": "Installed Package Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the managed package that installed this flow, if any"
          },
          "manageable_state": {
            "title": "Manageable State",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Managed package state of the package component. One of: Active, Deleted, Deprecated, DeprecatedEditable, Installed, InstalledEditable, Released, Unmanaged"
          },
          "namespace_prefix": {
            "title": "Namespace Prefix",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Namespace prefix of the component's package, if any"
          },
          "durable_id": {
            "title": "Durable Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stable identifier for the flow definition across versions"
          },
          "source_template_id": {
            "title": "Source Template Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the template this flow was created from, if any"
          },
          "overridden_by_id": {
            "title": "Overridden By Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the flow that overrides this one in a subscriber org, if any"
          },
          "overridden_flow_id": {
            "title": "Overridden Flow Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the flow being overridden by this one, if any"
          }
        }
      },
      "FlowVersionsListResponse": {
        "title": "FlowVersionsListResponse",
        "required": [
          "versions"
        ],
        "type": "object",
        "properties": {
          "versions": {
            "title": "Versions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowVersionResponse"
            },
            "description": "List of flow versions, ordered by version number descending"
          },
          "next_records_url": {
            "title": "Next Records Url",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass this value as next_records_url on the next request to fetch the following page. Null when all records have been returned."
          }
        }
      },
      "FlowVersionResponse": {
        "title": "FlowVersionResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Salesforce Tooling API record ID. Not usable as a version identifier \u2014 use durable_id instead."
          },
          "durable_id": {
            "title": "Durable Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stable version identifier (DurableId). Use this as the version_id in get_flow_version, update_flow_version, activate_flow_version, and deactivate_flow_version."
          },
          "flow_definition_view_id": {
            "title": "Flow Definition View Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "DurableId of the parent flow definition"
          },
          "label": {
            "title": "Label",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display label of the flow version"
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Description of the flow version"
          },
          "status": {
            "title": "Status",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version status: Active, Draft, Obsolete, InvalidDraft, or UnderReview"
          },
          "version_number": {
            "title": "Version Number",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version number"
          },
          "process_type": {
            "title": "Process Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Type of flow (e.g. Flow, AutoLaunchedFlow, Workflow, InvocableProcess)"
          },
          "api_version": {
            "title": "Api Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "API version the flow was saved with"
          },
          "api_version_runtime": {
            "title": "Api Version Runtime",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "API version used for running the flow. Determines which versioned run-time behavior improvements are adopted."
          },
          "run_in_mode": {
            "title": "Run In Mode",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run mode for the flow: DefaultMode, SystemModeWithSharing, or SystemModeWithoutSharing"
          },
          "is_template": {
            "title": "Is Template",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow is a template"
          },
          "is_swing_flow": {
            "title": "Is Swing Flow",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow was built with Desktop Flow Designer"
          }
        }
      },
      "FlowVersionConfigResponse": {
        "title": "FlowVersionConfigResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "Flow version record ID"
          },
          "api_version": {
            "title": "Api Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "API version that defines the execution behavior of the flow"
          },
          "definition_id": {
            "title": "Definition Id",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent FlowDefinition record"
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Description of the flow version"
          },
          "environments": {
            "title": "Environments",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the flow can run (e.g. Default, Offline, Slack). Multipicklist value."
          },
          "full_name": {
            "title": "Full Name",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Fully qualified API name of the flow version (e.g. MyFlow-3)"
          },
          "is_template": {
            "title": "Is Template",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the flow is a template"
          },
          "manageable_state": {
            "title": "Manageable State",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Managed package state of the component. One of: beta, deleted, deprecated, deprecatedEditable, installed, installedEditable, released, unmanaged"
          },
          "master_label": {
            "title": "Master Label",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display label for the flow version"
          },
          "metadata": {
            "title": "Metadata",
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Full flow version configuration. Null for flows in managed packages (unless they are templates)."
          },
          "process_type": {
            "title": "Process Type",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Type of flow (e.g. Flow, AutoLaunchedFlow, Workflow, InvocableProcess)"
          },
          "run_in_mode": {
            "title": "Run In Mode",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run mode: DefaultMode, SystemModeWithSharing, or SystemModeWithoutSharing"
          },
          "status": {
            "title": "Status",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version status: Active, Draft, Obsolete, UnderReview, or InvalidDraft"
          },
          "time_zone_sid_key": {
            "title": "Time Zone Sid Key",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time zone ID in which the flow runs"
          },
          "version_number": {
            "title": "Version Number",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version number"
          }
        }
      },
      "CreateFlowResponse": {
        "title": "CreateFlowResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "DurableId of the newly created flow definition"
          }
        }
      },
      "CreateFlowBody": {
        "title": "CreateFlowBody",
        "required": [
          "full_name",
          "label",
          "process_type"
        ],
        "type": "object",
        "properties": {
          "full_name": {
            "title": "Full Name",
            "type": "string",
            "description": "Unique API name for the flow. Must start with a letter and contain only letters, digits, and underscores. Must not end with an underscore or contain consecutive underscores."
          },
          "label": {
            "title": "Label",
            "type": "string",
            "description": "Display label for the flow."
          },
          "process_type": {
            "title": "Process Type",
            "type": "string",
            "description": "Type of flow to create (e.g. AutoLaunchedFlow, Flow). Determines the flow's runtime behavior and available elements."
          },
          "description": {
            "title": "Description",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Description of the flow."
          },
          "api_version": {
            "title": "Api Version",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "API version for the flow's execution behavior. Defaults to the org's current API version if omitted."
          },
          "metadata": {
            "title": "Metadata",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional flow metadata fields (e.g. elements, variables, formulas). Merged into the base metadata sent to Salesforce."
          }
        }
      },
      "CreateFlowVersionResponse": {
        "title": "CreateFlowVersionResponse",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string",
            "description": "DurableId of the newly created flow version"
          }
        }
      },
      "FlowVersionBody": {
        "title": "FlowVersionBody",
        "required": [
          "metadata"
        ],
        "type": "object",
        "properties": {
          "metadata": {
            "title": "Metadata",
            "type": "object",
            "additionalProperties": true,
            "description": "Complete flow metadata object. Fetch the current metadata via get_flow_version first, modify what you need, then submit the full object \u2014 not just the changed fields."
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key issued from the Gradient Works settings page. Pass as `Authorization: Bearer <key>`."
      }
    }
  },
  "tags": [
    {
      "name": "CRM Connections",
      "description": "Browse CRM connections for the account."
    },
    {
      "name": "Assets",
      "description": "Upload files for use as data sources."
    },
    {
      "name": "Market Maps",
      "description": "Create, inspect, and export market maps."
    },
    {
      "name": "Target Books",
      "description": "Browse target books for a CRM connection."
    },
    {
      "name": "Reps",
      "description": "Browse reps enrolled in target books."
    },
    {
      "name": "Distributions",
      "description": "Browse distributions for a CRM connection."
    },
    {
      "name": "Queues",
      "description": "Browse Gradient Works queues for a CRM connection."
    },
    {
      "name": "Retrievals",
      "description": "Browse retrievals for a CRM connection."
    },
    {
      "name": "Carve / Projects",
      "description": "Carve projects, data sources, and scenarios"
    },
    {
      "name": "Assignments",
      "description": "Browse assignment records for a CRM connection."
    },
    {
      "name": "Log Entries",
      "description": "Browse Gradient Works log entries."
    },
    {
      "name": "Flows",
      "description": "Manage Flows in a Salesforce org."
    }
  ]
}
