# Server API

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

Use your own server and its scoped API keys.

## Get APK links

GET /api/server/apk-links

Retrieve links to the signed APKs for the current server version, from the release destination configured for this server.

```json
{
  "description": "Retrieve links to the signed APKs for the current server version, from the release destination configured for this server.",
  "operationId": "getApkLinks",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerApkLinksDto"
          }
        }
      },
      "description": ""
    },
    "404": {
      "description": "No signed Android release is configured for this server"
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get APK links",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "server.apkLinks"
}
```

## Get app releases

GET /api/server/app-releases

Retrieve the signed release destinations of the mobile apps for this server, or that none is configured.

```json
{
  "description": "Retrieve the signed release destinations of the mobile apps for this server, or that none is configured.",
  "operationId": "getAppReleases",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerAppReleasesResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get app releases",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "server.about"
}
```

## Library preparation for this authenticated device

GET /api/server/library-setup



```json
{
  "operationId": "getLibrarySetupStatus",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LibrarySetupStatusDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Library preparation for this authenticated device",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "sync.stream"
}
```

## Start the managed library rescan

POST /api/server/library-setup/begin



```json
{
  "operationId": "beginLibrarySetup",
  "parameters": [],
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LibrarySetupStatusDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Start the managed library rescan",
  "tags": [
    "Server"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "all"
}
```

## Finish after catalog and browsing previews are cached

POST /api/server/library-setup/finish



```json
{
  "operationId": "finishLibrarySetup",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/FinishLibrarySetupDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LibrarySetupStatusDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Finish after catalog and browsing previews are cached",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "sync.stream"
}
```

## Manager machine-authenticated setup status

GET /api/server/library-setup/manager



```json
{
  "operationId": "getManagerLibrarySetup",
  "parameters": [
    {
      "name": "x-frameleaf-manager",
      "required": true,
      "in": "header",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LibrarySetupStatusDto"
          }
        }
      },
      "description": ""
    }
  },
  "summary": "Manager machine-authenticated setup status",
  "tags": [
    "Server"
  ],
  "security": []
}
```

## Manager machine-authenticated rescan

POST /api/server/library-setup/manager



```json
{
  "operationId": "beginManagerLibrarySetup",
  "parameters": [
    {
      "name": "x-frameleaf-manager",
      "required": true,
      "in": "header",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LibrarySetupStatusDto"
          }
        }
      },
      "description": ""
    }
  },
  "summary": "Manager machine-authenticated rescan",
  "tags": [
    "Server"
  ],
  "security": []
}
```

## Get supported media types

GET /api/server/media-types

Retrieve all media types supported by the server.

```json
{
  "description": "Retrieve all media types supported by the server.",
  "operationId": "getSupportedMediaTypes",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerMediaTypesResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "summary": "Get supported media types",
  "tags": [
    "Server"
  ],
  "security": []
}
```

## Get statistics

GET /api/server/statistics

Retrieve statistics about the entire Frameleaf instance such as asset counts.

```json
{
  "description": "Retrieve statistics about the entire Frameleaf instance such as asset counts.",
  "operationId": "getServerStatistics",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerStatsResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get statistics",
  "tags": [
    "Server"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "server.statistics"
}
```

## Get storage

GET /api/server/storage

Retrieve the current storage utilization information of the server.

```json
{
  "description": "Retrieve the current storage utilization information of the server.",
  "operationId": "getStorage",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerStorageResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get storage",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "server.storage"
}
```

## Get server version

GET /api/server/version

Retrieve the current server version in semantic versioning (semver) format.

```json
{
  "description": "Retrieve the current server version in semantic versioning (semver) format.",
  "operationId": "getServerVersion",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServerVersionResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "summary": "Get server version",
  "tags": [
    "Server"
  ],
  "security": []
}
```

## Get version check status

GET /api/server/version-check

Retrieve information about the last time the version check ran.

```json
{
  "description": "Retrieve information about the last time the version check ran.",
  "operationId": "getVersionCheck",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VersionCheckStateResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get version check status",
  "tags": [
    "Server"
  ],
  "x-frameleaf-permission": "server.versionCheck"
}
```

## Check for updates now

POST /api/server/version-check

Ask Frameleaf's release feed for the newest version now, whether or not automatic checks are on (About → Check for updates). No other service is contacted.

```json
{
  "description": "Ask Frameleaf's release feed for the newest version now, whether or not automatic checks are on (About → Check for updates). No other service is contacted.",
  "operationId": "checkVersionNow",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ReleaseEventV1"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Check for updates now",
  "tags": [
    "Server"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "server.versionCheck"
}
```

## Get version history

GET /api/server/version-history

Retrieve a list of past versions the server has been on.

```json
{
  "description": "Retrieve a list of past versions the server has been on.",
  "operationId": "getVersionHistory",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/ServerVersionHistoryResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "summary": "Get version history",
  "tags": [
    "Server"
  ],
  "security": []
}
```
