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

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

# Publish a listing

`POST` `/listings/{listingId}/publish`

Operation ID: `publishListing`

Puts the listing live on the chosen channels. Mandatory disclosures are checked first.

## Path parameters

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

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Published, or scheduled
- `401` - Key is missing, revoked or invalid
- `404` - The listing doesn't exist
- `422` - Mandatory disclosures are missing

## 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}/publish:
    parameters:
      - $ref: "#/components/parameters/ListingId"
    post:
      tags:
        - Listings
      summary: Publish a listing
      description: |
        Puts the listing live on the chosen channels. Mandatory disclosures
        are checked first.
      operationId: publishListing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - channels
              properties:
                channels:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Channel"
                scheduled_for:
                  type: string
                  format: date-time
                  description: Optional time for a later, scheduled publication.
            example:
              channels:
                - portal
                - website
                - newsletter
      responses:
        "200":
          description: Published, or scheduled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Publication"
        "401":
          $ref: "#/components/responses/NotAuthenticated"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          description: Mandatory disclosures are missing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                energy_certificate:
                  summary: Energy-certificate figures are missing
                  value:
                    code: mandatory_disclosure_missing
                    message: Mandatory disclosures from the energy certificate are missing for
                      publication.
                    details:
                      - field: energy_certificate.final_energy_demand_kwh
                        reason: missing
                      - field: energy_certificate.valid_until
                        reason: expired
                commission:
                  summary: Buyer share exceeds seller share
                  value:
                    code: commission_invalid
                    message: The buyer's share of the commission may not exceed the seller's share.
                    details:
                      - field: commission.buyer_percent
                        reason: exceeds_seller_share
security:
  - apiKey: []
components:
  parameters:
    ListingId:
      name: listingId
      in: path
      required: true
      description: Identifier of the listing.
      schema:
        type: string
        example: lst_4d9b2e
  schemas:
    Channel:
      type: string
      description: Publication channel.
      enum:
        - portal
        - website
        - newsletter
        - shop_window
    Publication:
      type: object
      properties:
        listing_id:
          type: string
          example: lst_4d9b2e
        status:
          $ref: "#/components/schemas/ListingStatus"
        channels:
          type: array
          items:
            type: object
            properties:
              channel:
                $ref: "#/components/schemas/Channel"
              state:
                type: string
                enum:
                  - live
                  - scheduled
                  - failed
              url:
                type: string
                format: uri
        published_at:
          type: string
          format: date-time
          example: 2026-08-20T09:44:03Z
    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"
    ListingStatus:
      type: string
      description: Lifecycle of a listing.
      enum:
        - in_progress
        - completed
        - published
        - withdrawn
        - failed
      example: completed
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          example: energy_certificate.final_energy_demand_kwh
        reason:
          type: string
          example: missing
  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"
  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`.
```
