{
  "openapi": "3.0.1",
  "info": {
    "title": "TX Insurance Network - Agencies, Appointments & Relationships",
    "description": "Four Texas Department of Insurance registers in one actor: licensed agencies and businesses (57k), company appointments for agencies (628k), owner/officer business relationships (133k) and company appointments for individual agents (4.48M). Joined by NPN, EIN and NAIC id.",
    "version": "0.0",
    "x-build-id": "kfBfOan6giViquHFF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~tx-tdi-network/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-tx-tdi-network",
        "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/j0401~tx-tdi-network/runs": {
      "post": {
        "operationId": "runs-sync-j0401-tx-tdi-network",
        "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/j0401~tx-tdi-network/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-tx-tdi-network",
        "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": {
          "corpus": {
            "title": "Register",
            "enum": [
              "",
              "agencies",
              "agency-appointments",
              "business-relationships",
              "agent-appointments"
            ],
            "type": "string",
            "description": "Which register to query (blank = agencies). agent-appointments is a 4.48M-row fact table - pick it deliberately.",
            "default": ""
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "rows",
              "aggregate",
              "profile"
            ],
            "type": "string",
            "description": "rows = matching records (default). aggregate = one count row per group (see groupBy). profile = every register record for one NPN, joined on exact NPN/EIN keys, plus a summary row with each section's sourceStatus.",
            "default": ""
          },
          "name": {
            "title": "Agency or organisation name",
            "type": "string",
            "description": "Name prefix (agencies)."
          },
          "agencyName": {
            "title": "Agency name (appointments)",
            "type": "string",
            "description": "Name prefix (agency-appointments)."
          },
          "agentName": {
            "title": "Agent name",
            "type": "string",
            "description": "Name prefix (agent-appointments)."
          },
          "licenseeName": {
            "title": "Licensee name (relationships)",
            "type": "string",
            "description": "Name prefix of the licensee (business-relationships)."
          },
          "associatedName": {
            "title": "Associated licensee name",
            "type": "string",
            "description": "Name prefix of the associated licensee, e.g. the owner (business-relationships)."
          },
          "npn": {
            "title": "NPN",
            "type": "string",
            "description": "National Producer Number (exact, 5-10 digits). Required for mode=profile, where it is the join key across all four registers."
          },
          "ein": {
            "title": "EIN",
            "type": "string",
            "description": "Employer Identification Number (exact; agency-appointments / relationships)."
          },
          "naicId": {
            "title": "Company NAIC id",
            "type": "string",
            "description": "Insurer NAIC company id (exact; appointments)."
          },
          "licenseNumber": {
            "title": "Agency licence number",
            "type": "string",
            "description": "Exact agency licence number (agencies)."
          },
          "company": {
            "title": "Insurance company",
            "type": "string",
            "description": "Company name prefix (appointments)."
          },
          "agencyType": {
            "title": "Agency type",
            "type": "string",
            "description": "Agency type (agencies), e.g. Corporation."
          },
          "licenseType": {
            "title": "Licence type",
            "type": "string",
            "description": "Licence type (agencies), e.g. Life Agency."
          },
          "appointmentType": {
            "title": "Appointment type",
            "type": "string",
            "description": "Appointment type (appointments), e.g. Underwriter."
          },
          "associationType": {
            "title": "Association type",
            "type": "string",
            "description": "Relationship type (business-relationships), e.g. Owner."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City prefix. Not available for business-relationships."
          },
          "state": {
            "title": "State code",
            "type": "string",
            "description": "Two-letter state code (exact). Not available for business-relationships, whose source has no state column."
          },
          "since": {
            "title": "Since date",
            "type": "string",
            "description": "ISO date; only records on or after this date (agencies by licence issue date; appointments and relationships by their event date)."
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "state",
              "city",
              "agencyType",
              "licenseType",
              "company",
              "appointmentType",
              "associationType"
            ],
            "type": "string",
            "description": "Dimension for mode=aggregate. Availability differs per register; an unavailable dimension is rejected rather than ignored.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on records delivered in rows mode (0 = default 50; up to 5,000 per run). Aggregate mode ignores it and returns up to 20,000 groups. Each record is metered individually.",
            "default": 50
          },
          "licenseeNpn": {
            "title": "Licensee NPN (relationships)",
            "type": "string",
            "description": "NPN of the licensee (business-relationships)."
          },
          "associatedNpn": {
            "title": "Associated licensee NPN",
            "type": "string",
            "description": "NPN of the associated licensee, e.g. the owner (business-relationships)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}