> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# How to cache an existing unsigned envelope to use offline

> Learn how to cache (download) an unsigned envelope with the Android SDK to use offline.

This topic demonstrates how to cache (download) an unsigned [envelope](/docs/esign-rest-api/esign101/concepts/envelopes) to use offline. An envelope can only be downloaded on your mobile device if it has a status of `sent` or `delivered`, and the account used for authentication has been either:

* set as the host for an [In Person Signer](https://support.docusign.com/s/document-item?rsc_301\&bundleId=gav1643676262430\&topicId=hak1578456316043.html) or
* assigned [tabs](/docs/esign-rest-api/esign101/concepts/tabs) in the envelope.

> **Note:** Any previously cached version of an envelope with the same envelope ID will be removed, and any progress for completed signers will be lost.

## Required data

Running the code in this how-to requires this data:

| Data element   | Description                                                                                                                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \{ENVELOPE_ID} | A [GUID](http://guid.one/) value that identifies a Docusign [envelope](/docs/esign-rest-api/esign101/concepts/envelopes). This value is automatically generated by Docusign when the envelope is created. |

## Step 1. Log in to Docusign

To make the API call shown in this how-to, you must be logged in to Docusign.

See [How to log in to Docusign from your app](/docs/mobile-sdks/android-sdk/how-to/log-in) for details.

## Step 2. Cache an envelope

Use the method shown to cache an envelope. Make sure to substitute \{ENVELOPE_ID} with the envelope ID of an unsigned envelope that has [tabs](/docs/esign-rest-api/esign101/concepts/tabs) associated with your account.

**`Java`**

```java title="Java"
DSEnvelopeDelegate envelopeDelegate = DocuSign.getInstance().getEnvelopeDelegate();
envelopeDelegate.cacheEnvelope("{ENVELOPE_ID}",
    new DSCacheEnvelopeListener() {
        @Override
        public void onStart() {
            Log.d("cacheEnvelope", "cacheEnvelope start");
        }

        @Override
        public void onComplete(DSEnvelope envelope) {
            Log.d("cacheEnvelope", "envelope ID: " + envelope.getEnvelopeId() + "successfully cached");
        }

        @Override
        public void onError(DSEnvelopeException exception) {
            Log.e("cacheEnvelope", exception.getLocalizedMessage());
        }
    }
);
```

**`Kotlin`**

```kotlin title="Kotlin"
val envelopeDelegate = DocuSign.getInstance().getEnvelopeDelegate()
envelopeDelegate.cacheEnvelope("{ENVELOPE_ID}",
    object : DSCacheEnvelopeListener {
        override fun onStart() {
            Log.d("cacheEnvelope", "cacheEnvelope start")
        }

        override fun onComplete(envelope: DSEnvelope) {
            Log.d(
                "cacheEnvelope",
                "envelope ID: " + envelope.envelopeId + "successfully cached"
            )
        }

        override fun onError(exception: DSEnvelopeException) {
            Log.e("cacheEnvelope", exception.localizedMessage)
        }
    }
)
```

## Expected response

The [onComplete](https://docusign.github.io/mobile-android-sdk/sdk-common/com.docusign.androidsdk.listeners/-d-s-cache-envelope-listener/on-complete.html) method in the listener defined in Step 2 should be triggered.

## Next steps

* Learn [How to start the signing process for an unsigned envelope without connectivity (offline)](/docs/mobile-sdks/android-sdk/how-to/start-signing-offline).
* See [How to sync offline signed envelopes](/docs/mobile-sdks/android-sdk/how-to/sync-offline).
* Learn [How to create an envelope for offline signing (PDF)](/docs/mobile-sdks/android-sdk/how-to/offline-signing-pdf).
* See [Preparing envelopes for mobile offline signing](https://support.docusign.com/s/document-item?rsc_301\&bundleId=gub1579795684748\&topicId=rxa1579795665285.html).