> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layarva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export and Download Offline Packages

> Prepare fixed content, request a package, download it and import it into a compatible Player.

## Export published content through the API

Use the export and download endpoints to create a signed offline package from an eligible Screen's published content. Follow the steps below to request the package, download it, verify it and import it into a compatible Player.

> [!NOTE]
>
> If an export endpoint returns `503`, stop the workflow. Do not repeatedly create jobs or poll an unavailable feature. Retry later when instructed, or export through the dashboard and contact support with the response `requestId`.

The API also lets you create a supported offline Screen, read its information and offline leases, and revoke an existing lease with the appropriate permissions.

## Step 1: Prepare fixed content

1. Create a Playlist using only content supported for offline playback.
2. [Set it as Ready](https://docs.layarva.com/developers/platform-playlists-publication.md#step-4-set-as-ready) and save the exact Ready version ID.
3. Publish that version to the prepared Channel and confirm the Publication.
4. Check offline eligibility in Layarva before exporting.

Online-required items must be replaced or removed. Editing a draft does not change a package already exported.

## Step 2: Create the offline Screen

The simplest flow is **Screens → Pair Screen → Offline content** in Layarva. Enter a name, select the prepared Channel, optionally choose a Location, and configure display size/fit.

If using the API, send **POST** `/screens` with `screens.create`:

```json theme={null}
{
  "name": "Lobby offline display",
  "deliveryMode": "OFFLINE",
  "channelId": "{{channel_id}}"
}
```

Use the authenticated JSON [Postman setup](https://docs.layarva.com/developers/platform-quickstart.md) and an [Idempotency-Key](https://docs.layarva.com/developers/platform-request-keys.md). A Channel is required. Plan limits apply. If Layarva asks for confirmation to use a plan Screen slot, review that choice before adding `acceptsPlanScreen: true`; do not automatically opt in.

An offline-package Screen does not use a Cloud pairing code or device token.

## Step 3: Request the package

Your Platform key needs `screens.offline-export`. Send **POST** `/screens/{{screen_id}}/offline-exports`:

* **Authorization:** your Platform Bearer key.
* **Headers:** `Content-Type: application/json` and a new Idempotency-Key.
* **Body → raw → JSON:** `{}`.

Save the returned `data.id` as `export_id`. Layarva selects the Screen's published content and permitted playback period; do not supply your own Publication ID, expiry or package contents.

An accepted request is **not** a finished download. Use the same initiating API key for the following status and download requests. That key must remain valid and authorized.

## Step 4: Check package status

Send **GET** `/offline-exports/{{export_id}}` with your Platform Bearer key and no body:

| Status | What to do |
| - | - |
| `REQUESTED` or `BUILDING` | Check again after a few seconds |
| `READY` | Save `checksumSha256`, `sizeBytes`, `expiresAt` and `leaseValidUntil`; continue to download |
| `FAILED` | Stop; inspect `failureCode` and contact support if needed |
| `CANCELLED`, `CLEANUP_PENDING` or `CLEANED` | Stop; this export cannot be used |

Stop polling at the returned `expiresAt`; do not poll indefinitely. `READY` confirms the package was built, not that a Player imported or played it. To list earlier exports created with this key, use **GET** `/screens/{{screen_id}}/offline-exports?limit=25` and follow `page.nextCursor`.

## Step 5: Download and verify the file

1. Send **GET** `/offline-exports/{{export_id}}/download` with your Platform Bearer key.
2. Copy the returned `data.url`. It is a temporary download URL valid for **60 seconds**; keep it private.
3. In a **separate** Postman request, send **GET** to that complete URL. Select **Authorization → No Auth**, overriding inherited authentication. Do not send your Platform key or Idempotency-Key to this URL.
4. Use Postman's download/save response option to save the binary package as `.lvapkg`, not JSON. If the URL expired, request a fresh one while the export and playback lease remain valid.
5. Compare the saved file's exact byte size and SHA-256 with the values from step 4 before importing.

Calculate the downloaded file's checksum and size in PowerShell:

```powershell theme={null}
$packageFile = Get-Item -LiteralPath "C:\Media\downloaded.lvapkg"
@{
  sizeBytes = $packageFile.Length
  checksumSha256 = (Get-FileHash -LiteralPath $packageFile.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
} | ConvertTo-Json
```

If either value differs, do not import the package. A new download URL does not extend the package's playback expiry.

### Dashboard alternative

1. Open the offline Screen's actions.
2. Choose **Export offline package**.
3. Review the Channel lock and playback expiry shown in the confirmation.
4. Confirm and save the downloaded `.lvapkg` package.

See the full [offline content guide](https://docs.layarva.com/screens/offline-content.md) for eligibility and package limits.

## Step 6: Import into the Player

Transfer the package to a supported Layarva Player and follow its offline import flow. Check the actual display to confirm playback.

The package contains fixed published content. To distribute changes, prepare a new Ready version, publish it, then export and import an updated package.

## Step 7: Cancel an export or revoke an offline lease

With `screens.offline-export`, cancel an unwanted export with **DELETE** `/offline-exports/{{export_id}}`, your Platform key and a new Idempotency-Key. Cancelling prevents further use of that export; it does **not** remove a package already imported into a disconnected Player or revoke its issued playback lease.

With `screens.read`, send **GET** `/screens/{{screen_id}}/offline-leases?limit=25`. Save a selected lease's `id` as `lease_id`; use `page.nextCursor` to read additional pages.

With `screens.offline-revoke`, send **POST** `/screens/{{screen_id}}/offline-revoke`:

```json theme={null}
{
  "leaseId": "{{lease_id}}"
}
```

Use the same Platform Bearer authentication, JSON body and a new operation UUID.

> [!WARNING]
>
> Revoking a lease is not immediate remote deletion or a stop command for a disconnected Player. The Player must reconnect before it can receive the revocation.

## Edge LAN or offline package?

* **Edge LAN:** Screens receive content from an Edge on the local network; see [Edge registration and Screen assignment](https://docs.layarva.com/developers/platform-edges.md).
* **Offline package:** a Player imports a downloaded `.lvapkg`; export it through the API or the dashboard.

These are different delivery modes. Do not use an Edge ID in an offline-package Screen request.

## Related guides

* [Prepare and publish Ready content](https://docs.layarva.com/developers/platform-playlists-publication.md)
* [Offline content and package import](https://docs.layarva.com/screens/offline-content.md)
* [Screen lifecycle](https://docs.layarva.com/developers/platform-screens.md)
* [Receive package-ready events](https://docs.layarva.com/developers/platform-webhooks.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.