---
title: "Retrieves a document by ID"
url: "https://developers.zinnia.com/apis/documents-0-3-0/versions/43d1ee7b-44e7-4303-b0cd-ca813c63b625/operations/downloadDocument-v3"
---

> Full API specification: https://developers.zinnia.com/apis/documents-0-3-0/versions/43d1ee7b-44e7-4303-b0cd-ca813c63b625.md

# Retrieves a document by ID

`GET` `/document/v3/documents/{documentId}/download`

Operation ID: `downloadDocument-v3`

Downloads a document based on its unique identifier

## Path parameters

- `documentId` (string, required) - Unique ID in EDS DB

## Query parameters

- `documentClassification` (string, optional) - Classification of the document, e.g., OUTBOUND or INBOUND
- `parentCarrierCode` (string, optional) - Client code associated with the document
- `policyNumber` (string, optional) - Policy number associated with the document
- `planCode` (string, optional) - Plan code

## Header parameters

- `Authorization` (string, required) - Authorization token
- `x-correlation-id` (string, optional) - Unique ID for correlating requests

## Responses

- `200` - document downloaded successfully
- `403` - Forbidden
- `404` - Not Found
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Enterprise Documents API
  version: 3.0.0
servers:
  - url: https://dev.api.zinnia.io
    description: Dev Environment
  - url: https://qa.api.zinnia.io
    description: QA Environment
  - url: https://uat.api.zinnia.io
    description: UAT Environment
  - url: https://api.zinnia.io
    description: PROD Environment
paths:
  /document/v3/documents/{documentId}/download:
    get:
      security:
        - Auth0: []
      tags:
        - Documents V3
      summary: Retrieves a document by ID
      description: Downloads a document based on its unique identifier
      operationId: downloadDocument-v3
      parameters:
        - name: Authorization
          required: true
          in: header
          example: Bearer <token>
          description: Authorization token
          schema:
            type: string
        - name: documentId
          in: path
          required: true
          description: Unique ID in EDS DB
          example: 670e23dfab593b4387210b81
          schema:
            type: string
        - name: x-correlation-id
          in: header
          required: false
          description: Unique ID for correlating requests
          example: 123e4567-e89b-12d3-a456-426614174000
          schema:
            type: string
        - name: documentClassification
          in: query
          required: false
          schema:
            type: string
            enum:
              - OUTBOUND
              - INBOUND
          description: Classification of the document, e.g., OUTBOUND or INBOUND
          example: OUTBOUND
        - name: parentCarrierCode
          in: query
          required: false
          description: Client code associated with the document
          example: EVGL
          schema:
            type: string
        - name: policyNumber
          in: query
          required: false
          description: Policy number associated with the document
          example: "23109168"
          schema:
            type: string
        - name: planCode
          in: query
          required: false
          description: Plan code
          example: "565"
          schema:
            type: string
      responses:
        "200":
          description: document downloaded successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentDownloadResponse"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Access denied for document download
                  statusCode:
                    type: integer
                    example: 403
                  correlationId:
                    type: string
                    example: 123e4567-e89b-12d3-a456-426614174000
                  success:
                    type: boolean
                    example: false
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Document not found
                  statusCode:
                    type: integer
                    example: 404
                  correlationId:
                    type: string
                    example: 123e4567-e89b-12d3-a456-426614174000
                  success:
                    type: boolean
                    example: false
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: An unexpected error occurred while downloading document
                  statusCode:
                    type: integer
                    example: 500
                  correlationId:
                    type: string
                    example: 123e4567-e89b-12d3-a456-426614174000
                  success:
                    type: boolean
                    example: false
security:
  - Auth0: []
components:
  schemas:
    DocumentDownloadResponse:
      type: object
      properties:
        fileExtension:
          type: string
          description: File extension of the document
          example: pdf
        fileName:
          type: string
          description: Name of the document
          example: NB Application
        binaryData:
          type: string
          description: Binary data of the document
          example: wdvb2ekllkk189w0enjansle..
        correlationId:
          type: string
          description: Unique ID for correlating requests
          example: 123e4567-e89b-12d3-a456-426614174000
  securitySchemes:
    Auth0:
      type: openIdConnect
      openIdConnectUrl: https://login.zinnia.com/.well-known/openid-configuration
      x-kong-security-openid-connect:
        config:
          run_on_preflight: true
          scopes_claim:
            - https://api.zinnia.io/permissions
          audience_claim:
            - aud
          audience_required:
            - https://api.zinnia.io
          client_id:
            - bGOIRPRq2ZnjCujDXC7ikwR5ez7VH5GZ
          auth_methods:
            - bearer
          scopes: []
        enabled: true
        protocols:
          - grpc
          - grpcs
          - http
          - https
```
