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

# Download Verification Document

> Returns the document file itself. Files are proxied through Rolla, so you never call the identity provider directly. An imageId is only readable through the account it belongs to.

Returns the document file itself. Take `imageId` from [Get Verification Documents](/api-reference/endpoint/accounts/verification-documents).

The response is the raw file, not JSON. Files are proxied through Rolla, so you never talk to the identity provider directly.

## Example Request

```bash theme={null}
curl -X GET "https://api.rolla.xyz/api/v1/external/accounts/b6075be0-f1d0-451f-a468-3e94563101d2/verification/documents/909788538" \
  -H "X-API-Key: your_api_key_here" \
  -o passport.png
```

For a beneficial owner or director, use the related-person path:

```bash theme={null}
curl -X GET "https://api.rolla.xyz/api/v1/external/accounts/{accountId}/related-persons/{personId}/verification/documents/{imageId}" \
  -H "X-API-Key: your_api_key_here" \
  -o owner-passport.jpg
```

## Response

The file, with `Content-Type` and `Content-Disposition` set from its actual format.

| Header                | Example                                                      |
| --------------------- | ------------------------------------------------------------ |
| `Content-Type`        | `image/png`, `image/jpeg`, `image/webp` or `application/pdf` |
| `Content-Disposition` | `inline; filename="909788538.png"`                           |

<Warning>
  **Do not assume JPEG.** Applicants upload whatever their device produced — PNG and PDF are as common as JPEG, and the two documents we tested against came back as a 3.7 MB PNG and a 419 KB JPEG. Read `Content-Type` and set your file extension from it.
</Warning>

<Info>
  An `imageId` is only readable through the account it belongs to. Requesting one that belongs to a different customer returns `404`, whether or not the id is valid.
</Info>

## Error Responses

### Document not on this account (`404`)

```json theme={null}
{
  "status": 404,
  "message": "Document not found for this account"
}
```


## OpenAPI

````yaml GET /accounts/{accountId}/verification/documents/{imageId}
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /accounts/{accountId}/verification/documents/{imageId}:
    get:
      summary: Download Verification Document
      description: >-
        Returns the document file itself. Files are proxied through Rolla, so
        you never call the identity provider directly. An imageId is only
        readable through the account it belongs to.
      operationId: downloadAccountVerificationDocument
      parameters:
        - name: accountId
          in: path
          required: true
          description: >-
            Identifier of an account owned by the same user as your API key's
            business
          schema:
            type: string
            format: uuid
        - name: imageId
          in: path
          required: true
          description: Identifier of the document, taken from `documents[].imageId`
          schema:
            type: string
      responses:
        '200':
          description: >-
            The document file. Content-Type reflects the uploaded format — read
            it rather than assuming JPEG.
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            application/pdf:
              schema:
                type: string
                format: binary
        '404':
          description: The document does not belong to this account
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: Document not found for this account
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````