{
 "swagger": "2.0",
 "info": {
  "description": "UCLA PolySci congressional district maps and boundaries for every congress, served over PostGIS with point-in-polygon and bbox RPCs, published by benthic.io as part of the NGOpen collection.",
  "title": "Congressional District Maps API",
  "version": "14.8"
 },
 "host": "benthic.io",
 "basePath": "/ngopen/up_cdmaps",
 "schemes": [
  "https"
 ],
 "consumes": [
  "application/json",
  "application/vnd.pgrst.object+json;nulls=stripped",
  "application/vnd.pgrst.object+json",
  "text/csv"
 ],
 "produces": [
  "application/json",
  "application/vnd.pgrst.object+json;nulls=stripped",
  "application/vnd.pgrst.object+json",
  "text/csv"
 ],
 "paths": {
  "/": {
   "get": {
    "produces": [
     "application/openapi+json",
     "application/json"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "OpenAPI description (this document)",
    "tags": [
     "Introspection"
    ]
   }
  },
  "/congressional_districts": {
   "get": {
    "parameters": [
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.congress_number"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statename"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.startcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.endcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district_id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.districtsi"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.county"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.page"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.law"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.note"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.bestdec"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.finalnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.rnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.lastchange"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.fromcounty"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statefp"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.geom"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.source_file"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.imported_at"
     },
     {
      "$ref": "#/parameters/select"
     },
     {
      "$ref": "#/parameters/order"
     },
     {
      "$ref": "#/parameters/range"
     },
     {
      "$ref": "#/parameters/rangeUnit"
     },
     {
      "$ref": "#/parameters/offset"
     },
     {
      "$ref": "#/parameters/limit"
     },
     {
      "$ref": "#/parameters/preferCount"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "schema": {
       "items": {
        "$ref": "#/definitions/congressional_districts"
       },
       "type": "array"
      }
     },
     "206": {
      "description": "Partial Content"
     }
    },
    "tags": [
     "congressional_districts"
    ]
   },
   "post": {
    "parameters": [
     {
      "$ref": "#/parameters/body.congressional_districts"
     },
     {
      "$ref": "#/parameters/select"
     },
     {
      "$ref": "#/parameters/preferPost"
     }
    ],
    "responses": {
     "201": {
      "description": "Created"
     }
    },
    "tags": [
     "congressional_districts"
    ]
   },
   "delete": {
    "parameters": [
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.congress_number"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statename"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.startcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.endcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district_id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.districtsi"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.county"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.page"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.law"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.note"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.bestdec"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.finalnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.rnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.lastchange"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.fromcounty"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statefp"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.geom"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.source_file"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.imported_at"
     },
     {
      "$ref": "#/parameters/preferReturn"
     }
    ],
    "responses": {
     "204": {
      "description": "No Content"
     }
    },
    "tags": [
     "congressional_districts"
    ]
   },
   "patch": {
    "parameters": [
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.congress_number"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statename"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.startcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.endcong"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.district_id"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.districtsi"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.county"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.page"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.law"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.note"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.bestdec"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.finalnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.rnote"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.lastchange"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.fromcounty"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.statefp"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.geom"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.source_file"
     },
     {
      "$ref": "#/parameters/rowFilter.congressional_districts.imported_at"
     },
     {
      "$ref": "#/parameters/body.congressional_districts"
     },
     {
      "$ref": "#/parameters/preferReturn"
     }
    ],
    "responses": {
     "204": {
      "description": "No Content"
     }
    },
    "tags": [
     "congressional_districts"
    ]
   }
  },
  "/rpc/rpc_find_district": {
   "get": {
    "parameters": [
     {
      "format": "double precision",
      "in": "query",
      "name": "lat",
      "required": true,
      "type": "number"
     },
     {
      "format": "double precision",
      "in": "query",
      "name": "lon",
      "required": true,
      "type": "number"
     },
     {
      "format": "int32",
      "in": "query",
      "name": "congress",
      "required": false,
      "type": "integer"
     }
    ],
    "produces": [
     "application/json",
     "application/vnd.pgrst.object+json;nulls=stripped",
     "application/vnd.pgrst.object+json"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "tags": [
     "(rpc) rpc_find_district"
    ]
   },
   "post": {
    "parameters": [
     {
      "in": "body",
      "name": "args",
      "required": true,
      "schema": {
       "properties": {
        "congress": {
         "format": "int32",
         "type": "integer"
        },
        "lat": {
         "format": "double precision",
         "type": "number"
        },
        "lon": {
         "format": "double precision",
         "type": "number"
        }
       },
       "required": [
        "lat",
        "lon"
       ],
       "type": "object"
      }
     },
     {
      "$ref": "#/parameters/preferParams"
     }
    ],
    "produces": [
     "application/json",
     "application/vnd.pgrst.object+json;nulls=stripped",
     "application/vnd.pgrst.object+json"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "tags": [
     "(rpc) rpc_find_district"
    ]
   }
  },
  "/rpc/rpc_districts_in_bbox": {
   "get": {
    "parameters": [
     {
      "format": "double precision",
      "in": "query",
      "name": "min_lat",
      "required": true,
      "type": "number"
     },
     {
      "format": "double precision",
      "in": "query",
      "name": "max_lat",
      "required": true,
      "type": "number"
     },
     {
      "format": "double precision",
      "in": "query",
      "name": "min_lon",
      "required": true,
      "type": "number"
     },
     {
      "format": "double precision",
      "in": "query",
      "name": "max_lon",
      "required": true,
      "type": "number"
     },
     {
      "format": "int32",
      "in": "query",
      "name": "congress",
      "required": false,
      "type": "integer"
     }
    ],
    "produces": [
     "application/json",
     "application/vnd.pgrst.object+json;nulls=stripped",
     "application/vnd.pgrst.object+json"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "tags": [
     "(rpc) rpc_districts_in_bbox"
    ]
   },
   "post": {
    "parameters": [
     {
      "in": "body",
      "name": "args",
      "required": true,
      "schema": {
       "properties": {
        "congress": {
         "format": "int32",
         "type": "integer"
        },
        "max_lat": {
         "format": "double precision",
         "type": "number"
        },
        "max_lon": {
         "format": "double precision",
         "type": "number"
        },
        "min_lat": {
         "format": "double precision",
         "type": "number"
        },
        "min_lon": {
         "format": "double precision",
         "type": "number"
        }
       },
       "required": [
        "min_lat",
        "max_lat",
        "min_lon",
        "max_lon"
       ],
       "type": "object"
      }
     },
     {
      "$ref": "#/parameters/preferParams"
     }
    ],
    "produces": [
     "application/json",
     "application/vnd.pgrst.object+json;nulls=stripped",
     "application/vnd.pgrst.object+json"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "tags": [
     "(rpc) rpc_districts_in_bbox"
    ]
   }
  }
 },
 "definitions": {
  "congressional_districts": {
   "required": [
    "id",
    "congress_number"
   ],
   "properties": {
    "id": {
     "description": "Note:\nThis is a Primary Key.<pk/>",
     "format": "int32",
     "type": "integer"
    },
    "congress_number": {
     "format": "int32",
     "type": "integer"
    },
    "statename": {
     "format": "character varying",
     "maxLength": 80,
     "type": "string"
    },
    "district": {
     "format": "int32",
     "type": "integer"
    },
    "startcong": {
     "format": "numeric",
     "type": "number"
    },
    "endcong": {
     "format": "numeric",
     "type": "number"
    },
    "district_id": {
     "format": "character varying",
     "maxLength": 80,
     "type": "string"
    },
    "districtsi": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "county": {
     "format": "character varying",
     "maxLength": 227,
     "type": "string"
    },
    "page": {
     "format": "character varying",
     "maxLength": 227,
     "type": "string"
    },
    "law": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "note": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "bestdec": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "finalnote": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "rnote": {
     "format": "character varying",
     "maxLength": 254,
     "type": "string"
    },
    "lastchange": {
     "format": "date",
     "type": "string"
    },
    "fromcounty": {
     "format": "character varying",
     "maxLength": 80,
     "type": "string"
    },
    "statefp": {
     "format": "character varying",
     "maxLength": 80,
     "type": "string"
    },
    "geom": {
     "format": "public.geometry(MultiPolygon,3857)",
     "type": "string"
    },
    "source_file": {
     "format": "character varying",
     "maxLength": 255,
     "type": "string"
    },
    "imported_at": {
     "default": "CURRENT_TIMESTAMP",
     "format": "timestamp without time zone",
     "type": "string"
    }
   },
   "type": "object"
  },
  "geometry_columns": {
   "properties": {
    "f_table_catalog": {
     "format": "character varying",
     "maxLength": 256,
     "type": "string"
    },
    "f_table_schema": {
     "format": "name",
     "type": "string"
    },
    "f_table_name": {
     "format": "name",
     "type": "string"
    },
    "f_geometry_column": {
     "format": "name",
     "type": "string"
    },
    "coord_dimension": {
     "format": "int32",
     "type": "integer"
    },
    "srid": {
     "format": "int32",
     "type": "integer"
    },
    "type": {
     "format": "character varying",
     "maxLength": 30,
     "type": "string"
    }
   },
   "type": "object"
  },
  "geography_columns": {
   "properties": {
    "f_table_catalog": {
     "format": "name",
     "type": "string"
    },
    "f_table_schema": {
     "format": "name",
     "type": "string"
    },
    "f_table_name": {
     "format": "name",
     "type": "string"
    },
    "f_geography_column": {
     "format": "name",
     "type": "string"
    },
    "coord_dimension": {
     "format": "int32",
     "type": "integer"
    },
    "srid": {
     "format": "int32",
     "type": "integer"
    },
    "type": {
     "format": "text",
     "type": "string"
    }
   },
   "type": "object"
  },
  "spatial_ref_sys": {
   "required": [
    "srid"
   ],
   "properties": {
    "srid": {
     "description": "Note:\nThis is a Primary Key.<pk/>",
     "format": "int32",
     "type": "integer"
    },
    "auth_name": {
     "format": "character varying",
     "maxLength": 256,
     "type": "string"
    },
    "auth_srid": {
     "format": "int32",
     "type": "integer"
    },
    "srtext": {
     "format": "character varying",
     "maxLength": 2048,
     "type": "string"
    },
    "proj4text": {
     "format": "character varying",
     "maxLength": 2048,
     "type": "string"
    }
   },
   "type": "object"
  }
 },
 "parameters": {
  "preferParams": {
   "name": "Prefer",
   "description": "Preference",
   "required": false,
   "in": "header",
   "type": "string"
  },
  "preferReturn": {
   "name": "Prefer",
   "description": "Preference",
   "required": false,
   "enum": [
    "return=representation",
    "return=minimal",
    "return=none"
   ],
   "in": "header",
   "type": "string"
  },
  "preferCount": {
   "name": "Prefer",
   "description": "Preference",
   "required": false,
   "enum": [
    "count=none"
   ],
   "in": "header",
   "type": "string"
  },
  "preferPost": {
   "name": "Prefer",
   "description": "Preference",
   "required": false,
   "enum": [
    "return=representation",
    "return=minimal",
    "return=none",
    "resolution=ignore-duplicates",
    "resolution=merge-duplicates"
   ],
   "in": "header",
   "type": "string"
  },
  "select": {
   "name": "select",
   "description": "Filtering Columns",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "on_conflict": {
   "name": "on_conflict",
   "description": "On Conflict",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "order": {
   "name": "order",
   "description": "Ordering",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "range": {
   "name": "Range",
   "description": "Limiting and Pagination",
   "required": false,
   "in": "header",
   "type": "string"
  },
  "rangeUnit": {
   "name": "Range-Unit",
   "description": "Limiting and Pagination",
   "required": false,
   "default": "items",
   "in": "header",
   "type": "string"
  },
  "offset": {
   "name": "offset",
   "description": "Limiting and Pagination",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "limit": {
   "name": "limit",
   "description": "Limiting and Pagination",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "body.congressional_districts": {
   "name": "congressional_districts",
   "description": "congressional_districts",
   "required": false,
   "in": "body",
   "schema": {
    "$ref": "#/definitions/congressional_districts"
   }
  },
  "rowFilter.congressional_districts.id": {
   "name": "id",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.congress_number": {
   "name": "congress_number",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.statename": {
   "name": "statename",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.district": {
   "name": "district",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.startcong": {
   "name": "startcong",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.endcong": {
   "name": "endcong",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.district_id": {
   "name": "district_id",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.districtsi": {
   "name": "districtsi",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.county": {
   "name": "county",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.page": {
   "name": "page",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.law": {
   "name": "law",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.note": {
   "name": "note",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.bestdec": {
   "name": "bestdec",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.finalnote": {
   "name": "finalnote",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.rnote": {
   "name": "rnote",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.lastchange": {
   "name": "lastchange",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.fromcounty": {
   "name": "fromcounty",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.statefp": {
   "name": "statefp",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.geom": {
   "name": "geom",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.source_file": {
   "name": "source_file",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.congressional_districts.imported_at": {
   "name": "imported_at",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "body.geometry_columns": {
   "name": "geometry_columns",
   "description": "geometry_columns",
   "required": false,
   "in": "body",
   "schema": {
    "$ref": "#/definitions/geometry_columns"
   }
  },
  "rowFilter.geometry_columns.f_table_catalog": {
   "name": "f_table_catalog",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.f_table_schema": {
   "name": "f_table_schema",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.f_table_name": {
   "name": "f_table_name",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.f_geometry_column": {
   "name": "f_geometry_column",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.coord_dimension": {
   "name": "coord_dimension",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.srid": {
   "name": "srid",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geometry_columns.type": {
   "name": "type",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "body.geography_columns": {
   "name": "geography_columns",
   "description": "geography_columns",
   "required": false,
   "in": "body",
   "schema": {
    "$ref": "#/definitions/geography_columns"
   }
  },
  "rowFilter.geography_columns.f_table_catalog": {
   "name": "f_table_catalog",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.f_table_schema": {
   "name": "f_table_schema",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.f_table_name": {
   "name": "f_table_name",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.f_geography_column": {
   "name": "f_geography_column",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.coord_dimension": {
   "name": "coord_dimension",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.srid": {
   "name": "srid",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.geography_columns.type": {
   "name": "type",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "body.spatial_ref_sys": {
   "name": "spatial_ref_sys",
   "description": "spatial_ref_sys",
   "required": false,
   "in": "body",
   "schema": {
    "$ref": "#/definitions/spatial_ref_sys"
   }
  },
  "rowFilter.spatial_ref_sys.srid": {
   "name": "srid",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.spatial_ref_sys.auth_name": {
   "name": "auth_name",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.spatial_ref_sys.auth_srid": {
   "name": "auth_srid",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.spatial_ref_sys.srtext": {
   "name": "srtext",
   "required": false,
   "in": "query",
   "type": "string"
  },
  "rowFilter.spatial_ref_sys.proj4text": {
   "name": "proj4text",
   "required": false,
   "in": "query",
   "type": "string"
  }
 },
 "externalDocs": {
  "description": "PostgREST Documentation",
  "url": "https://postgrest.org/en/v14/references/api.html"
 }
}
