{
  "openapi": "3.0.1",
  "info": {
    "title": "MTA-STS Policy Publication Drift and Enforce-Mode Readiness",
    "description": "Give it your domains. It reads _mta-sts and _smtp._tls TXT, the live MX set and the MTA-STS policy file, compares each one with the snapshot of the last run, parses your TLS-RPT report files, and tells you if the domain can move to enforce mode. It finds ",
    "version": "0.1",
    "x-build-id": "TPJL3aNFAv8Ocw8kF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kingii98~mta-sts-policy-publication-drift-and-enforce-mode-readiness/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kingii98-mta-sts-policy-publication-drift-and-enforce-mode-readiness",
        "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/kingii98~mta-sts-policy-publication-drift-and-enforce-mode-readiness/runs": {
      "post": {
        "operationId": "runs-sync-kingii98-mta-sts-policy-publication-drift-and-enforce-mode-readiness",
        "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/kingii98~mta-sts-policy-publication-drift-and-enforce-mode-readiness/run-sync": {
      "post": {
        "operationId": "run-sync-kingii98-mta-sts-policy-publication-drift-and-enforce-mode-readiness",
        "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": [
          "domains"
        ],
        "properties": {
          "domains": {
            "title": "Domains",
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "description": "1 to 200 mail domains, for example example.com. For each domain the Actor reads _mta-sts TXT, _smtp._tls TXT, the MX set and https://mta-sts.<domain>/.well-known/mta-sts.txt.",
            "default": [
              "google.com",
              "microsoft.com",
              "example.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "tlsrpt_report_files": {
            "title": "TLS-RPT report files",
            "maxItems": 200,
            "type": "array",
            "description": "Optional. 0 to 200 TLS-RPT report files (RFC 8460 JSON, .json or .json.gz). Each item is an HTTPS URL, a record key of the default key-value store of the run, or 'store-name/record-key'. Limits for each file: 5 MB download, 50 MB after decompression.",
            "default": [
              "https://raw.githubusercontent.com/domainaware/parsedmarc/ae1e5adb6609946209278b2bf3f633c752a09383/samples/smtp_tls/smtp_tls.json",
              "https://raw.githubusercontent.com/domainaware/parsedmarc/ae1e5adb6609946209278b2bf3f633c752a09383/samples/smtp_tls/mail.ru.json"
            ],
            "items": {
              "type": "string"
            }
          },
          "target_mode": {
            "title": "Target mode",
            "enum": [
              "testing",
              "enforce"
            ],
            "type": "string",
            "description": "The mode that the policy file must reach. The readiness verdict compares it with the published mode.",
            "default": "enforce"
          },
          "gate_date": {
            "title": "Gate date for each domain",
            "type": "object",
            "description": "Optional. One ISO date for each domain, for example {\"example.com\": \"2026-08-20\"}. The key '*' holds for every domain. After the date a domain that is not ready has the verdict 'overdue'. A key that names a domain outside the domain list is skipped with a note.",
            "default": {}
          },
          "clean_window_days": {
            "title": "Clean window in report days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "The number of TLS-RPT report days with zero failure sessions that a domain needs before it can move into enforce mode.",
            "default": 7
          },
          "alert_webhook_url": {
            "title": "Alert webhook URL",
            "pattern": "^https://",
            "type": "string",
            "description": "Optional. One public HTTPS URL. The Actor sends one JSON POST when the run finds a policy defect."
          },
          "state_store_name": {
            "title": "State key-value store name",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]$",
            "minLength": 3,
            "maxLength": 63,
            "type": "string",
            "description": "The named key-value store that keeps one snapshot for each domain (last TXT id, last policy SHA-256, last mode, report days) between runs. Use the same name in each run. 3 to 63 letters, digits and hyphens, and it must not start or end with a hyphen.",
            "default": "mta-sts-policy-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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}