{
  "openapi": "3.0.1",
  "info": {
    "title": "Backlink Monitor & Lost Link Alerts",
    "description": "Monitor backlinks you already earned or paid for. Detect removed links, dofollow-to-nofollow changes, anchor edits, redirects and noindex pages with structured before/after data.",
    "version": "0.1",
    "x-build-id": "bvldlooJ2SxrbS6df"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~backlink-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-backlink-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/automa-flow~backlink-monitor/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-backlink-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/automa-flow~backlink-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-backlink-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": [
          "placements"
        ],
        "properties": {
          "placements": {
            "title": "Backlink placements",
            "minItems": 1,
            "maxItems": 5000,
            "type": "array",
            "description": "1-5000 known placements. Each needs a stable id, the public source page URL, and the expected target URL. expectedAnchor and expectedRel choose among multiple matching links. label is echoed on every row.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "sourceUrl",
                "expectedTarget"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "title": "Stable placement ID",
                  "description": "Your identity for this backlink; keep it unchanged across scheduled runs. Letters, digits, '.', '_', ':' and '-' only.",
                  "minLength": 1,
                  "maxLength": 120
                },
                "sourceUrl": {
                  "type": "string",
                  "title": "Source page URL",
                  "description": "Public http(s) page that should contain the backlink. Credentials, localhost and private networks are rejected.",
                  "minLength": 1,
                  "maxLength": 2048
                },
                "expectedTarget": {
                  "type": "string",
                  "title": "Expected target URL",
                  "description": "URL the source page should link to. Query parameters are significant and are not stripped.",
                  "minLength": 1,
                  "maxLength": 2048
                },
                "expectedAnchor": {
                  "type": "string",
                  "title": "Expected anchor text",
                  "description": "Optional. Used to choose among multiple matching links when present.",
                  "maxLength": 500
                },
                "expectedRel": {
                  "type": "string",
                  "title": "Expected rel",
                  "enum": [
                    "dofollow",
                    "nofollow"
                  ],
                  "enumTitles": [
                    "Dofollow",
                    "Nofollow"
                  ],
                  "description": "Optional. When several links match the target, prefer one with this rel. Omitted placements still prefer a dofollow link, and later rel changes are still detected."
                },
                "label": {
                  "type": "string",
                  "title": "Label",
                  "maxLength": 200,
                  "description": "Optional client or campaign name echoed on every row."
                }
              }
            }
          },
          "monitorKey": {
            "title": "Monitor key",
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "minLength": 1,
            "maxLength": 80,
            "type": "string",
            "description": "Namespace for saved last-good state. Keep it stable for a scheduled watchlist; use a different key for an independent client.",
            "default": "default"
          },
          "mode": {
            "title": "Output mode",
            "enum": [
              "changesOnly",
              "all"
            ],
            "type": "string",
            "description": "changesOnly is for alert webhooks. all emits one row per placement per run, including unchanged checks.",
            "default": "changesOnly"
          },
          "baselineMode": {
            "title": "First observation",
            "enum": [
              "emitBaseline",
              "silentBaseline"
            ],
            "type": "string",
            "description": "How a placement seen for the first time is reported. The baseline is always stored. The demo uses all mode and emits BASELINE or NO_CHANGE on repeat runs.",
            "default": "emitBaseline"
          },
          "confirmLossAfter": {
            "title": "Confirm loss after N misses",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Consecutive successful page checks with the link missing required before LINK_LOST. Source failures never count. Default 2 (two-strike).",
            "default": 2
          },
          "checkTargetStatus": {
            "title": "Check target HTTP status",
            "type": "boolean",
            "description": "When the source page contains a matching link, fetch that link and record its HTTP status and redirect chain. A missing link does not trigger a target fetch. Target failures never overwrite last-good target fields and never count as link loss.",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Fetch robots.txt once per origin and skip disallowed source paths. A robots transport failure is unknown, not allow-all, and is never LINK_LOST.",
            "default": true
          },
          "targetMatch": {
            "title": "Target matching",
            "enum": [
              "normalized",
              "exact",
              "domain"
            ],
            "type": "string",
            "description": "normalized compares scheme, host case, default ports and path/query (fragments dropped). exact requires the resolved href to equal the expected URL. domain matches hostnames after stripping one leading www. — blog.example.com does not match example.com. Query strings are never dropped.",
            "default": "normalized"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}