{
  "openapi": "3.0.3",
  "info": {
    "title": "EEOC Data Read API",
    "description": "Read-only access to the governed datasets behind the published dashboards. Lists datasets, describes one dataset, pages through a dataset's rows, and serves each governed table directly. Values match the dashboards and downloads exactly.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/governed/tables.json": {
      "get": {
        "summary": "List governed tables",
        "operationId": "listGovernedTables",
        "description": "The governed table inventory for the active backend.",
        "responses": {
          "200": {
            "description": "The governed table names and the active backend.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/governed/{table}.json": {
      "get": {
        "summary": "Read one governed table",
        "operationId": "getGovernedTable",
        "parameters": [
          {
            "name": "table",
            "in": "path",
            "required": true,
            "description": "Governed table name (bare or schema qualified).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return.",
            "schema": {
              "type": "integer",
              "default": 1000,
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Row offset to start the page at (0 or greater).",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rows plus paging metadata.",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "No governed table has that name."
          }
        }
      }
    },
    "/data/{cid}.json": {
      "get": {
        "summary": "Download one dataset's tables as JSON",
        "operationId": "getDatasetJson",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "description": "Dataset content id (the dcat3 cid).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every governed table for the dataset as JSON.",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "No published dataset has that cid."
          }
        }
      }
    },
    "/datasets": {
      "get": {
        "summary": "List published datasets",
        "operationId": "listDatasets",
        "responses": {
          "200": {
            "description": "The list of published datasets with table inventories.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/datasets/{slug}": {
      "get": {
        "summary": "Describe one dataset",
        "operationId": "getDataset",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Stable dataset slug.",
            "schema": {
              "type": "string",
              "enum": [
                "eeo-1",
                "eeo-3",
                "eeo-4",
                "eeo-5",
                "eeo1-pay-data"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The dataset's metadata and table inventory.",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "No published dataset has that slug."
          }
        }
      }
    },
    "/datasets/{slug}/data": {
      "get": {
        "summary": "Page through one dataset's rows",
        "operationId": "getDatasetData",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Stable dataset slug.",
            "schema": {
              "type": "string",
              "enum": [
                "eeo-1",
                "eeo-3",
                "eeo-4",
                "eeo-5",
                "eeo1-pay-data"
              ]
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "Which governed table to read. Defaults to the first table when the dataset has exactly one, otherwise this parameter is required.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1 to 1000).",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Row offset to start the page at (0 or greater).",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rows plus paging metadata.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "The table parameter is required or unknown."
          },
          "404": {
            "description": "No published dataset has that slug."
          }
        }
      }
    }
  }
}