{
  "openapi": "3.0.1",
  "info": {
    "title": "RFP & Tender Fit Monitor — Bid/No-Bid Scoring & Alerts",
    "description": "Bid/no-bid fit scoring for new EU/UK/US government tenders (TED, Find a Tender, SAM.gov): go/no-go call, mandatory requirements, eligibility flags, deadline risk and required docs per notice. A ranked shortlist from official procurement APIs.",
    "version": "0.1",
    "x-build-id": "m2v32m4qCV1bDr44i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dami_studio~rfp-tender-fit-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dami_studio-rfp-tender-fit-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/dami_studio~rfp-tender-fit-monitor/runs": {
      "post": {
        "operationId": "runs-sync-dami_studio-rfp-tender-fit-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/dami_studio~rfp-tender-fit-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-dami_studio-rfp-tender-fit-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "sources": {
            "title": "Sources to monitor",
            "type": "array",
            "description": "Which official procurement feeds to check. Valid values: TED (EU), UK_FTS (UK Find a Tender), SAM_GOV (US). TED and UK_FTS are keyless; SAM_GOV needs a free SAM.gov API key in 'samApiKey' — if omitted, that source is skipped with a clear message. Unknown values are ignored.",
            "default": [
              "TED",
              "UK_FTS"
            ],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms describing the work you do (matched against notice title/description). Used to filter TED/UK and to inform fit scoring.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes (EU/UK)",
            "type": "array",
            "description": "Common Procurement Vocabulary codes to match (e.g. 72000000 = IT services). Filters TED server-side and UK client-side. Leave empty to rely on keywords.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes (US/SAM.gov)",
            "type": "array",
            "description": "North American Industry Classification codes for SAM.gov (e.g. 541512 = Computer Systems Design). One query per code (max 3 used) to respect SAM.gov rate limits.",
            "items": {
              "type": "string"
            }
          },
          "vendorProfile": {
            "title": "Vendor capability profile",
            "type": "object",
            "description": "Your firm's profile — this is what each tender is scored AGAINST. capabilities/certifications are arrays of strings; eligibleRegions is country codes (e.g. GB, US, PL) or empty for no region restriction; min/maxContractValue are numbers or null; smallBusiness is true/false."
          },
          "generateFitScore": {
            "title": "Generate fit score",
            "type": "boolean",
            "description": "Run the bid/no-bid fit engine on each new tender. This is the product — leave on.",
            "default": true
          },
          "useLlm": {
            "title": "Use LLM enrichment (optional)",
            "type": "boolean",
            "description": "If on AND an Anthropic API key is configured (ANTHROPIC_API_KEY env var), enrich fit scoring with an LLM for messier notice text. Off = fast, free, deterministic rules engine. Only NEW/CHANGED tenders are ever scored.",
            "default": false
          },
          "llmModel": {
            "title": "LLM model (if LLM enrichment on)",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-4-6",
              "claude-opus-4-8"
            ],
            "type": "string",
            "description": "Cheapest capable model is the default. Only NEW tenders are scored, so cost stays well under the per-score charge.",
            "default": "claude-haiku-4-5"
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Emit only tenders that are new or changed versus the previous scheduled run (deltas, not dumps). Turn off to re-emit the full current window every run.",
            "default": true
          },
          "lookbackDays": {
            "title": "Look-back window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How far back to fetch each run. The state store dedupes, so a generous window safely catches late-indexed notices.",
            "default": 7
          },
          "maxResultsPerSource": {
            "title": "Max results per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on notices fetched per source per run. Set this comfortably above the number of notices your keyword/CPV filter typically yields in the look-back window, so the full window is captured each run. A cap far below the window's volume can surface a different subset run-to-run (TED has no stable tiebreaker among same-day notices) — fine for niche filters, but raise it for very broad ones.",
            "default": 100
          },
          "weeklyDigest": {
            "title": "Generate ranked digest",
            "type": "boolean",
            "description": "Write a fit-ranked HTML + Markdown digest to the Key-Value Store (keys DIGEST.html / DIGEST.md) — the artifact a bid team reads.",
            "default": true
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "If set, POST a compact JSON run summary here when the run finishes (e.g. a webhook.site URL, Slack/Make/Zapier inbound hook)."
          },
          "samApiKey": {
            "title": "SAM.gov API key (US only)",
            "type": "string",
            "description": "Free public API key from a personal SAM.gov account (Account Details -> Public API Key). Required only if SAM_GOV is in 'sources'. Stored as a secret."
          },
          "fetchSamDescriptions": {
            "title": "Fetch SAM.gov descriptions",
            "type": "boolean",
            "description": "SAM.gov descriptions require a second API call each and a personal key allows only ~10 calls/day. Leave OFF unless you have a higher-quota key.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name (advanced)",
            "type": "string",
            "description": "Named Key-Value Store that holds the monitor's per-source snapshot across scheduled runs (this is what makes onlyNewSinceLastRun work). Leave as default unless you run several independent monitors and want isolated state.",
            "default": "rfp-tender-fit-monitor-state"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}