{
  "openapi": "3.0.1",
  "info": {
    "title": "WARN Layoff Notices Tracker (TX, CA)",
    "description": "New and changed WARN layoff and plant-closure notices from official state sources (Texas, California): employer, site, employees affected, notice and effective dates. Employer-level data, new-notice alerts. Unofficial; not affiliated with or endorsed by Texas, California or their agencies.",
    "version": "0.2",
    "x-build-id": "CiSmz7uW8DtPsylSw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/signalloom~warn-layoff-notices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-signalloom-warn-layoff-notices",
        "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/signalloom~warn-layoff-notices/runs": {
      "post": {
        "operationId": "runs-sync-signalloom-warn-layoff-notices",
        "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/signalloom~warn-layoff-notices/run-sync": {
      "post": {
        "operationId": "run-sync-signalloom-warn-layoff-notices",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Which state sources to read: TX = Texas Workforce Commission, CA = California EDD.",
            "items": {
              "type": "string",
              "enum": [
                "TX",
                "CA"
              ],
              "enumTitles": [
                "Texas",
                "California"
              ]
            },
            "default": [
              "TX",
              "CA"
            ]
          },
          "lookbackDays": {
            "title": "Look-back window (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Read notices dated in the last N days (1-90). Keep it at least as long as the gap between your runs.",
            "default": 14
          },
          "minEmployees": {
            "title": "Minimum employees affected",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only notices affecting at least this many employees. 0 = no minimum. Notices with no stated number are dropped when a minimum is set.",
            "default": 0
          },
          "closuresOnly": {
            "title": "Closures only",
            "type": "boolean",
            "description": "Keep only notices whose type says closure (for example 'Plant Closure' or 'Closure Permanent'). Texas does not publish a type, so Texas notices are dropped when this is on.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new notices",
            "type": "boolean",
            "description": "On (default): output only notices that were not in the previous run's state. Off: also output notices whose published fields changed (for example a corrected employee count).",
            "default": true
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "changes",
              "snapshot"
            ],
            "type": "string",
            "description": "'changes' = compare with the previous run (the first run stores a baseline). 'snapshot' = output everything in the look-back window; never touches the stored state.",
            "default": "changes"
          },
          "emitBaselineRows": {
            "title": "Output rows on the first run",
            "type": "boolean",
            "description": "On the first run (or after the filters change) nothing can be compared yet. On (default): output the window's notices as 'baseline' rows. Off: only store the baseline.",
            "default": true
          },
          "maxItems": {
            "title": "Max output rows",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on rows pushed to the dataset (0 = no cap).",
            "default": 500
          },
          "stateStoreName": {
            "title": "State key-value store name",
            "type": "string",
            "description": "Named key-value store that holds the previous run's state. The default run store is erased with each run, so a named store is needed for change detection (it is created on first use).",
            "default": "warn-notices-state"
          },
          "commitState": {
            "title": "Save state after this run",
            "type": "boolean",
            "description": "Untick for a dry run that leaves the stored state untouched.",
            "default": true
          },
          "sourceRowLimit": {
            "title": "Testing: max rows read per state",
            "minimum": 0,
            "type": "integer",
            "description": "0 = read the whole look-back window. Set a small number only for tests; part of the state signature, so changing it starts a new baseline.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Pause between requests. Minimum 1000.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}