{
  "openapi": "3.0.4",
  "info": {
    "title": "Accessibility Score API",
    "description": "Scores service",
    "version": "1.0.0"
  },
  "paths": {
    "/pois-batch/{dataPackageId}": {
      "post": {
        "tags": [
          "Batches Of Scores And Pois"
        ],
        "summary": "Create a batch of scores and pois.",
        "parameters": [
          {
            "name": "dataPackageId",
            "in": "path",
            "description": "The identifier of the data package which is used for the calculation.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "A batch request contains all coordinates from which to calculate the connectivity.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PoisBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PoisBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PoisBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatchCreationResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatchCreationResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatchCreationResult"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error with additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error with code 400 and additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The specified resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pois-batch/{dataPackageId}/{poisBatchId}": {
      "get": {
        "tags": [
          "Batches Of Scores And Pois"
        ],
        "summary": "Get a batch of scores and pois.",
        "parameters": [
          {
            "name": "dataPackageId",
            "in": "path",
            "description": "The identifier of the data package which is used for the calculation.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "poisBatchId",
            "in": "path",
            "description": "The identifier of the batch processing.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatch"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatch"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoisBatch"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error with additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error with code 400 and additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The specified resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/descriptions/{dataPackageId}": {
      "get": {
        "tags": [
          "Descriptions"
        ],
        "summary": "Retrieve accessibility score description.",
        "parameters": [
          {
            "name": "dataPackageId",
            "in": "path",
            "description": "The data package Id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Description for the data package.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDescription"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error with additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error with code 400 and additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The specified resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quotas": {
      "get": {
        "tags": [
          "Quotas"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsQuota"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsQuota"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsQuota"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error with additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error with code 400 and additional information related to the error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The specified resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Category": {
        "type": "object",
        "properties": {
          "categoryName": {
            "type": "string",
            "nullable": true
          },
          "subCategories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CategoryScore": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "description": "POI category.",
            "nullable": true
          },
          "scoreValue": {
            "type": "number",
            "description": "Value of Accessibility Score component.",
            "format": "double"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryScore"
            },
            "description": "List of components from which the aggregated accessibility score is calculated.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Score value and its composition for a given category."
      },
      "CausingError": {
        "required": [
          "description",
          "errorCode"
        ],
        "type": "object",
        "properties": {
          "description": {
            "minLength": 1,
            "type": "string",
            "description": "A human readable message that describes the error."
          },
          "errorCode": {
            "minLength": 1,
            "type": "string",
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information in additional properties which are described with the code they apply to. They are of type string unless otherwise specified.\n            \nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.\n            \n**Error codes for** `GENERAL_VALIDATION_ERROR`\n* `GENERAL_INVALID_VALUE` - A parameter is set to an invalid value.\n* `value` - The invalid value.\n* `GENERAL_UNRECOGNIZED_PARAMETER` - A parameter is unknown.\n* `GENERAL_MISSING_PARAMETER` - A required parameter is missing.\n* `GENERAL_MINIMUM_LENGTH_VIOLATED` - The minimum length is violated.\n* `minimumLength` - The minimum length (integer).\n* `GENERAL_MAXIMUM_LENGTH_VIOLATED` - The maximum length is violated.\n* `maximumLength` - The maximum length (integer).\n* `GENERAL_DUPLICATE_ID` - Two or more objects of the same type have the same ID.\n* `value` - The duplicated value.\n* `indexes` - The list indexes of the objects with the same ID.\n* `GENERAL_INVALID_INTERVAL` - A time interval is invalid, i.e. start is greater than end.\n* `GENERAL_MINIMUM_VALUE_VIOLATED` - The minimum value restriction is violated.\n* `minimumValue` - The minimum value (integer or double).\n* `GENERAL_MAXIMUM_VALUE_VIOLATED` - The maximum value restriction is violated.\n* `maximumValue` - The maximum value (integer or double).\n* `GENERAL_DUPLICATE_PARAMETER` - A parameter is duplicated.\n* `GENERAL_INVALID_LIST` - A list has an invalid format such as duplicate commas.\n* `value` - The invalid list."
          },
          "parameter": {
            "type": "string",
            "description": "The name of the affected query or path parameter or a JSONPath to the affected property of the request.",
            "nullable": true
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "description": "Additional properties specific to this error class.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConnectionData": {
        "required": [
          "distance",
          "referenceCoordinateId",
          "transportMode",
          "travelTime"
        ],
        "type": "object",
        "properties": {
          "transportMode": {
            "type": "string",
            "description": "Mode of transportation for connection.",
            "nullable": true
          },
          "referenceCoordinateId": {
            "type": "string",
            "description": "Corresponds to coordinateId in request.",
            "nullable": true
          },
          "distance": {
            "type": "number",
            "description": "Distance from reference location to POI in meters.",
            "format": "double"
          },
          "travelTime": {
            "type": "number",
            "description": "Travel time from reference location to POI in minutes.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Distance and travel time for mode and reference coordinate against POI location."
      },
      "CoordinateScores": {
        "required": [
          "coordinateId"
        ],
        "type": "object",
        "properties": {
          "coordinateId": {
            "type": "string",
            "description": "Identifier which is used in response to reference this location.",
            "nullable": true
          },
          "scores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransportModeScore"
            },
            "description": "Accessibility scores for reference locations. The first level shows aggregated values for a mode of transportation. The following levels show accessibility scores for the respective subcategories are provided.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Scores for a specific coordinate."
      },
      "DataDescription": {
        "required": [
          "containerName"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description of the data.",
            "nullable": true
          },
          "dataType": {
            "type": "string",
            "description": "Contact mail for additional information/questions.",
            "nullable": true
          },
          "purchaseStatus": {
            "type": "string",
            "description": "Purchase Status will categorize free or paid package",
            "nullable": true
          },
          "version": {
            "type": "string",
            "description": "Version of the data.",
            "nullable": true
          },
          "containerName": {
            "type": "string",
            "description": "Container Name of the data.",
            "nullable": true
          },
          "updated": {
            "type": "string",
            "description": "Last modified date of the data.",
            "format": "date-time"
          },
          "packageId": {
            "type": "string",
            "description": "Identifier of the data.",
            "nullable": true
          },
          "dataCoverage": {
            "description": "Area that covers the data.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Title of the data.",
            "nullable": true
          },
          "transportModes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Transport modes for which score values are available.",
            "nullable": true
          },
          "scoreCategories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            },
            "description": "The categories for which score values are available.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "All the properties of the data package."
      },
      "ErrorResponse": {
        "required": [
          "description",
          "errorCode",
          "traceId"
        ],
        "type": "object",
        "properties": {
          "traceId": {
            "minLength": 1,
            "type": "string",
            "description": "A unique identifier of the corresponding trace forest. It can be used to trace errors by the support."
          },
          "errorId": {
            "type": "string",
            "description": "A unique identifier specific to this error instance. It can be used to trace errors by the support.",
            "nullable": true
          },
          "description": {
            "minLength": 1,
            "type": "string",
            "description": "A human readable message that describes the error."
          },
          "errorCode": {
            "minLength": 1,
            "type": "string",
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information in additional properties which are described with the code they apply to. They are of type string unless otherwise specified.\n            \nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.\n**Error codes for** `GENERAL_VALIDATION_ERROR`\n            \n**HTTP status code: 400**\n* `GENERAL_VALIDATION_ERROR` - The validation of the request failed. Details can be found in **causes**.\n* `GENERAL_PARSING_ERROR` - The JSON syntax is invalid.\n* `message` - An additional error message.\n\n**HTTP status code: 401**\n* `GENERAL_UNAUTHENTICATED` - Invalid or missing authentication credentials.\n* `message` - An additional error message.\n\n**HTTP status code: 403**\n* `GENERAL_FORBIDDEN` - Insufficient access rights.\n* `GENERAL_QUOTA_EXCEEDED` - The transaction limit is exceeded.\n* `message` - An additional error message.\n            \n**HTTP status code: 404**\n* `GENERAL_RESOURCE_NOT_FOUND` - A requested resource does not exist.\n* `message` - An additional error message.\n            \n**HTTP status code: 429**\n* `GENERAL_RATE_LIMIT_EXCEEDED` - The rate limit is exceeded.\n            \n**HTTP status code: 500**\n* `GENERAL_INTERNAL_SERVER_ERROR` - The request could not be processed due to an internal error.\n* `message` - An additional error message.\n* `hint` - A hint how to solve the problem.\n            \n**HTTP status code: 503**\n* `GENERAL_SERVICE_UNAVAILABLE` - The service is temporarily unavailable."
          },
          "causes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CausingError"
            },
            "description": "A list of affected parameters and/or properties that caused this error.",
            "nullable": true
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "description": "Additional properties specific to this error class.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Contains information regarding an error that occurred on the\nserver during computing a request.\n\nBoth the correlation id and the error id can be used to get \nmore information about the kind of the error. Please submit\nboth ids with a support ticket."
      },
      "IActionResult": {
        "type": "object",
        "additionalProperties": false
      },
      "IdentifiableCoordinate": {
        "required": [
          "coordinateId"
        ],
        "type": "object",
        "properties": {
          "coordinateId": {
            "type": "string",
            "description": "Identifier which is used in response to reference this location.",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "description": "The latitude value in degrees (WGS84/EPSG:4326) from south to north.",
            "format": "double"
          },
          "longitude": {
            "type": "number",
            "description": "The longitude value in degrees (WGS84/EPSG:4326) from west to east.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "A referencable geographic coordinate."
      },
      "Poi": {
        "type": "object",
        "properties": {
          "poiId": {
            "type": "string",
            "description": "A unique identifier of the POI.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Name of the POI.",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "description": "The latitude in degrees (WGS84/EPSG:4326).",
            "format": "double"
          },
          "longitude": {
            "type": "number",
            "description": "The longitude in degrees (WGS84/EPSG:4326).",
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of categories and subcategories to which the POI belongs.",
            "nullable": true
          },
          "connectionsData": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionData"
            },
            "description": "Travel times and distances from reference location to POI.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "POI data with relative information to reference coordinates."
      },
      "PoisBatch": {
        "required": [
          "poisBatchId",
          "status"
        ],
        "type": "object",
        "properties": {
          "poisBatchId": {
            "type": "string",
            "description": "The identifier of the batch processing.",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/PoisBatchStatusValue"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorResponse"
          },
          "referenceCoordinates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentifiableCoordinate"
            },
            "description": "Array of locations and corresponding unique identifiers.",
            "nullable": true
          },
          "poiData": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Poi"
            },
            "description": "Array with POIs and corresponding travel times and distances from reference locations.",
            "nullable": true
          },
          "scores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CoordinateScores"
            },
            "description": "Computed scores for each reference coordinate and mode.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "All information about the content and status of the connections batch."
      },
      "PoisBatchCreationResult": {
        "required": [
          "poisBatchId"
        ],
        "type": "object",
        "properties": {
          "poisBatchId": {
            "type": "string",
            "description": "The identifier of the batch processing.",
            "format": "uuid"
          },
          "referenceCoordinates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentifiableCoordinate"
            },
            "description": "Array of locations and corresponding unique identifiers.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The information's about the content of the pois batch."
      },
      "PoisBatchRequest": {
        "type": "object",
        "properties": {
          "referenceCoordinates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentifiableCoordinate"
            },
            "description": "Array of locations and corresponding unique identifiers.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The request body specifies the locations for which scores and travel times should be calculated."
      },
      "PoisBatchStatusValue": {
        "enum": [
          "PROCESSING",
          "FAILED",
          "AVAILABLE"
        ],
        "type": "string",
        "description": "The value that the POI batch status can take.",
        "x-enum-varnames": [
          "PROCESSING",
          "FAILED",
          "AVAILABLE"
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "TransactionsQuota": {
        "type": "object",
        "properties": {
          "used": {
            "type": "number",
            "format": "double"
          },
          "availablePerDay": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "TransportModeScore": {
        "type": "object",
        "properties": {
          "transportMode": {
            "type": "string",
            "description": "Mode of transportation for accessibility score.",
            "nullable": true
          },
          "scoreValue": {
            "type": "number",
            "description": "Value of aggregated Accessibility Score for mode.",
            "format": "double"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryScore"
            },
            "description": "List of components from which the aggregated accessibility score is calculated.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Score value and its composition for a given transport mode."
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "apiKey"
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.ptvgroup.tech/accessibilityscore/v1"
    }
  ]
}