---
title: "Download listing as PDF"
url: "https://real-estate-agency.apim.eu/apis/listing-creation/versions/ccce93aa-5880-49f4-849d-af24517f6c76/operations/getListingPdf"
---

> Full API specification: https://real-estate-agency.apim.eu/apis/listing-creation/versions/ccce93aa-5880-49f4-849d-af24517f6c76.md

# Download listing as PDF

`GET` `/listings/{listingId}/pdf`

Operation ID: `getListingPdf`

Returns the generated document. Only available once `status` is `completed` - before that the API responds with `409`.

## Path parameters

- `listingId` (string, required) - Identifier of the listing.

## Responses

- `200` - PDF document
- `401` - Key is missing, revoked or invalid
- `404` - The listing doesn't exist
- `409` - Generation not finished yet

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Listing Creation
  version: 1.0.0
servers:
  - url: https://api.realestateagency.example/v1
    description: Production
  - url: https://sandbox.api.realestateagency.example/v1
    description: Sandbox - data is reset nightly
paths:
  /listings/{listingId}/pdf:
    parameters:
      - $ref: "#/components/parameters/ListingId"
    get:
      tags:
        - Listings
      summary: Download listing as PDF
      description: |
        Returns the generated document. Only available once `status` is
        `completed` - before that the API responds with `409`.
      operationId: getListingPdf
      responses:
        "200":
          description: PDF document
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          $ref: "#/components/responses/NotAuthenticated"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          description: Generation not finished yet
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                code: conflict
                message: The listing is still being generated.
                details:
                  - field: status
                    reason: in_progress
security:
  - apiKey: []
components:
  parameters:
    ListingId:
      name: listingId
      in: path
      required: true
      description: Identifier of the listing.
      schema:
        type: string
        example: lst_4d9b2e
  responses:
    NotAuthenticated:
      description: Key is missing, revoked or invalid
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: not_authenticated
            message: The API key is invalid or has been revoked.
            details: []
    NotFound:
      description: The listing doesn't exist
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  schemas:
    Error:
      type: object
      description: Uniform error format across all Real Estate Agency APIs.
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: mandatory_disclosure_missing
        message:
          type: string
          example: Mandatory disclosures from the energy certificate are missing for
            publication.
        details:
          type: array
          items:
            $ref: "#/components/schemas/ErrorDetail"
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          example: energy_certificate.final_energy_demand_kwh
        reason:
          type: string
          example: missing
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: |
        Every call carries an API key in the `apikey` header. You generate the
        key in the Real Estate portal under "My Apps"; it's shown exactly once.

        Each key has the scopes it's allowed to use attached to it. If one is
        missing, the API responds with `403` and `code: "scope_missing"`; the
        missing scope is in `details[].field`.
```
