{
  "openapi": "3.0.1",
  "info": {
    "title": "Supplier Risk Monitor",
    "description": "Re-check a saved supplier list. Register, VAT, sanctions, ownership, domain expiry and US SAM exclusions are billed per supplier. A change alert is billed only when the risk changes. A failed source is never clear.",
    "version": "0.1",
    "x-build-id": "ghvVJcDFaK3anw27H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikee368~supplier-risk-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikee368-supplier-risk-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/mikee368~supplier-risk-monitor/runs": {
      "post": {
        "operationId": "runs-sync-mikee368-supplier-risk-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/mikee368~supplier-risk-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-mikee368-supplier-risk-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": {
          "customerId": {
            "title": "Customer ID",
            "type": "string",
            "description": "Stable name for this list. State is kept in the named key-value store supplier-risk-<customerId>. Use the same id on every scheduled run."
          },
          "suppliers": {
            "title": "Suppliers",
            "type": "array",
            "description": "The list to re-check. Each object can include supplierId, name, country (ISO2 or ISO3), registrationNumber, vatNumber, lei, domain or website, ueiSAM and cageCode. Maximum 50 per run.",
            "default": []
          },
          "maxSuppliers": {
            "title": "Max suppliers",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Stop after this many suppliers. Default 25. Maximum 50. Suppliers past the cap are counted as truncated and are not checked.",
            "default": 25
          },
          "checks": {
            "title": "Checks",
            "type": "object",
            "description": "Each true check is billed on its own when it calls a source. Ownership and insolvency are off by default. SAM runs only when a UEI or CAGE is set. Insolvency is a plug: turning it on does not call a source yet and does not produce a clear result.",
            "properties": {
              "register": {
                "type": "boolean",
                "title": "Register status",
                "description": "Company register, plus French BODACC notices and a UK Companies House profile when a key is set.",
                "default": true
              },
              "vat": {
                "type": "boolean",
                "title": "VAT",
                "description": "VAT validity for vatNumber.",
                "default": true
              },
              "sanctions": {
                "type": "boolean",
                "title": "Sanctions",
                "description": "Official OFAC, UK, UN and EU lists.",
                "default": true
              },
              "ownership": {
                "type": "boolean",
                "title": "Ownership",
                "description": "GLEIF parents and, for the UK with your key, PSC.",
                "default": false
              },
              "domain": {
                "type": "boolean",
                "title": "Domain expiry",
                "description": "RDAP registration and expiry.",
                "default": true
              },
              "sam": {
                "type": "boolean",
                "title": "US SAM exclusions",
                "description": "SAM.gov registration and exclusions when a UEI or CAGE is set.",
                "default": true
              },
              "insolvency": {
                "type": "boolean",
                "title": "Insolvency notices",
                "description": "Plug for a later Actor. Off by default. On, with no source wired in, the supplier is not clear and the check is not billed.",
                "default": false
              }
            },
            "default": {
              "register": true,
              "vat": true,
              "sanctions": true,
              "ownership": false,
              "domain": true,
              "sam": true,
              "insolvency": false
            }
          },
          "matchMode": {
            "title": "Name match mode",
            "enum": [
              "strict",
              "balanced",
              "loose"
            ],
            "type": "string",
            "description": "strict (default) keeps a register name match only at 75 or above.",
            "default": "strict"
          },
          "minScore": {
            "title": "Sanctions minimum score",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Hits below this score are ignored. Default 80. Range 50 to 100.",
            "default": 80
          },
          "expiryWithinDays": {
            "title": "Expiry window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Domain expiry or SAM registration expiry inside this window is a medium result. Default 30. A closer day inside the same window is not a new alert.",
            "default": 30
          },
          "listMaxAgeHours": {
            "title": "Sanctions list cache (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "Reuse the sanctions list cache while it is younger than this. Default 24. Range 1 to 168. The cache is never used once it is older than 72 hours, including when a refresh fails. A failed list is not treated as fresh.",
            "default": 24
          },
          "refreshLists": {
            "title": "Refresh sanctions lists",
            "type": "boolean",
            "description": "Download the sanctions lists again even when the cache is fresh.",
            "default": false
          },
          "resetState": {
            "title": "Reset saved state",
            "type": "boolean",
            "description": "Treat every supplier as new for this customer. The next rows are baselines, not change alerts.",
            "default": false
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key",
            "type": "string",
            "description": "Free key from developer.company-information.service.gov.uk. Used for a UK register profile and UK PSC. Without it, UK PSC is skipped and a GB company can still match on GLEIF. You can also set COMPANIES_HOUSE_API_KEY."
          },
          "samGovApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Free key from api.data.gov. Required for a UEI or CAGE exclusion check. Without it that check is not billed and is not clear. You can also set SAM_GOV_API_KEY."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional https URL. Called only when this run has a real change alert. generic posts the alert JSON. slack posts {\"text\"}. discord posts {\"content\"}. The run does not send e-mail.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "generic",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "generic, slack or discord. Used only when Webhook URL is set.",
            "default": "generic"
          },
          "webhookSecret": {
            "title": "Webhook password",
            "type": "string",
            "description": "Optional password. Sent only as an Authorization: Bearer header. It is not written to the log, the dataset, or the alert record. Requires Webhook URL."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}