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

# Cloud destination

> Configure where your asynchronously rendered PDFs are stored in the cloud

The `destination` parameter specifies where your PDF will be stored when using asynchronous rendering.

## Overview

When rendering PDFs asynchronously, the generated file needs to be stored somewhere. The `destination` parameter allows you to configure cloud storage details for the rendered PDF.

## Parameter details

<ResponseField name="destination" type="object" required>
  Configuration for where your PDF will be stored when using asynchronous rendering

  <Expandable title="Properties">
    <ResponseField name="provider" type="enum<string>" required>
      The cloud storage provider to use

      Available options: `aws_s3`, `google_cloud_storage`
    </ResponseField>

    <ResponseField name="bucket" type="string" required>
      The storage bucket name where the PDF will be stored
    </ResponseField>

    <ResponseField name="path" type="string" required>
      Storage path within the bucket, including the filename

      Example: `pdfs/document.pdf`
    </ResponseField>
  </Expandable>
</ResponseField>

## Authorization requirements

Before using cloud destinations, you must grant Vortex PDF permission to upload files to your cloud storage:

### Google Cloud Storage

For Google Cloud Storage, grant access to the service account by:

1. Navigate to your Google Cloud Console's IAM & Admin section
2. Add the following service account: `astronaut@vortex-pdf.iam.gserviceaccount.com`
3. Assign the role "Storage Object User" to this service account

### AWS S3

For AWS S3, add the following bucket policy to grant access:

```json theme={null}
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::015796437331:user/vortex-pdf"
            },
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
        }
    ]
}
```

Replace `YOUR-BUCKET-NAME` with your actual S3 bucket name.

## Usage

```javascript theme={null}
{
  "parts": "https://example.com",
  "destination": {
    "provider": "aws_s3",
    "bucket": "my-pdf-bucket",
    "path": "reports/document.pdf"
  }
}
```

## Behavior

When you submit an asynchronous rendering request with a destination, the API will:

1. Accept your request and return immediately with a success status
2. Process the rendering in the background
3. Upload the completed PDF to the specified cloud destination
4. Notify you via webhook (if configured) when the process is complete

## Use cases

This parameter is particularly useful for:

1. **Large document generation**: When rendering complex or large documents that may take time to process
2. **Background processing**: When you want to initiate rendering without waiting for completion
3. **Direct cloud storage**: When you want PDFs delivered directly to your cloud storage without intermediary steps

## Related parameters

The `destination` parameter is often used together with the `webhook` parameter, which allows you to receive a notification when the rendering is complete:

```javascript theme={null}
{
  "parts": "https://example.com",
  "destination": {
    "provider": "aws_s3",
    "bucket": "my-pdf-bucket",
    "path": "reports/document.pdf"
  },
  "webhook": {
    "url": "https://myapp.com/webhooks/pdf-complete",
    "headers": {
      "Authorization": "Bearer your-secret-token"
    }
  }
}
```

The webhook will receive a POST request with information about the completed rendering, including the status and location of the generated PDF.
