{
 "openapi": "3.1.0",
 "info": {
  "title": "Statewire API",
  "version": "0.1.0",
  "description": "Free, read-only lookups of business-entity status from official state open data (TX, CT, CO), plus companies that newly slipped since a date. Company-level public records; not legal or tax advice."
 },
 "servers": [
  {
   "url": "https://statewire.io"
  }
 ],
 "paths": {
  "/api/company": {
   "get": {
    "operationId": "lookupCompanyStatus",
    "summary": "Look up a company's registration status",
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "description": "Legal name or its beginning (2+ characters)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "entity_id",
      "in": "query",
      "description": "The state's entity or taxpayer number (exact)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "state",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "TX",
        "CT",
        "CO"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 10,
       "default": 5
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{ as_of, matches[], unavailable[] }: matches with status, state wording, official record link and canonical page URL. If some states did not answer, they are named in unavailable[]."
     },
     "400": {
      "description": "Missing, repeated or invalid parameter"
     },
     "503": {
      "description": "No state registry answered"
     }
    }
   }
  },
  "/api/slipped": {
   "get": {
    "operationId": "listStatusChanges",
    "summary": "List companies that slipped in a state since a date",
    "parameters": [
     {
      "name": "state",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "TX",
        "CT",
        "CO"
       ]
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD, inclusive",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "forfeited",
        "past_due",
        "dissolution_started",
        "noncompliant"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{ as_of, total, next_cursor, items[], note }: items newest first"
     },
     "400": {
      "description": "Missing or invalid parameter"
     },
     "503": {
      "description": "Change data temporarily unavailable"
     }
    }
   }
  }
 }
}