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

# Statement Download

> Get a signed download URL for a statement file.

## Download Statement

Returns a signed download URL for a statement's original file. The URL expires in 1 hour.

### Request

```
GET /v1/statements/{statement_id}/download
```

### Path Parameters

| Parameter      | Type    | Required | Description      |
| -------------- | ------- | -------- | ---------------- |
| `statement_id` | integer | Yes      | The statement ID |

### Query Parameters

| Parameter   | Type | Required | Default | Description                          |
| ----------- | ---- | -------- | ------- | ------------------------------------ |
| `projectId` | UUID | Yes      | —       | The project the statement belongs to |

### Headers

| Header          | Required | Description                                                |
| --------------- | -------- | ---------------------------------------------------------- |
| `Authorization` | Yes      | `Bearer <token>` — must be scoped to the requested project |

### Response

```json theme={null}
{
  "data": {
    "url": "https://storage.example.com/statements/Q1-2025-royalties.xlsx?token=...",
    "fileName": "Q1-2025-royalties.xlsx",
    "fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    "expiresIn": 3600
  }
}
```

| Field       | Type    | Description                    |
| ----------- | ------- | ------------------------------ |
| `url`       | string  | Pre-signed download URL        |
| `fileName`  | string  | Original file name             |
| `fileType`  | string  | MIME type of the file          |
| `expiresIn` | integer | URL expiration time in seconds |

### Errors

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `400`  | Missing or invalid `projectId`               |
| `403`  | Token is not scoped to the requested project |
| `404`  | Statement not found                          |
| `429`  | Rate limit exceeded                          |

### Example

```bash theme={null}
curl "https://api.royaltyport.com/v1/statements/1234/download?projectId=a1b2c3d4-..." \
  -H "Authorization: Bearer rp_your_token_here"
```
