{
  "openapi": "3.0.3",
  "info": {
    "title": "SLTax Forms API",
    "version": "1.3.0",
    "description": "Stamp wording, diligent-search affidavits, declinations, and surplus-lines disclosure templates for 50 states + DC + PR + USVI. Effective-dated. Per-row confidence (verified|estimated); confirm with DOI/SLA before filing \u2014 confirm with the DOI or stamping office before filing.\n\nRequires Authentik entitlement `entitlement-sltax-forms` and an active API key (`X-API-Key`)."
  },
  "servers": [
    {
      "url": "https://sltax.ilionit.com/api/v1",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "FormType": {
        "type": "string",
        "enum": [
          "stamp_wording",
          "diligent_search",
          "declination",
          "disclosure",
          "affidavit",
          "sla_report"
        ]
      },
      "FormCatalogItem": {
        "type": "object",
        "required": [
          "state",
          "form_type",
          "form_id",
          "title",
          "effective_from"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "TX"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string",
            "example": "tx-stamp-wording-2011"
          },
          "title": {
            "type": "string"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "effective_to": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "source_cite": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "fillable_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "insured_name",
              "premium",
              "effective_date",
              "carrier_name"
            ]
          },
          "output_formats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "html",
                "pdf_url"
              ]
            }
          }
        }
      },
      "StampWordingRequest": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "TX"
          },
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "line_of_business": {
            "type": "string",
            "example": "general_liability"
          },
          "premium": {
            "type": "number"
          },
          "carrier_name": {
            "type": "string"
          },
          "insured_name": {
            "type": "string"
          }
        }
      },
      "StampWordingResponse": {
        "type": "object",
        "required": [
          "state",
          "form_id",
          "wording",
          "effective_from"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "form_id": {
            "type": "string"
          },
          "wording": {
            "type": "string",
            "description": "Ready-to-paste stamp / legend text"
          },
          "html": {
            "type": "string"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "source_cite": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "FormRenderRequest": {
        "type": "object",
        "required": [
          "state",
          "form_type"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "FL"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string",
            "description": "Optional pin to a specific catalog version; omit to resolve by effective_date"
          },
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "output": {
            "type": "string",
            "enum": [
              "text",
              "html",
              "pdf"
            ],
            "default": "text"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "insured_name": "Acme LLC",
              "premium": "10000",
              "carrier_name": "Example Surplus Ins. Co.",
              "declining_carrier_1": "Admitted Co A",
              "declining_carrier_2": "Admitted Co B",
              "declining_carrier_3": "Admitted Co C"
            }
          }
        }
      },
      "FormRenderResponse": {
        "type": "object",
        "required": [
          "state",
          "form_type",
          "form_id",
          "body"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "Rendered text or HTML"
          },
          "pdf_url": {
            "type": "string",
            "format": "uri",
            "description": "Present when output=pdf; short-lived signed URL"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "source_cite": {
            "type": "string"
          },
          "missing_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required catalog fields not supplied"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/forms/types": {
      "get": {
        "summary": "List form type codes",
        "description": "Catalog metadata. Requires forms entitlement; does not consume quota.",
        "responses": {
          "200": {
            "description": "Form types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "types": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FormType"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          }
        }
      }
    },
    "/forms/catalog": {
      "get": {
        "summary": "List forms available for a jurisdiction",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "form_type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/FormType"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "As-of date for effective-dated catalog (default: today)"
          },
          {
            "name": "confidence",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "verified",
                "estimated",
                "unverified"
              ]
            }
          },
          {
            "name": "history",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "forms": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FormCatalogItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          }
        }
      }
    },
    "/forms/stamp-wording": {
      "post": {
        "summary": "Resolve surplus-lines stamp / legend wording",
        "description": "Counts 1 against forms monthly quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StampWordingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stamp wording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StampWordingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Forms quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          },
          "404": {
            "description": "No wording for jurisdiction/date"
          }
        }
      }
    },
    "/forms/render": {
      "post": {
        "summary": "Render a fillable form (diligent search, declination, affidavit, \u2026)",
        "description": "Counts 1 against forms monthly quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormRenderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rendered form",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormRenderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Forms quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          },
          "404": {
            "description": "Form not found for jurisdiction/date"
          }
        }
      }
    },
    "/forms/coverage": {
      "get": {
        "summary": "Forms data coverage (stamp + diligent confidence counts)",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage summary"
          }
        }
      }
    },
    "/forms/diligent-required": {
      "get": {
        "summary": "Is diligent search required for state/date?",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/forms/placement-brief": {
      "post": {
        "summary": "Stamp + diligent (+ calendar due if entitled)",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}
