{
  "openapi": "3.0.4",
  "info": {
    "title": "Geonorge nedlastings-API",
    "description": "### *Note: the* latest definition *points to the latest version of the API. Requests to an unversioned route (e.g. /api/<some-endpoint>) as documented in this page, will always point to the latest version of the API (currently v3) To ensure not being subject to breaking changes, use /api/v3/<some-endpoint>. The latest definition (unversioned route) may be subject to potential breaking changes (for instance, say v4 is added then using unversioned route will point to v4 instead). To see different definitions, use the drop down at the top right of this page*\n### A client will start by calling capabilities (api/capabilities/{metadataUuid}) this is the root API call for a dataset. Capabilities will announce the rest of the resources with links (href) and relation (rel). \n### For more info implementing the API please also see [documentation](https://nedlasting.geonorge.no/help/documentation)",
    "version": "latest"
  },
  "paths": {
    "/api/capabilities/{metadataUuid}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "summary": "Get Capabilities from download service",
        "parameters": [
          {
            "name": "metadataUuid",
            "in": "path",
            "description": "The metadata identifier",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilitiesType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilitiesType"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/codelists/projection/{metadataUuid}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "summary": "Get Projections from download service",
        "parameters": [
          {
            "name": "metadataUuid",
            "in": "path",
            "description": "The metadata identifier",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectionType"
                  },
                  "xml": { }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectionType"
                  },
                  "xml": { }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/codelists/area/{metadataUuid}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "summary": "Get Areas from download service",
        "parameters": [
          {
            "name": "metadataUuid",
            "in": "path",
            "description": "The metadata identifier",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AreaType"
                  },
                  "xml": { }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AreaType"
                  },
                  "xml": { }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/codelists/format/{metadataUuid}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "summary": "Get Format from download service",
        "parameters": [
          {
            "name": "metadataUuid",
            "in": "path",
            "description": "The metadata identifier",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormatType"
                  },
                  "xml": { }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormatType"
                  },
                  "xml": { }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/can-download": {
      "post": {
        "tags": [
          "Capabilities"
        ],
        "summary": "If polygon is selected, checks if coordinates is within the maximum allowable area that can be downloaded",
        "requestBody": {
          "description": "The request containing coordinates, coordinate system, and metadata UUID",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanDownloadRequestType"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/CanDownloadRequestType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanDownloadResponseType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/CanDownloadResponseType"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/validate-clipperfile/{metadataUuid}": {
      "post": {
        "tags": [
          "Capabilities"
        ],
        "summary": "If clipper file is selected, checks if file is valid",
        "parameters": [
          {
            "name": "metadataUuid",
            "in": "path",
            "description": "The metadata identifier",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The uploaded clipper file",
                    "format": "binary",
                    "xml": {
                      "name": "IFormFile"
                    }
                  }
                }
              },
              "encoding": {
                "file": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClipperFileResponseType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ClipperFileResponseType"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/download/order/{orderUuid}/bundle": {
      "get": {
        "tags": [
          "Download"
        ],
        "summary": "Get file to download for order",
        "parameters": [
          {
            "name": "orderUuid",
            "in": "path",
            "description": "The reference number returned from the order",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "xml": {
                    "name": "FileResult"
                  }
                }
              }
            }
          },
          "302": {
            "description": "Found"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/download/order/{orderUuid}/{fileId}": {
      "get": {
        "tags": [
          "Download"
        ],
        "summary": "Get file to download for order",
        "parameters": [
          {
            "name": "orderUuid",
            "in": "path",
            "description": "The reference number returned from the order",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "description": "The fileId to download from order",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "xml": {
                    "name": "FileResult"
                  }
                }
              }
            }
          },
          "302": {
            "description": "Found"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/download/validate-user": {
      "get": {
        "tags": [
          "Download"
        ],
        "summary": "Validate user",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/download/file/{datasetUuid}/{fileUuid}": {
      "get": {
        "tags": [
          "Download"
        ],
        "summary": "Download a file directly based on dataset uuid and file uuid. This method is used by the atom feed and desktop download client.\nRestricted files are secured with BAAT-authentication (SAML) and local machine accounts (Basic authentication)",
        "parameters": [
          {
            "name": "datasetUuid",
            "in": "path",
            "description": "metadata uuid of the dataset",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          },
          {
            "name": "fileUuid",
            "in": "path",
            "description": "the file uuid",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "xml": {
                    "name": "FileResult"
                  }
                }
              }
            }
          },
          "302": {
            "description": "Found"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/order": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Creates new order for data to download with order reference and a list of files to download if they are prepopulated, otherwise\nthe files are delivered via email",
        "requestBody": {
          "description": "OrderType model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderType"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/OrderType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "400": {
            "description": "Bad request"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    },
    "/api/order/{orderUuid}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get info about files in order",
        "parameters": [
          {
            "name": "orderUuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              }
            }
          },
          "302": {
            "description": "Found"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Updates order with info to send to bundling",
        "parameters": [
          {
            "name": "orderUuid",
            "in": "path",
            "description": "Uuid for order to update",
            "required": true,
            "schema": {
              "type": "string",
              "xml": { }
            }
          }
        ],
        "requestBody": {
          "description": "Currently only these fields are updated:\n* email\n* downloadAsBundle , sample: { \"downloadAsBundle\": true,\"email\": \"user@email.no\" }",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderType"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/OrderType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReceiptType"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "GeoID": [ ]
          },
          {
            "Machine account": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AreaType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "code": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "projections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectionType"
            },
            "nullable": true,
            "xml": {
              "name": "ProjectionType[]"
            }
          },
          "formats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormatType"
            },
            "nullable": true,
            "xml": {
              "name": "FormatType[]"
            }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "AreaType"
        },
        "example": {
          "type": "fylke",
          "name": "Agder",
          "code": "42",
          "projections": [
            {
              "code": "4258",
              "name": "EUREF 89 Geografisk (ETRS 89) 2d",
              "codespace": "http://www.opengis.net/def/crs/EPSG/0/4258",
              "formats": [
                {
                  "name": "GeoJSON"
                }
              ]
            },
            {
              "code": "25832",
              "name": "EUREF89 UTM sone 32, 2d",
              "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832",
              "formats": [
                {
                  "name": "GML"
                },
                {
                  "name": "PostGIS"
                },
                {
                  "name": "GeoJSON"
                }
              ]
            },
            {
              "code": "25833",
              "name": "EUREF89 UTM sone 33, 2d",
              "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833",
              "formats": [
                {
                  "name": "GeoJSON"
                },
                {
                  "name": "GML"
                },
                {
                  "name": "PostGIS"
                }
              ]
            }
          ],
          "formats": [
            {
              "name": "GeoJSON",
              "projections": [
                {
                  "code": "4258",
                  "name": "EUREF 89 Geografisk (ETRS 89) 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/4258"
                },
                {
                  "code": "25833",
                  "name": "EUREF89 UTM sone 33, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
                },
                {
                  "code": "25832",
                  "name": "EUREF89 UTM sone 32, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
                }
              ]
            },
            {
              "name": "GML",
              "projections": [
                {
                  "code": "25832",
                  "name": "EUREF89 UTM sone 32, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
                },
                {
                  "code": "25833",
                  "name": "EUREF89 UTM sone 33, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
                }
              ]
            },
            {
              "name": "PostGIS",
              "projections": [
                {
                  "code": "25832",
                  "name": "EUREF89 UTM sone 32, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
                },
                {
                  "code": "25833",
                  "name": "EUREF89 UTM sone 33, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
                }
              ]
            }
          ]
        }
      },
      "CanDownloadRequestType": {
        "type": "object",
        "properties": {
          "metadataUuid": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "coordinates": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "coordinateSystem": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "CanDownloadRequestType"
        },
        "example": {
          "metadataUuid": "73f863ba-628f-48af-b7fa-30d3ab331b8d",
          "coordinates": "344754 7272921 404330 7187619 304134 7156477 344754 7272921",
          "coordinateSystem": "25833"
        }
      },
      "CanDownloadResponseType": {
        "type": "object",
        "properties": {
          "canDownload": {
            "type": "boolean",
            "xml": { }
          },
          "message": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "CanDownloadResponseType"
        },
        "example": {
          "canDownload": true
        }
      },
      "CapabilitiesType": {
        "type": "object",
        "properties": {
          "supportsProjectionSelection": {
            "type": "boolean",
            "xml": { }
          },
          "supportsFormatSelection": {
            "type": "boolean",
            "xml": { }
          },
          "supportsPolygonSelection": {
            "type": "boolean",
            "xml": { }
          },
          "supportsAreaSelection": {
            "type": "boolean",
            "xml": { }
          },
          "mapSelectionLayer": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "supportsDownloadBundling": {
            "type": "boolean",
            "xml": { }
          },
          "distributedBy": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "accessConstraintRequiredRole": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "deliveryNotificationByEmail": {
            "type": "boolean",
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "CapabilitiesType"
        },
        "example": {
          "supportsProjectionSelection": true,
          "supportsFormatSelection": true,
          "supportsPolygonSelection": true,
          "supportsAreaSelection": true,
          "mapSelectionLayer": "raster-n250",
          "supportsDownloadBundling": true,
          "distributedBy": "Geonorge",
          "deliveryNotificationByEmail": false,
          "_links": [
            {
              "href": "https://nedlasting.geonorge.no/api/codelists/projection/041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "rel": "http://rel.geonorge.no/download/projection"
            },
            {
              "href": "https://nedlasting.geonorge.no/api/codelists/format/041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "rel": "http://rel.geonorge.no/download/format"
            },
            {
              "href": "https://nedlasting.geonorge.no/api/codelists/area/041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "rel": "http://rel.geonorge.no/download/area"
            },
            {
              "href": "https://nedlasting.geonorge.no/api/order",
              "rel": "http://rel.geonorge.no/download/order"
            },
            {
              "href": "https://nedlasting.geonorge.no/api/capabilities/041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "rel": "self"
            },
            {
              "href": "https://nedlasting.geonorge.no/api/can-download",
              "rel": "http://rel.geonorge.no/download/can-download"
            }
          ]
        }
      },
      "ClipperFileResponseType": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "xml": { }
          },
          "message": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "url": {
            "type": "string",
            "nullable": true,
            "xml": { }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "ClipperFileResponseType"
        },
        "example": {
          "valid": true,
          "message": "",
          "url": "https://nedlasting.geonorge.no/clipperfiles/3114fe13-43ga-26c5-91da-2e3e533f23ca.geojson"
        }
      },
      "FileType": {
        "type": "object",
        "properties": {
          "downloadUrl": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "fileSize": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "fileId": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "metadataUuid": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "area": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "coordinates": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "projection": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "format": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "status": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "metadataName": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "areaName": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "projectionName": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "FileType"
        }
      },
      "FormatType": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "version": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "projections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectionType"
            },
            "nullable": true,
            "xml": {
              "name": "ProjectionType[]"
            }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "FormatType"
        },
        "example": [
          {
            "name": "GeoJSON",
            "projections": [
              {
                "code": "25832",
                "name": "EUREF89 UTM sone 32, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
              },
              {
                "code": "25833",
                "name": "EUREF89 UTM sone 33, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
              },
              {
                "code": "4258",
                "name": "EUREF 89 Geografisk (ETRS 89) 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/4258"
              }
            ]
          },
          {
            "name": "GML",
            "projections": [
              {
                "code": "25832",
                "name": "EUREF89 UTM sone 32, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
              },
              {
                "code": "25833",
                "name": "EUREF89 UTM sone 33, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
              }
            ]
          },
          {
            "name": "PostGIS",
            "projections": [
              {
                "code": "25832",
                "name": "EUREF89 UTM sone 32, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
              },
              {
                "code": "25833",
                "name": "EUREF89 UTM sone 33, 2d",
                "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833"
              }
            ]
          }
        ]
      },
      "LinkType": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "rel": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "templated": {
            "type": "boolean",
            "xml": { }
          },
          "templatedSpecified": {
            "type": "boolean",
            "xml": { }
          },
          "type": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "deprecation": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "title": {
            "type": "string",
            "nullable": true,
            "xml": { }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "LinkType"
        }
      },
      "OrderAreaType": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "type": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "OrderAreaType"
        }
      },
      "OrderLineType": {
        "type": "object",
        "properties": {
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderAreaType"
            },
            "nullable": true,
            "xml": {
              "name": "OrderAreaType[]"
            }
          },
          "formats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormatType"
            },
            "nullable": true,
            "xml": {
              "name": "FormatType[]"
            }
          },
          "metadataUuid": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "projections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectionType"
            },
            "nullable": true,
            "xml": {
              "name": "ProjectionType[]"
            }
          },
          "coordinates": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "coordinatesystem": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "clipperFile": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "usagePurpose": {
            "type": "array",
            "items": {
              "type": "string",
              "xml": { }
            },
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "OrderLineType"
        }
      },
      "OrderReceiptType": {
        "type": "object",
        "properties": {
          "referenceNumber": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileType"
            },
            "nullable": true,
            "xml": {
              "name": "FileType[]"
            }
          },
          "email": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "orderDate": {
            "type": "string",
            "format": "date-time",
            "xml": { }
          },
          "downloadAsBundle": {
            "type": "boolean",
            "xml": { }
          },
          "downloadBundleUrl": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "OrderReceiptType"
        },
        "example": {
          "referenceNumber": "3f854e9c-5345-4428-b2fd-1ea3db5d2f7a",
          "files": [
            {
              "downloadUrl": "https://nedlasting.geonorge.no/api/download/order/3f854e9c-5345-4428-b2fd-1ea3db5d2f7a/0e23b13e-cd0f-4d24-9497-408c4f65aa33",
              "name": "Basisdata_32_Akershus_25832_Kommuner_GeoJSON.zip",
              "fileId": "0e23b13e-cd0f-4d24-9497-408c4f65aa33",
              "metadataUuid": "041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "area": "32",
              "projection": "25832",
              "format": "GeoJSON ",
              "status": "ReadyForDownload",
              "metadataName": "Kommuner",
              "areaName": "Akershus",
              "projectionName": "EUREF89 UTM sone 32, 2d"
            },
            {
              "downloadUrl": "https://nedlasting.geonorge.no/api/download/order/3f854e9c-5345-4428-b2fd-1ea3db5d2f7a/64303302-b64e-46e2-8fa6-b31bee8f23da",
              "name": "Basisdata_32_Akershus_25832_Kommuner_GML.zip",
              "fileId": "64303302-b64e-46e2-8fa6-b31bee8f23da",
              "metadataUuid": "041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "area": "32",
              "projection": "25832",
              "format": "GML 3.2.1",
              "status": "ReadyForDownload",
              "metadataName": "Kommuner",
              "areaName": "Akershus",
              "projectionName": "EUREF89 UTM sone 32, 2d"
            }
          ],
          "email": "bruker@epost.no",
          "orderDate": "2025-09-23T12:00:00.0Z",
          "downloadAsBundle": false
        }
      },
      "OrderType": {
        "type": "object",
        "properties": {
          "downloadAsBundle": {
            "type": "boolean",
            "xml": { }
          },
          "email": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "downloadBundleUrl": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "orderLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineType"
            },
            "nullable": true,
            "xml": {
              "name": "OrderLineType[]"
            }
          },
          "usageGroup": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "softwareClient": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "softwareClientVersion": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "OrderType"
        },
        "example": {
          "downloadAsBundle": false,
          "email": "bruker@epost.no",
          "orderLines": [
            {
              "areas": [
                {
                  "code": "32",
                  "name": "Akershus",
                  "type": "fylke"
                }
              ],
              "formats": [
                {
                  "name": "GeoJSON "
                },
                {
                  "name": "GML 3.2.1"
                }
              ],
              "metadataUuid": "041f1e6e-bdbc-4091-b48f-8a5990f3cc5b",
              "projections": [
                {
                  "code": "25832",
                  "name": "EUREF89 UTM sone 32, 2d",
                  "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832"
                }
              ]
            }
          ]
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "title": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "xml": { }
          },
          "detail": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "instance": {
            "type": "string",
            "nullable": true,
            "xml": { }
          }
        },
        "additionalProperties": {
          "xml": { }
        },
        "xml": {
          "name": "ProblemDetails"
        }
      },
      "ProjectionType": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "name": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "codespace": {
            "type": "string",
            "nullable": true,
            "xml": { }
          },
          "formats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormatType"
            },
            "nullable": true,
            "xml": {
              "name": "FormatType[]"
            }
          },
          "_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkType"
            },
            "nullable": true,
            "xml": {
              "name": "LinkType[]"
            }
          }
        },
        "additionalProperties": false,
        "xml": {
          "name": "ProjectionType"
        },
        "example": [
          {
            "code": "25832",
            "name": "EUREF89 UTM sone 32, 2d",
            "codespace": "http://www.opengis.net/def/crs/EPSG/0/25832",
            "formats": [
              {
                "name": "GeoJSON"
              },
              {
                "name": "GML 3.2.1"
              },
              {
                "name": "PostGIS 12"
              }
            ]
          },
          {
            "code": "25833",
            "name": "EUREF89 UTM sone 33, 2d",
            "codespace": "http://www.opengis.net/def/crs/EPSG/0/25833",
            "formats": [
              {
                "name": "GeoJSON"
              },
              {
                "name": "GML 3.2.1"
              },
              {
                "name": "PostGIS 12"
              }
            ]
          },
          {
            "code": "4258",
            "name": "EUREF 89 Geografisk (ETRS 89) 2d",
            "codespace": "http://www.opengis.net/def/crs/EPSG/0/4258",
            "formats": [
              {
                "name": "GeoJSON"
              }
            ]
          }
        ]
      }
    },
    "securitySchemes": {
      "GeoID": {
        "type": "http",
        "description": "GeoID access token.",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      },
      "Machine account": {
        "type": "http",
        "description": "For machine accounts. Enter username and password",
        "scheme": "Basic"
      }
    }
  },
  "tags": [
    {
      "name": "Capabilities",
      "description": "Provides endpoints for retrieving dataset capabilities, supported projections, available areas, and formats for the download service API.\n            Also includes endpoints for validating clipper files and checking if a selected polygon area is within download limits.\n            All endpoints support both XML and JSON responses."
    },
    {
      "name": "Download",
      "description": "For downloading files related to orders. Endpoints to download bundles of files or individual files associated with an order, as well as validate user authentication.\n            Both open and restricted datasets are handled, ensuring that appropriate access controls are enforced based on user authentication status."
    },
    {
      "name": "Order",
      "description": "Endpoints managing orders related to data downloads. The endpoints allow users to create, update, and retrieve orders, including handling of file downloads and user authentication."
    }
  ]
}