# Download API

Source: https://frameleaf.app/docs/api/reference/download/

Use your own server and its scoped API keys.

## Download asset archive

POST /api/download/archive

Download a ZIP archive containing the specified assets. The assets must have been previously requested via the "getDownloadInfo" endpoint.

```json
{
  "description": "Download a ZIP archive containing the specified assets. The assets must have been previously requested via the \"getDownloadInfo\" endpoint.",
  "operationId": "downloadArchive",
  "parameters": [
    {
      "name": "key",
      "required": false,
      "in": "query",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "slug",
      "required": false,
      "in": "query",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DownloadArchiveDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/octet-stream": {
          "schema": {
            "format": "binary",
            "type": "string"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Download asset archive",
  "tags": [
    "Download"
  ],
  "x-frameleaf-permission": "asset.download"
}
```

## Retrieve download information

POST /api/download/info

Retrieve information about how to request a download for the specified assets or album. The response includes groups of assets that can be downloaded together.

```json
{
  "description": "Retrieve information about how to request a download for the specified assets or album. The response includes groups of assets that can be downloaded together.",
  "operationId": "getDownloadInfo",
  "parameters": [
    {
      "name": "key",
      "required": false,
      "in": "query",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "slug",
      "required": false,
      "in": "query",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DownloadInfoDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DownloadResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve download information",
  "tags": [
    "Download"
  ],
  "x-frameleaf-permission": "asset.download"
}
```
