{
  "openapi": "3.0.2",
  "info": {
    "title": "Mtaa API Documentation",
    "version": "1.0",
    "description": "Mtaa A simple REST API to access Tanzania's location information,With mtaa API you can easily query and integrate all the location in tanzania from region level to streets from your programming language of your your choice",
    "contact": {
      "name": "Mtaa API",
      "url": "https://github.com/HackEAC/mtaaAPI",
      "email": "isaackeinstein@gmail.com"
    },
    "license": {
      "name": "MIT License",
      "url": "https://github.com/HackEAC/mtaaAPI/blob/main/LICENSE"
    },
    "x-jentic-source-url": "https://raw.githubusercontent.com/Kalebu/mtaa-docs/main/openapi.yaml"
  },
  "servers": [
    {
      "url": "https://mtaa-api.herokuapp.com/api",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/{country}": {
      "get": {
        "tags": [
          "Tanzania regions"
        ],
        "summary": "Returns all regions present in Tanzania",
        "description": "Fetches all regions present in Tanzania and then return a response as json",
        "operationId": "Tanzania-regions",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "Country name in lowercase eg (Tanzania)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/{country}/{region}": {
      "get": {
        "tags": [
          "Districts in region"
        ],
        "summary": "Returns all districts in region",
        "description": "Returns a post code and all districts in a specified region",
        "operationId": "Districts-in-a-region",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "Country name in lowercase eg( tanzania)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "path",
            "description": "Name of the region eg (Mbeya)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "404": {
            "description": "Resource not Found"
          }
        }
      }
    },
    "/{country}/{region}/{district}": {
      "get": {
        "tags": [
          "Wards in a district"
        ],
        "summary": "Returns all wards in a district",
        "description": "Returns all wards in a  specified district and district postcode",
        "operationId": "Wards-in-a-district",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "Country name in lowercase eg( tanzania)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "path",
            "description": "Name of the region eg (Mbeya)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "district",
            "in": "path",
            "description": "Name of the District eg (Rungwe)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "404": {
            "description": "Resource not Found"
          }
        }
      }
    },
    "/{country}/{region}/{district}/{ward}": {
      "get": {
        "tags": [
          "Streets in a ward"
        ],
        "summary": "Returns all streets in a ward",
        "description": "Returns all streets in a specified ward and ward postcode",
        "operationId": "streets-in-a-ward",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "Country name in lowercase eg( tanzania)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "path",
            "description": "Name of the region eg (Mbeya)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "district",
            "in": "path",
            "description": "Name of the District eg (Rungwe)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ward",
            "in": "path",
            "description": "Name of the Ward eg (Kiwira)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "404": {
            "description": "Resource not Found"
          }
        }
      }
    },
    "/{country}/{region}/{district}/{ward}/{street}": {
      "get": {
        "tags": [
          "neighborhood in a street"
        ],
        "summary": "Returns all neighborhood in a street",
        "description": "Returns all neighborhood in a specified street",
        "operationId": "neighborhood-in-a-street-",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "Country name in lowercase eg( tanzania)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "path",
            "description": "Name of the region eg (Mbeya)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "district",
            "in": "path",
            "description": "Name of the District eg (Rungwe)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ward",
            "in": "path",
            "description": "Name of the Ward eg (Kiwira)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "street",
            "in": "path",
            "description": "Name of the Street eg (Ilundo)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "404": {
            "description": "Resource not Found"
          }
        }
      }
    }
  }
}