{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Promo Leak Monitor - Flag Leaks with Proof",
    "description": "Monitor Amazon promo and coupon codes against public leak sources with allow-list comparison and evidence rows for every flag.",
    "version": "0.1",
    "x-build-id": "h0VY0ElvveiVCU4zS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyworks~amazon-promo-leak-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyworks-amazon-promo-leak-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/steadyworks~amazon-promo-leak-monitor/runs": {
      "post": {
        "operationId": "runs-sync-steadyworks-amazon-promo-leak-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/steadyworks~amazon-promo-leak-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-steadyworks-amazon-promo-leak-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",
        "required": [
          "configId",
          "brandAsins",
          "groupCodes",
          "checkHours",
          "stackWatch",
          "maxTotalChargeUsd"
        ],
        "properties": {
          "brandAsins": {
            "title": "Brand ASINs",
            "minItems": 1,
            "maxItems": 30,
            "type": "array",
            "description": "Seller-typed ASIN allow-list: B0 + 8 uppercase alphanumerics. Max 30.",
            "items": {
              "type": "string",
              "pattern": "^B0[A-Z0-9]{8}$"
            }
          },
          "capMode": {
            "title": "Cap mode",
            "enum": [
              "capped",
              "complete-input"
            ],
            "type": "string",
            "description": "Spend ceiling mode. Capped (default): max $3.00 for up to 100 verified rows at $0.03/row — when the cap is reached, spend stops and counts are still reported. Complete-input: processes your entire allow-list; your worst-case total (codes x $0.03) is quoted before any charge and never exceeds the $1.50 ceiling (50 codes x $0.03) — totals above $1.50 stay capped; your max charge setting still lowers any run; scheduled and saved-task runs always use capped.",
            "default": "capped"
          },
          "checkHours": {
            "title": "Check cadence (hours)",
            "minimum": 6,
            "maximum": 6,
            "type": "integer",
            "description": "Fixed 6h sweep cadence. Only 6 is accepted.",
            "default": 6
          },
          "configId": {
            "title": "Watch ID",
            "pattern": "^[a-z0-9-]{1,64}$",
            "minLength": 1,
            "maxLength": 64,
            "type": "string",
            "description": "Watch-list name: lowercase letters, digits, dashes, max 64 chars. Use a fresh value per watch list."
          },
          "groupCodes": {
            "title": "Group codes",
            "maxItems": 50,
            "type": "array",
            "description": "Private/influencer/email code groups with expiry. Expired codes are ignored and never bill. Max 50.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "code": {
                  "maxLength": 64,
                  "minLength": 1,
                  "type": "string",
                  "title": "Code",
                  "description": "Promo code text, 1-64 chars."
                },
                "expiresAt": {
                  "type": "string",
                  "title": "Expires at",
                  "description": "RFC 3339 expiry timestamp, e.g. 2027-06-01T00:00:00.000Z."
                },
                "scope": {
                  "type": "string",
                  "title": "Scope",
                  "description": "Code audience: email, influencer, or private.",
                  "enum": [
                    "email",
                    "influencer",
                    "private"
                  ],
                  "enumTitles": [
                    "Email",
                    "Influencer",
                    "Private"
                  ],
                  "editor": "select"
                }
              },
              "required": [
                "code",
                "expiresAt",
                "scope"
              ],
              "type": "object"
            }
          },
          "maxTotalChargeUsd": {
            "title": "Per-run spend cap (USD)",
            "minimum": 0,
            "maximum": 3,
            "type": "number",
            "description": "Per-run spend cap, 0-3 USD. When the cap is reached, spend stops and counts are still reported.",
            "default": 3
          },
          "observed": {
            "title": "Past observations (optional)",
            "type": "object",
            "description": "Optional: paste a past observation set to re-check it (checked time plus observations with code, audience, page URL, optional percents). Leave empty for a first check with zero flags and $0. Never live buyer data.",
            "properties": {
              "checkedAt": {
                "title": "Checked at",
                "type": "string",
                "editor": "textfield",
                "description": "ISO timestamp of the past observation set, e.g. 2026-09-28T12:00:00.000Z."
              },
              "observations": {
                "title": "Observations",
                "type": "array",
                "editor": "json",
                "description": "Past observation entries: code, audience, page URL, optional percents. Abuse guardrail max 5000 (100x the 50-code legit max; over-cap fails closed pre-fetch, $0).",
                "maxItems": 5000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string",
                      "maxLength": 1024,
                      "title": "Code",
                      "description": "Observed promo code text. Abuse guardrail max 1024 chars (16x the 64-char legit max; over-cap records drop fail-closed, $0)."
                    },
                    "codeScope": {
                      "type": "string",
                      "maxLength": 256,
                      "title": "Code scope",
                      "description": "Observed audience: email, influencer, or private. Abuse guardrail max 256 chars (over-cap records drop fail-closed, $0)."
                    },
                    "sourceUrl": {
                      "type": "string",
                      "maxLength": 2048,
                      "title": "Source URL",
                      "description": "Page where the code was observed (full https URL). Abuse guardrail max 2048 chars (platform-sane URL ceiling; over-cap records drop fail-closed, $0)."
                    },
                    "couponPercent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100,
                      "title": "Coupon percent",
                      "description": "Verified coupon percent, when read."
                    },
                    "codePercent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100,
                      "title": "Code percent",
                      "description": "Code discount percent, when known."
                    }
                  },
                  "required": [
                    "code",
                    "codeScope",
                    "sourceUrl"
                  ]
                }
              }
            },
            "additionalProperties": false
          },
          "sellerRef": {
            "title": "Seller reference",
            "maxLength": 64,
            "type": "string",
            "description": "Seller reference, max 64 chars. Use any label for your shop; never a password or key."
          },
          "stackWatch": {
            "title": "Stack watch",
            "type": "boolean",
            "description": "Also flag combined savings when both the code percent and the verified coupon percent are readable.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}