---
title: "Create a listing"
url: "https://real-estate-agency.apim.eu/apis/listing-creation/versions/ccce93aa-5880-49f4-849d-af24517f6c76/operations/createListing"
---

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

# Create a listing

`POST` `/listings`

Operation ID: `createListing`

Starts the generation of a listing from a property and a template. Processing runs asynchronously; the response initially carries `status: "in_progress"`.

## Request body (required)

Content types: `application/json`

## Responses

- `202` - Generation accepted
- `400` - The request doesn't match the schema
- `401` - Key is missing, revoked or invalid
- `403` - The key is missing a required scope
- `404` - Property or template not found
- `429` - Rate limit reached

## 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:
    post:
      tags:
        - Listings
      summary: Create a listing
      description: |
        Starts the generation of a listing from a property and a template.
        Processing runs asynchronously; the response initially carries
        `status: "in_progress"`.
      operationId: createListing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateListingRequest"
            examples:
              standard:
                summary: Apartment with the standard sections
                value:
                  property_id: prop_8f2c1a
                  template_id: tpl_classic
                  language: en
                  sections:
                    - location
                    - features
                    - energy
                    - floor_plan
                    - commission
              multilingual:
                summary: Spanish version for international prospects
                value:
                  property_id: prop_8f2c1a
                  template_id: tpl_modern
                  language: es
                  sections:
                    - location
                    - features
                    - energy
      responses:
        "202":
          description: Generation accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Listing"
              example:
                id: lst_4d9b2e
                property_id: prop_8f2c1a
                template_id: tpl_classic
                language: en
                status: in_progress
                created_at: 2026-08-20T09:41:12Z
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/NotAuthenticated"
        "403":
          $ref: "#/components/responses/ScopeMissing"
        "404":
          description: Property or template not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          $ref: "#/components/responses/TooManyRequests"
security:
  - apiKey: []
components:
  schemas:
    CreateListingRequest:
      type: object
      required:
        - property_id
        - template_id
      properties:
        property_id:
          type: string
          description: Property the listing is generated from.
          example: prop_8f2c1a
        template_id:
          type: string
          description: Design template of the agency.
          example: tpl_classic
        language:
          type: string
          description: Language of the generated document. Useful when marketing to
            international buyers.
          enum:
            - en
            - es
            - fr
            - de
          default: en
        sections:
          type: array
          description: Order and selection of sections. Defaults to the template's
            sections if omitted.
          items:
            $ref: "#/components/schemas/Section"
        internal_note:
          type: string
          maxLength: 500
          description: Internal remark; does not appear in the document.
          example: Owner prefers viewings starting September 1st.
    Listing:
      type: object
      properties:
        id:
          type: string
          example: lst_4d9b2e
        property_id:
          type: string
          example: prop_8f2c1a
        template_id:
          type: string
          example: tpl_classic
        language:
          type: string
          example: en
        status:
          $ref: "#/components/schemas/ListingStatus"
        pdf_url:
          type: string
          format: uri
          description: "Only set once `status: completed`. The link is valid for 24 hours."
          example: https://api.realestateagency.example/v1/listings/lst_4d9b2e/pdf
        pages:
          type: integer
          description: Page count of the generated document.
          example: 6
        disclosures:
          $ref: "#/components/schemas/DisclosureReport"
        created_at:
          type: string
          format: date-time
          example: 2026-08-20T09:41:12Z
        completed_at:
          type: string
          format: date-time
          nullable: true
          example: 2026-08-20T09:41:20Z
    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"
    Section:
      type: string
      description: Content block of the listing.
      enum:
        - location
        - features
        - energy
        - floor_plan
        - commission
        - neighborhood
        - history
    ListingStatus:
      type: string
      description: Lifecycle of a listing.
      enum:
        - in_progress
        - completed
        - published
        - withdrawn
        - failed
      example: completed
    DisclosureReport:
      type: object
      description: Result of the mandatory-disclosure check.
      properties:
        complete:
          type: boolean
          example: false
        missing:
          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
  responses:
    ValidationError:
      description: The request doesn't match the schema
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    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: []
    ScopeMissing:
      description: The key is missing a required scope
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: scope_missing
            message: The API key is missing a required scope.
            details:
              - field: listings:write
                reason: not_granted
    TooManyRequests:
      description: Rate limit reached
      headers:
        Retry-After:
          schema:
            type: integer
            example: 12
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  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`.
```
